author | drw <drw> | 2003-04-20 23:58:21 (UTC) |
---|---|---|
committer | drw <drw> | 2003-04-20 23:58:21 (UTC) |
commit | 9163bfcc25b78477a75a153f2a75be30ad297c6a (patch) (side-by-side diff) | |
tree | 668e10a9bb0ca7937e3f630a62d3afbbbbf06438 | |
parent | 6b78c023f67433b8f38d9e77598b8530988bfec8 (diff) | |
download | opie-9163bfcc25b78477a75a153f2a75be30ad297c6a.zip opie-9163bfcc25b78477a75a153f2a75be30ad297c6a.tar.gz opie-9163bfcc25b78477a75a153f2a75be30ad297c6a.tar.bz2 |
Finally fixed it so that packages are not incorrectly marked as having an update available
-rw-r--r-- | noncore/settings/aqpkg/mainwin.cpp | 6 | ||||
-rw-r--r-- | noncore/settings/aqpkg/package.cpp | 5 | ||||
-rw-r--r-- | noncore/settings/aqpkg/package.h | 19 | ||||
-rw-r--r-- | noncore/settings/aqpkg/server.cpp | 2 |
4 files changed, 16 insertions, 16 deletions
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp index 6ea619c..fb40d52 100644 --- a/noncore/settings/aqpkg/mainwin.cpp +++ b/noncore/settings/aqpkg/mainwin.cpp @@ -636,14 +636,13 @@ void MainWindow :: serverSelected( int, bool raiseProgress ) if ( showInstalledPkgs && !package->isInstalled() ) continue; // Apply show only new installed packages filter if ( showUpgradedPkgs ) { - if ( !package->isInstalled() || - compareVersions( package->getInstalledVersion(), package->getVersion() ) != 1 ) + if ( !package->isInstalled() || !package->getNewVersionAvailable() ) continue; } // Apply the section filter if ( categoryFilterEnabled && categoryFilter != "" ) { @@ -660,14 +659,13 @@ void MainWindow :: serverSelected( int, bool raiseProgress ) QCheckListItem::CheckBox ); if ( package->isInstalled() ) { // If a different version of package is available, show update available icon // Otherwise, show installed icon - if ( package->getVersion() != package->getInstalledVersion() && - compareVersions( package->getInstalledVersion(), package->getVersion() ) == 1) + if ( package->getNewVersionAvailable()) { item->setPixmap( 0, updatedIcon ); } else { diff --git a/noncore/settings/aqpkg/package.cpp b/noncore/settings/aqpkg/package.cpp index 83e0706..3395870 100644 --- a/noncore/settings/aqpkg/package.cpp +++ b/noncore/settings/aqpkg/package.cpp @@ -47,12 +47,13 @@ Package::Package( char *name ) localPackage = 0; installed = false; packageStoredLocally = false; installedToRoot = false; installed = false; installedTo = 0; + differentVersionAvailable = false; } Package::~Package() { } @@ -86,24 +87,24 @@ void Package :: setStatus( const QString &s ) void Package :: setLocalPackage( Package *p ) { localPackage = p; if ( localPackage ) - if ( localPackage->getVersion() != getVersion() ) + if ( localPackage->getVersion() < getVersion() && !installed ) differentVersionAvailable = true; else differentVersionAvailable = false; } void Package :: setVersion( const QString &v ) { version = v; if ( localPackage ) - if ( localPackage->getVersion() != getVersion() ) + if ( localPackage->getVersion() < getVersion() && !installed ) differentVersionAvailable = true; else differentVersionAvailable = false; } void Package :: setPackageName( const QString &name ) diff --git a/noncore/settings/aqpkg/package.h b/noncore/settings/aqpkg/package.h index f5a132f..110ae91 100644 --- a/noncore/settings/aqpkg/package.h +++ b/noncore/settings/aqpkg/package.h @@ -44,21 +44,22 @@ public: void setInstalledToRoot( bool root ) { installedToRoot = root; } void setInstalledTo( Destination *d ) { installedTo = d; } void setDependancies( QString &deps ) { dependancies = deps; } void setPackageSize( const QString &size ) { packageSize = size; } void setSection( const QString §) { section = sect; } - Package *getLocalPackage() { return localPackage; } - QString getPackageName() { return packageName; } - QString getVersion() { return version; } - QString getStatus() { return status; } - QString getDescription() { return description; } - QString getFilename() { return filename; } - QString getDependancies() { return dependancies; } - QString getPackageSize() { return packageSize; } - QString getSection() { return section; } + Package *getLocalPackage() { return localPackage; } + QString getPackageName() { return packageName; } + QString getVersion() { return version; } + QString getStatus() { return status; } + QString getDescription() { return description; } + QString getFilename() { return filename; } + QString getDependancies() { return dependancies; } + QString getPackageSize() { return packageSize; } + QString getSection() { return section; } + bool getNewVersionAvailable() { return differentVersionAvailable; } bool isInstalled(); bool isPackageStoredLocally() { return packageStoredLocally; } bool isInstalledToRoot() { return installedToRoot; } QString getInstalledVersion(); QString getInstalledPackageName(); diff --git a/noncore/settings/aqpkg/server.cpp b/noncore/settings/aqpkg/server.cpp index 9a239a5..e2b8096 100644 --- a/noncore/settings/aqpkg/server.cpp +++ b/noncore/settings/aqpkg/server.cpp @@ -181,13 +181,13 @@ void Server :: readPackageFile( Server *local, bool clearAll, bool installingToR currPackage->setInstalledTo( dest ); if ( installingToRoot ) currPackage->setInstalledToRoot( true ); } else { - if (currPackage->getStatus().find( "deinstall" ) != -1 ) + if ( currPackage->isInstalled() ) currPackage->setInstalledTo( dest ); } } else if ( key == "Version" ) { if ( currPackage ) |