From cf34849ac5c3eb9d16929cc88834973910209f74 Mon Sep 17 00:00:00 2001 From: andyq Date: Sat, 02 Nov 2002 13:52:55 +0000 Subject: Handles upgrading of local ipk files better and the Local-IPKG view displays the name of the file rather thanthe package name (so version can easily be seen) --- (limited to 'noncore/settings/aqpkg/networkpkgmgr.cpp') diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp index 3d06aef..dee834e 100644 --- a/noncore/settings/aqpkg/networkpkgmgr.cpp +++ b/noncore/settings/aqpkg/networkpkgmgr.cpp @@ -514,9 +514,10 @@ InstallData NetworkPackageManager :: dealWithItem( QCheckListItem *item ) Server *s = dataMgr->getServer( serversList->currentText() ); Package *p = s->getPackage( name ); - // If the package has a filename then it is a local file - if ( p->isPackageStoredLocally() ) - name = p->getFilename(); + // If the package has a filename then it is a local file + if ( p->isPackageStoredLocally() ) + name = p->getFilename(); + QString option; QString dest = "root"; if ( !p->isInstalled() ) @@ -524,13 +525,17 @@ InstallData NetworkPackageManager :: dealWithItem( QCheckListItem *item ) InstallData item; item.option = "I"; item.packageName = name; - return item; + return item; } else { InstallData item; item.option = "D"; - item.packageName = p->getInstalledPackageName(); + if ( !p->isPackageStoredLocally() ) + item.packageName = p->getInstalledPackageName(); + else + item.packageName = name; + if ( p->getInstalledTo() ) { item.destination = p->getInstalledTo(); @@ -544,6 +549,11 @@ InstallData NetworkPackageManager :: dealWithItem( QCheckListItem *item ) // Now see if version is newer or not int val = compareVersions( p->getInstalledVersion(), p->getVersion() ); + + // If the version requested is older and user selected a local ipk file, then reinstall the file + if ( p->isPackageStoredLocally() && val == -1 ) + val = 0; + if ( val == -2 ) { // Error - should handle -- cgit v0.9.0.2