From 1c58d1407f9584fedcdae390a04e2b37e5853361 Mon Sep 17 00:00:00 2001 From: kergoth Date: Sat, 09 Aug 2003 16:12:19 +0000 Subject: Merge from BRANCH_1_0 --- (limited to 'noncore/settings/aqpkg') diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp index 45a6663..42093cf 100644 --- a/noncore/settings/aqpkg/mainwin.cpp +++ b/noncore/settings/aqpkg/mainwin.cpp @@ -1012,6 +1012,11 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item ) { InstallData *newitem = new InstallData(); newitem->option = "D"; + + // If local file, remove using package name, not filename + if ( p->isPackageStoredLocally() ) + name = item->text(); + if ( !p->isPackageStoredLocally() ) newitem->packageName = p->getInstalledPackageName(); else @@ -1041,6 +1046,10 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item ) { // Version available is older - remove only newitem->option = "D"; + + // If local file, remove using package name, not filename + if ( p->isPackageStoredLocally() ) + name = item->text(); } else { @@ -1080,6 +1089,9 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item ) break; case 1: // Remove newitem->option = "D"; + // If local file, remove using package name, not filename + if ( p->isPackageStoredLocally() ) + name = item->text(); break; case 2: // Reinstall or Upgrade newitem->option = secondOption; diff --git a/noncore/settings/aqpkg/opie-aqpkg.control b/noncore/settings/aqpkg/opie-aqpkg.control index b8ad1e8..46bffdd 100644 --- a/noncore/settings/aqpkg/opie-aqpkg.control +++ b/noncore/settings/aqpkg/opie-aqpkg.control @@ -2,10 +2,10 @@ Package: opie-aqpkg Files: bin/aqpkg pics/aqpkg apps/Settings/aqpkg.desktop Priority: optional Section: Settings -Version: $QPE_VERSION-$SUB_VERSION Depends: task-opie-minimal Replaces: aqpkg Architecture: arm Maintainer: Andy Qua (andy.qua@blueyonder.co.uk) Description: A Package Manager +Version: $QPE_VERSION$EXTRAVERSION diff --git a/noncore/settings/aqpkg/package.cpp b/noncore/settings/aqpkg/package.cpp index adda832..5a521d3 100644 --- a/noncore/settings/aqpkg/package.cpp +++ b/noncore/settings/aqpkg/package.cpp @@ -116,6 +116,7 @@ void Package :: setLocalPackage( Package *p ) void Package :: setVersion( const QString &v ) { version = v; + differentVersionAvailable = false; if ( localPackage ) if ( localPackage->getVersion() < getVersion() && !installed ) diff --git a/noncore/settings/aqpkg/packagewin.cpp b/noncore/settings/aqpkg/packagewin.cpp index 9553cd1..499d647 100644 --- a/noncore/settings/aqpkg/packagewin.cpp +++ b/noncore/settings/aqpkg/packagewin.cpp @@ -44,11 +44,12 @@ PackageWindow::PackageWindow( Package *package, const QString &server ) QString str; if ( package ) { + Package *local = package->getLocalPackage(); setCaption( package->getPackageName() ); QString destName; - if ( package->getLocalPackage() ) + if ( local ) { - if ( package->getLocalPackage()->getInstalledTo() ) + if ( local->getInstalledTo() ) destName = package->getLocalPackage()->getInstalledTo()->getDestinationName(); } else @@ -86,7 +87,7 @@ PackageWindow::PackageWindow( Package *package, const QString &server ) { str.append( tr( "

Version Available - " ) ); str.append( package->getVersion() ); - if ( package->getLocalPackage() ) + if ( local ) { if ( package->isInstalled() ) { diff --git a/noncore/settings/aqpkg/server.cpp b/noncore/settings/aqpkg/server.cpp index 4693db1..0282236 100644 --- a/noncore/settings/aqpkg/server.cpp +++ b/noncore/settings/aqpkg/server.cpp @@ -119,7 +119,7 @@ void Server :: readLocalIpks( Server *local ) QString file = (*it)->file(); // Changed to display the filename (excluding the path) - QString packageName = Utils::getFilenameFromIpkFilename( file ); + QString packageName = Utils::getPackageNameFromIpkFilename( file ); QString ver = Utils::getPackageVersionFromIpkFilename( file ); Package *package = new Package( packageName ); package->setVersion( ver ); @@ -244,6 +244,9 @@ void Server :: buildLocalPackages( Server *local ) { Package *curr; QListIterator it( packageList ); + + QList *locallist = &local->getPackageList(); + for ( ; it.current(); ++it ) { curr = it.current(); @@ -259,6 +262,14 @@ void Server :: buildLocalPackages( Server *local ) curr->setLocalPackage( p ); if ( p ) { + // Replace local version + if ( curr->getVersion() > p->getVersion() ) + { + int pos = locallist->at(); + locallist->remove( p ); + locallist->insert( pos, curr ); + } + // Set some default stuff like size and things if ( p->getInstalledVersion() == curr->getVersion() ) { -- cgit v0.9.0.2