summaryrefslogtreecommitdiff
authorandyq <andyq>2002-11-01 12:41:03 (UTC)
committer andyq <andyq>2002-11-01 12:41:03 (UTC)
commit0e34499726f7fa275363988ea466d13aab09f544 (patch) (side-by-side diff)
tree20403963ae3c1b315c2d1fd4b23a33754289287c
parent4c5a56dbaddb3ac6b587c61a8ba6841987cf60fa (diff)
downloadopie-0e34499726f7fa275363988ea466d13aab09f544.zip
opie-0e34499726f7fa275363988ea466d13aab09f544.tar.gz
opie-0e34499726f7fa275363988ea466d13aab09f544.tar.bz2
Fixed a bug where if a package was removed from the local view the packages didn't get relinked properly
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/datamgr.cpp34
-rw-r--r--noncore/settings/aqpkg/datamgr.h2
-rw-r--r--noncore/settings/aqpkg/networkpkgmgr.cpp32
3 files changed, 36 insertions, 32 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
@@ -134,28 +134,28 @@ 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( )
{
- 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
- // status files the number of which depends on how many destinations
- // 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 ) );
- else
- s->readPackageFile( getServer( LOCAL_SERVER ) );
-
+ vector<Server>::iterator it = serverList.begin();
+ for ( it = serverList.begin() ; it != serverList.end() ; ++it )
+ {
+ // 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
+ // status files the number of which depends on how many destinations
+ // we've set up
+ // The other servers files hold the contents of the server package list
+ if ( it->getServerName() == LOCAL_SERVER )
+ it->readStatusFile( destList );
+ else if ( it->getServerName() == LOCAL_IPKGS )
+ it->readLocalIpks( getServer( LOCAL_SERVER ) );
+ else
+ it->readPackageFile( getServer( LOCAL_SERVER ) );
+ }
}
void DataManager :: writeOutIpkgConf()
{
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
@@ -48,9 +48,9 @@ public:
vector<Destination> &getDestinationList() { return destList; }
Destination *getDestination( const char *name );
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
@@ -214,14 +214,14 @@ void NetworkPackageManager :: serverSelected( int )
cfg.writeEntry( "selectedServer", currentlySelectedServer );
#endif
Server *s = dataMgr->getServer( serverName );
-// dataMgr->setActiveServer( serverName );
vector<Package> &list = s->getPackageList();
vector<Package>::iterator it;
for ( it = list.begin() ; it != list.end() ; ++it )
{
+
QString text = "";
// If the local server, only display installed packages
if ( serverName == LOCAL_SERVER && !it->isInstalled() )
@@ -234,8 +234,9 @@ void NetworkPackageManager :: serverSelected( int )
// If a different version of package is available, postfix it with an *
if ( it->getVersion() != it->getInstalledVersion() )
{
+
if ( compareVersions( it->getInstalledVersion(), it->getVersion() ) == 1 )
text += "*";
}
}
@@ -263,13 +264,20 @@ void NetworkPackageManager :: serverSelected( int )
new QCheckListItem( item, QString( "Description - " ) + it->getDescription() );
else
new QCheckListItem( item, QString( "Filename - " ) + it->getFilename() );
- new QCheckListItem( item, QString( "V. Available - " ) + it->getVersion() );
- if ( it->getLocalPackage() )
- {
- if ( it->isInstalled() )
- new QCheckListItem( item, QString( "V. Installed - " ) + it->getInstalledVersion() );
+ if ( serverName == LOCAL_SERVER )
+ {
+ new QCheckListItem( item, QString( "V. Installed - " ) + it->getVersion() );
+ }
+ else
+ {
+ new QCheckListItem( item, QString( "V. Available - " ) + it->getVersion() );
+ if ( it->getLocalPackage() )
+ {
+ if ( it->isInstalled() )
+ new QCheckListItem( item, QString( "V. Installed - " ) + it->getInstalledVersion() );
+ }
}
packagesList->insertItem( item );
}
@@ -316,9 +324,9 @@ void NetworkPackageManager :: updateServer()
InstallDlgImpl dlg( &ipkg, "Refreshing server package lists", this, "Upgrade", true );
dlg.showDlg();
// Reload data
- dataMgr->reloadServerData( serversList->currentText() );
+ dataMgr->reloadServerData();
serverSelected(-1);
// delete progDlg;
}
@@ -345,11 +353,9 @@ void NetworkPackageManager :: upgradePackages()
InstallDlgImpl dlg( &ipkg, "Upgrading installed packages", this, "Upgrade", true );
dlg.showDlg();
// Reload data
- dataMgr->reloadServerData( LOCAL_SERVER );
-
- dataMgr->reloadServerData( serversList->currentText() );
+ dataMgr->reloadServerData();
serverSelected(-1);
}
}
@@ -435,9 +441,9 @@ void NetworkPackageManager :: downloadPackage()
}
}
}
- dataMgr->reloadServerData( LOCAL_IPKGS );
+ dataMgr->reloadServerData();
serverSelected( -1 );
}
@@ -476,11 +482,9 @@ void NetworkPackageManager :: applyChanges()
InstallDlgImpl dlg( workingPackages, dataMgr, this, "Install", true );
dlg.showDlg();
// Reload data
- dataMgr->reloadServerData( LOCAL_SERVER );
-
- dataMgr->reloadServerData( serversList->currentText() );
+ dataMgr->reloadServerData();
serverSelected(-1);
#ifdef QWS
// Finally let the main system update itself