-rw-r--r-- | noncore/settings/aqpkg/package.cpp | 12 |
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 @@ -57,35 +57,43 @@ Package::~Package() } QString Package :: toString() { QString ret = "Package - " + getPackageName() + "\n version - " + getVersion(); if ( localPackage ) ret += "\n inst version - " + localPackage->getVersion(); 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; if ( localPackage ) if ( localPackage->getVersion() != getVersion() ) differentVersionAvailable = true; else differentVersionAvailable = false; } void Package :: setVersion( const QString &v ) { |