summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/aqpkg/package.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/noncore/settings/aqpkg/package.cpp b/noncore/settings/aqpkg/package.cpp
index 99187ac..83e0706 100644
--- a/noncore/settings/aqpkg/package.cpp
+++ b/noncore/settings/aqpkg/package.cpp
@@ -67,15 +67,23 @@ QString Package :: toString()
return ret;
}
void Package :: setStatus( const QString &s )
{
- status = s;
+ QString state_status;
+ int two, three;
- if ( status.find( "ok installed" ) != -1 )
+ status = s.simplifyWhiteSpace( );
+
+ two = status.find( " " ); // find second column
+ three = status.find( " ", two + 1 ); // find third column
+
+ state_status = status.mid( three ).stripWhiteSpace( );
+
+ if ( state_status == "installed" )
installed = true;
}
void Package :: setLocalPackage( Package *p )
{
localPackage = p;