Diffstat (limited to 'noncore/settings/aqpkg/networkpkgmgr.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/networkpkgmgr.cpp | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp index 76c7a9c..d43c6ac 100644 --- a/noncore/settings/aqpkg/networkpkgmgr.cpp +++ b/noncore/settings/aqpkg/networkpkgmgr.cpp @@ -57,6 +57,11 @@ NetworkPackageManager::NetworkPackageManager( DataManager *dataManager, QWidget currentlySelectedServer = cfg.readEntry( "selectedServer", "local" ); showJumpTo = cfg.readBoolEntry( "showJumpTo", "true" ); + #endif + showUninstalledPkgs = false; + showInstalledPkgs = false; + showUpgradedPkgs = false; + initGui(); @@ -64,6 +69,4 @@ NetworkPackageManager::NetworkPackageManager( DataManager *dataManager, QWidget updateData(); -// progressDlg = 0; -// timerId = startTimer( 100 ); } @@ -76,9 +79,6 @@ void NetworkPackageManager :: timerEvent ( QTimerEvent * ) killTimer( timerId ); -// showProgressDialog(); // Add server names to listbox updateData(); - -// progressDlg->hide(); } @@ -224,8 +224,25 @@ void NetworkPackageManager :: serverSelected( int ) QString text = ""; + // Apply show only uninstalled packages filter + if ( showUninstalledPkgs && it->isInstalled() ) + continue; + + // Apply show only installed packages filter + if ( showInstalledPkgs && !it->isInstalled() ) + continue; + + // Apply show only new installed packages filter + if ( showUpgradedPkgs ) + { + if ( !it->isInstalled() || + compareVersions( it->getInstalledVersion(), it->getVersion() ) != 1 ) + continue; + } + // If the local server, only display installed packages if ( serverName == LOCAL_SERVER && !it->isInstalled() ) continue; + text += it->getPackageName(); if ( it->isInstalled() ) @@ -770,2 +787,20 @@ void NetworkPackageManager :: searchForPackage( bool findNext ) } } + +void NetworkPackageManager :: showOnlyUninstalledPackages( bool val ) +{ + showUninstalledPkgs = val; + serverSelected( -1 ); +} + +void NetworkPackageManager :: showOnlyInstalledPackages( bool val ) +{ + showInstalledPkgs = val; + serverSelected( -1 ); +} + +void NetworkPackageManager :: showUpgradedPackages( bool val ) +{ + showUpgradedPkgs = val; + serverSelected( -1 ); +} |