-rw-r--r-- | noncore/settings/aqpkg/datamgr.cpp | 22 | ||||
-rw-r--r-- | noncore/settings/aqpkg/datamgr.h | 2 | ||||
-rw-r--r-- | noncore/settings/aqpkg/networkpkgmgr.cpp | 22 |
3 files changed, 25 insertions, 21 deletions
diff --git a/noncore/settings/aqpkg/datamgr.cpp b/noncore/settings/aqpkg/datamgr.cpp index 089c3e3..f342aff 100644 --- a/noncore/settings/aqpkg/datamgr.cpp +++ b/noncore/settings/aqpkg/datamgr.cpp @@ -136,12 +136,12 @@ void DataManager :: loadServers() fclose( fp ); - vector<Server>::iterator it; - for ( it = serverList.begin() ; it != serverList.end() ; ++it ) - reloadServerData( it->getServerName() ); + reloadServerData( ); } -void DataManager :: reloadServerData( const char *serverName ) +void DataManager :: reloadServerData( ) +{ + vector<Server>::iterator it = serverList.begin(); + for ( it = serverList.begin() ; it != serverList.end() ; ++it ) { - Server *s = getServer( serverName ); // Now we've read the config file in we need to read the servers // The local server is a special case. This holds the contents of the @@ -149,11 +149,11 @@ void DataManager :: reloadServerData( const char *serverName ) // we've set up // The other servers files hold the contents of the server package list - if ( s->getServerName() == LOCAL_SERVER ) - s->readStatusFile( destList ); - else if ( s->getServerName() == LOCAL_IPKGS ) - s->readLocalIpks( getServer( LOCAL_SERVER ) ); + if ( it->getServerName() == LOCAL_SERVER ) + it->readStatusFile( destList ); + else if ( it->getServerName() == LOCAL_IPKGS ) + it->readLocalIpks( getServer( LOCAL_SERVER ) ); else - s->readPackageFile( getServer( LOCAL_SERVER ) ); - + it->readPackageFile( getServer( LOCAL_SERVER ) ); + } } diff --git a/noncore/settings/aqpkg/datamgr.h b/noncore/settings/aqpkg/datamgr.h index eb802b5..8c6fb0d 100644 --- a/noncore/settings/aqpkg/datamgr.h +++ b/noncore/settings/aqpkg/datamgr.h @@ -50,5 +50,5 @@ public: void loadServers(); - void reloadServerData( const char *sn ); + void reloadServerData( ); void writeOutIpkgConf(); diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp index 02e4e73..b5d7352 100644 --- a/noncore/settings/aqpkg/networkpkgmgr.cpp +++ b/noncore/settings/aqpkg/networkpkgmgr.cpp @@ -216,5 +216,4 @@ void NetworkPackageManager :: serverSelected( int ) Server *s = dataMgr->getServer( serverName ); -// dataMgr->setActiveServer( serverName ); vector<Package> &list = s->getPackageList(); @@ -222,4 +221,5 @@ void NetworkPackageManager :: serverSelected( int ) for ( it = list.begin() ; it != list.end() ; ++it ) { + QString text = ""; @@ -236,4 +236,5 @@ void NetworkPackageManager :: serverSelected( int ) if ( it->getVersion() != it->getInstalledVersion() ) { + if ( compareVersions( it->getInstalledVersion(), it->getVersion() ) == 1 ) text += "*"; @@ -265,4 +266,10 @@ void NetworkPackageManager :: serverSelected( int ) new QCheckListItem( item, QString( "Filename - " ) + it->getFilename() ); + if ( serverName == LOCAL_SERVER ) + { + new QCheckListItem( item, QString( "V. Installed - " ) + it->getVersion() ); + } + else + { new QCheckListItem( item, QString( "V. Available - " ) + it->getVersion() ); if ( it->getLocalPackage() ) @@ -271,4 +278,5 @@ void NetworkPackageManager :: serverSelected( int ) new QCheckListItem( item, QString( "V. Installed - " ) + it->getInstalledVersion() ); } + } packagesList->insertItem( item ); } @@ -318,5 +326,5 @@ void NetworkPackageManager :: updateServer() // Reload data - dataMgr->reloadServerData( serversList->currentText() ); + dataMgr->reloadServerData(); serverSelected(-1); // delete progDlg; @@ -347,7 +355,5 @@ void NetworkPackageManager :: upgradePackages() // Reload data - dataMgr->reloadServerData( LOCAL_SERVER ); - - dataMgr->reloadServerData( serversList->currentText() ); + dataMgr->reloadServerData(); serverSelected(-1); } @@ -437,5 +443,5 @@ void NetworkPackageManager :: downloadPackage() } - dataMgr->reloadServerData( LOCAL_IPKGS ); + dataMgr->reloadServerData(); serverSelected( -1 ); } @@ -478,7 +484,5 @@ void NetworkPackageManager :: applyChanges() // Reload data - dataMgr->reloadServerData( LOCAL_SERVER ); - - dataMgr->reloadServerData( serversList->currentText() ); + dataMgr->reloadServerData(); serverSelected(-1); |