author | kergoth <kergoth> | 2003-08-09 16:12:19 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-08-09 16:12:19 (UTC) |
commit | 1c58d1407f9584fedcdae390a04e2b37e5853361 (patch) (unidiff) | |
tree | 3c6e741c4d382d1a53c182930052b684d6e35b91 /noncore/settings/aqpkg | |
parent | e3f4607edd0c1ca1434adb446df1d4a1d27c6a86 (diff) | |
download | opie-1c58d1407f9584fedcdae390a04e2b37e5853361.zip opie-1c58d1407f9584fedcdae390a04e2b37e5853361.tar.gz opie-1c58d1407f9584fedcdae390a04e2b37e5853361.tar.bz2 |
Merge from BRANCH_1_0
-rw-r--r-- | noncore/settings/aqpkg/mainwin.cpp | 12 | ||||
-rw-r--r-- | noncore/settings/aqpkg/opie-aqpkg.control | 2 | ||||
-rw-r--r-- | noncore/settings/aqpkg/package.cpp | 1 | ||||
-rw-r--r-- | noncore/settings/aqpkg/packagewin.cpp | 7 | ||||
-rw-r--r-- | noncore/settings/aqpkg/server.cpp | 13 |
5 files changed, 30 insertions, 5 deletions
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 ) | |||
1012 | { | 1012 | { |
1013 | InstallData *newitem = new InstallData(); | 1013 | InstallData *newitem = new InstallData(); |
1014 | newitem->option = "D"; | 1014 | newitem->option = "D"; |
1015 | |||
1016 | // If local file, remove using package name, not filename | ||
1017 | if ( p->isPackageStoredLocally() ) | ||
1018 | name = item->text(); | ||
1019 | |||
1015 | if ( !p->isPackageStoredLocally() ) | 1020 | if ( !p->isPackageStoredLocally() ) |
1016 | newitem->packageName = p->getInstalledPackageName(); | 1021 | newitem->packageName = p->getInstalledPackageName(); |
1017 | else | 1022 | else |
@@ -1041,6 +1046,10 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item ) | |||
1041 | { | 1046 | { |
1042 | // Version available is older - remove only | 1047 | // Version available is older - remove only |
1043 | newitem->option = "D"; | 1048 | newitem->option = "D"; |
1049 | |||
1050 | // If local file, remove using package name, not filename | ||
1051 | if ( p->isPackageStoredLocally() ) | ||
1052 | name = item->text(); | ||
1044 | } | 1053 | } |
1045 | else | 1054 | else |
1046 | { | 1055 | { |
@@ -1080,6 +1089,9 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item ) | |||
1080 | break; | 1089 | break; |
1081 | case 1: // Remove | 1090 | case 1: // Remove |
1082 | newitem->option = "D"; | 1091 | newitem->option = "D"; |
1092 | // If local file, remove using package name, not filename | ||
1093 | if ( p->isPackageStoredLocally() ) | ||
1094 | name = item->text(); | ||
1083 | break; | 1095 | break; |
1084 | case 2: // Reinstall or Upgrade | 1096 | case 2: // Reinstall or Upgrade |
1085 | newitem->option = secondOption; | 1097 | 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 | |||
2 | Files: bin/aqpkg pics/aqpkg apps/Settings/aqpkg.desktop | 2 | Files: bin/aqpkg pics/aqpkg apps/Settings/aqpkg.desktop |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: Settings | 4 | Section: Settings |
5 | Version: $QPE_VERSION-$SUB_VERSION | ||
6 | Depends: task-opie-minimal | 5 | Depends: task-opie-minimal |
7 | Replaces: aqpkg | 6 | Replaces: aqpkg |
8 | Architecture: arm | 7 | Architecture: arm |
9 | Maintainer: Andy Qua (andy.qua@blueyonder.co.uk) | 8 | Maintainer: Andy Qua (andy.qua@blueyonder.co.uk) |
10 | Description: A Package Manager | 9 | Description: A Package Manager |
11 | 10 | ||
11 | 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 ) | |||
116 | void Package :: setVersion( const QString &v ) | 116 | void Package :: setVersion( const QString &v ) |
117 | { | 117 | { |
118 | version = v; | 118 | version = v; |
119 | differentVersionAvailable = false; | ||
119 | 120 | ||
120 | if ( localPackage ) | 121 | if ( localPackage ) |
121 | if ( localPackage->getVersion() < getVersion() && !installed ) | 122 | 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 ) | |||
44 | QString str; | 44 | QString str; |
45 | if ( package ) | 45 | if ( package ) |
46 | { | 46 | { |
47 | Package *local = package->getLocalPackage(); | ||
47 | setCaption( package->getPackageName() ); | 48 | setCaption( package->getPackageName() ); |
48 | QString destName; | 49 | QString destName; |
49 | if ( package->getLocalPackage() ) | 50 | if ( local ) |
50 | { | 51 | { |
51 | if ( package->getLocalPackage()->getInstalledTo() ) | 52 | if ( local->getInstalledTo() ) |
52 | destName = package->getLocalPackage()->getInstalledTo()->getDestinationName(); | 53 | destName = package->getLocalPackage()->getInstalledTo()->getDestinationName(); |
53 | } | 54 | } |
54 | else | 55 | else |
@@ -86,7 +87,7 @@ PackageWindow::PackageWindow( Package *package, const QString &server ) | |||
86 | { | 87 | { |
87 | str.append( tr( "<p><b>Version Available</b> - " ) ); | 88 | str.append( tr( "<p><b>Version Available</b> - " ) ); |
88 | str.append( package->getVersion() ); | 89 | str.append( package->getVersion() ); |
89 | if ( package->getLocalPackage() ) | 90 | if ( local ) |
90 | { | 91 | { |
91 | if ( package->isInstalled() ) | 92 | if ( package->isInstalled() ) |
92 | { | 93 | { |
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 ) | |||
119 | QString file = (*it)->file(); | 119 | QString file = (*it)->file(); |
120 | 120 | ||
121 | // Changed to display the filename (excluding the path) | 121 | // Changed to display the filename (excluding the path) |
122 | QString packageName = Utils::getFilenameFromIpkFilename( file ); | 122 | QString packageName = Utils::getPackageNameFromIpkFilename( file ); |
123 | QString ver = Utils::getPackageVersionFromIpkFilename( file ); | 123 | QString ver = Utils::getPackageVersionFromIpkFilename( file ); |
124 | Package *package = new Package( packageName ); | 124 | Package *package = new Package( packageName ); |
125 | package->setVersion( ver ); | 125 | package->setVersion( ver ); |
@@ -244,6 +244,9 @@ void Server :: buildLocalPackages( Server *local ) | |||
244 | { | 244 | { |
245 | Package *curr; | 245 | Package *curr; |
246 | QListIterator<Package> it( packageList ); | 246 | QListIterator<Package> it( packageList ); |
247 | |||
248 | QList<Package> *locallist = &local->getPackageList(); | ||
249 | |||
247 | for ( ; it.current(); ++it ) | 250 | for ( ; it.current(); ++it ) |
248 | { | 251 | { |
249 | curr = it.current(); | 252 | curr = it.current(); |
@@ -259,6 +262,14 @@ void Server :: buildLocalPackages( Server *local ) | |||
259 | curr->setLocalPackage( p ); | 262 | curr->setLocalPackage( p ); |
260 | if ( p ) | 263 | if ( p ) |
261 | { | 264 | { |
265 | // Replace local version | ||
266 | if ( curr->getVersion() > p->getVersion() ) | ||
267 | { | ||
268 | int pos = locallist->at(); | ||
269 | locallist->remove( p ); | ||
270 | locallist->insert( pos, curr ); | ||
271 | } | ||
272 | |||
262 | // Set some default stuff like size and things | 273 | // Set some default stuff like size and things |
263 | if ( p->getInstalledVersion() == curr->getVersion() ) | 274 | if ( p->getInstalledVersion() == curr->getVersion() ) |
264 | { | 275 | { |