-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 ) | |||
636 | if ( showInstalledPkgs && !package->isInstalled() ) | 636 | if ( showInstalledPkgs && !package->isInstalled() ) |
637 | continue; | 637 | continue; |
638 | 638 | ||
639 | // Apply show only new installed packages filter | 639 | // Apply show only new installed packages filter |
640 | if ( showUpgradedPkgs ) | 640 | if ( showUpgradedPkgs ) |
641 | { | 641 | { |
642 | if ( !package->isInstalled() || | 642 | if ( !package->isInstalled() || !package->getNewVersionAvailable() ) |
643 | compareVersions( package->getInstalledVersion(), package->getVersion() ) != 1 ) | ||
644 | continue; | 643 | continue; |
645 | } | 644 | } |
646 | 645 | ||
647 | // Apply the section filter | 646 | // Apply the section filter |
648 | if ( categoryFilterEnabled && categoryFilter != "" ) | 647 | if ( categoryFilterEnabled && categoryFilter != "" ) |
649 | { | 648 | { |
@@ -660,14 +659,13 @@ void MainWindow :: serverSelected( int, bool raiseProgress ) | |||
660 | QCheckListItem::CheckBox ); | 659 | QCheckListItem::CheckBox ); |
661 | 660 | ||
662 | if ( package->isInstalled() ) | 661 | if ( package->isInstalled() ) |
663 | { | 662 | { |
664 | // If a different version of package is available, show update available icon | 663 | // If a different version of package is available, show update available icon |
665 | // Otherwise, show installed icon | 664 | // Otherwise, show installed icon |
666 | if ( package->getVersion() != package->getInstalledVersion() && | 665 | if ( package->getNewVersionAvailable()) |
667 | compareVersions( package->getInstalledVersion(), package->getVersion() ) == 1) | ||
668 | { | 666 | { |
669 | 667 | ||
670 | item->setPixmap( 0, updatedIcon ); | 668 | item->setPixmap( 0, updatedIcon ); |
671 | } | 669 | } |
672 | else | 670 | else |
673 | { | 671 | { |
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 ) | |||
47 | localPackage = 0; | 47 | localPackage = 0; |
48 | installed = false; | 48 | installed = false; |
49 | packageStoredLocally = false; | 49 | packageStoredLocally = false; |
50 | installedToRoot = false; | 50 | installedToRoot = false; |
51 | installed = false; | 51 | installed = false; |
52 | installedTo = 0; | 52 | installedTo = 0; |
53 | differentVersionAvailable = false; | ||
53 | } | 54 | } |
54 | 55 | ||
55 | Package::~Package() | 56 | Package::~Package() |
56 | { | 57 | { |
57 | } | 58 | } |
58 | 59 | ||
@@ -86,24 +87,24 @@ void Package :: setStatus( const QString &s ) | |||
86 | 87 | ||
87 | void Package :: setLocalPackage( Package *p ) | 88 | void Package :: setLocalPackage( Package *p ) |
88 | { | 89 | { |
89 | localPackage = p; | 90 | localPackage = p; |
90 | 91 | ||
91 | if ( localPackage ) | 92 | if ( localPackage ) |
92 | if ( localPackage->getVersion() != getVersion() ) | 93 | if ( localPackage->getVersion() < getVersion() && !installed ) |
93 | differentVersionAvailable = true; | 94 | differentVersionAvailable = true; |
94 | else | 95 | else |
95 | differentVersionAvailable = false; | 96 | differentVersionAvailable = false; |
96 | } | 97 | } |
97 | 98 | ||
98 | void Package :: setVersion( const QString &v ) | 99 | void Package :: setVersion( const QString &v ) |
99 | { | 100 | { |
100 | version = v; | 101 | version = v; |
101 | 102 | ||
102 | if ( localPackage ) | 103 | if ( localPackage ) |
103 | if ( localPackage->getVersion() != getVersion() ) | 104 | if ( localPackage->getVersion() < getVersion() && !installed ) |
104 | differentVersionAvailable = true; | 105 | differentVersionAvailable = true; |
105 | else | 106 | else |
106 | differentVersionAvailable = false; | 107 | differentVersionAvailable = false; |
107 | } | 108 | } |
108 | 109 | ||
109 | void Package :: setPackageName( const QString &name ) | 110 | 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: | |||
44 | void setInstalledToRoot( bool root ) { installedToRoot = root; } | 44 | void setInstalledToRoot( bool root ) { installedToRoot = root; } |
45 | void setInstalledTo( Destination *d ) { installedTo = d; } | 45 | void setInstalledTo( Destination *d ) { installedTo = d; } |
46 | void setDependancies( QString &deps ) { dependancies = deps; } | 46 | void setDependancies( QString &deps ) { dependancies = deps; } |
47 | void setPackageSize( const QString &size ) { packageSize = size; } | 47 | void setPackageSize( const QString &size ) { packageSize = size; } |
48 | void setSection( const QString §) { section = sect; } | 48 | void setSection( const QString §) { section = sect; } |
49 | 49 | ||
50 | Package *getLocalPackage() { return localPackage; } | 50 | Package *getLocalPackage() { return localPackage; } |
51 | QString getPackageName() { return packageName; } | 51 | QString getPackageName() { return packageName; } |
52 | QString getVersion() { return version; } | 52 | QString getVersion() { return version; } |
53 | QString getStatus() { return status; } | 53 | QString getStatus() { return status; } |
54 | QString getDescription() { return description; } | 54 | QString getDescription() { return description; } |
55 | QString getFilename() { return filename; } | 55 | QString getFilename() { return filename; } |
56 | QString getDependancies() { return dependancies; } | 56 | QString getDependancies() { return dependancies; } |
57 | QString getPackageSize() { return packageSize; } | 57 | QString getPackageSize() { return packageSize; } |
58 | QString getSection() { return section; } | 58 | QString getSection() { return section; } |
59 | bool getNewVersionAvailable() { return differentVersionAvailable; } | ||
59 | 60 | ||
60 | bool isInstalled(); | 61 | bool isInstalled(); |
61 | bool isPackageStoredLocally(){ return packageStoredLocally; } | 62 | bool isPackageStoredLocally(){ return packageStoredLocally; } |
62 | bool isInstalledToRoot() { return installedToRoot; } | 63 | bool isInstalledToRoot() { return installedToRoot; } |
63 | QString getInstalledVersion(); | 64 | QString getInstalledVersion(); |
64 | QString getInstalledPackageName(); | 65 | 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 | |||
181 | currPackage->setInstalledTo( dest ); | 181 | currPackage->setInstalledTo( dest ); |
182 | if ( installingToRoot ) | 182 | if ( installingToRoot ) |
183 | currPackage->setInstalledToRoot( true ); | 183 | currPackage->setInstalledToRoot( true ); |
184 | } | 184 | } |
185 | else | 185 | else |
186 | { | 186 | { |
187 | if (currPackage->getStatus().find( "deinstall" ) != -1 ) | 187 | if ( currPackage->isInstalled() ) |
188 | currPackage->setInstalledTo( dest ); | 188 | currPackage->setInstalledTo( dest ); |
189 | } | 189 | } |
190 | } | 190 | } |
191 | else if ( key == "Version" ) | 191 | else if ( key == "Version" ) |
192 | { | 192 | { |
193 | if ( currPackage ) | 193 | if ( currPackage ) |