summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg
Unidiff
Diffstat (limited to 'noncore/settings/aqpkg') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/aqpkg/mainwin.cpp12
-rw-r--r--noncore/settings/aqpkg/opie-aqpkg.control2
-rw-r--r--noncore/settings/aqpkg/package.cpp1
-rw-r--r--noncore/settings/aqpkg/packagewin.cpp7
-rw-r--r--noncore/settings/aqpkg/server.cpp13
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
@@ -1009,12 +1009,17 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
1009 return newitem; 1009 return newitem;
1010 } 1010 }
1011 else 1011 else
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
1018 newitem->packageName = name; 1023 newitem->packageName = name;
1019 1024
1020 if ( p->getInstalledTo() ) 1025 if ( p->getInstalledTo() )
@@ -1038,12 +1043,16 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
1038 // Error - should handle 1043 // Error - should handle
1039 } 1044 }
1040 else if ( val == -1 ) 1045 else if ( val == -1 )
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 {
1047 QString caption; 1056 QString caption;
1048 QString text; 1057 QString text;
1049 QString secondButton; 1058 QString secondButton;
@@ -1077,12 +1086,15 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
1077 case 0: // Cancel 1086 case 0: // Cancel
1078 delete newitem; 1087 delete newitem;
1079 return 0x0; 1088 return 0x0;
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;
1086 break; 1098 break;
1087 } 1099 }
1088 } 1100 }
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
@@ -1,11 +1,11 @@
1Package: opie-aqpkg 1Package: opie-aqpkg
2Files: bin/aqpkg pics/aqpkg apps/Settings/aqpkg.desktop 2Files: bin/aqpkg pics/aqpkg apps/Settings/aqpkg.desktop
3Priority: optional 3Priority: optional
4Section: Settings 4Section: Settings
5Version: $QPE_VERSION-$SUB_VERSION
6Depends: task-opie-minimal 5Depends: task-opie-minimal
7Replaces: aqpkg 6Replaces: aqpkg
8Architecture: arm 7Architecture: arm
9Maintainer: Andy Qua (andy.qua@blueyonder.co.uk) 8Maintainer: Andy Qua (andy.qua@blueyonder.co.uk)
10Description: A Package Manager 9Description: A Package Manager
11 10
11Version: $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
@@ -113,12 +113,13 @@ void Package :: setLocalPackage( Package *p )
113 differentVersionAvailable = false; 113 differentVersionAvailable = false;
114} 114}
115 115
116void Package :: setVersion( const QString &v ) 116void 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 )
122 differentVersionAvailable = true; 123 differentVersionAvailable = true;
123 else 124 else
124 differentVersionAvailable = false; 125 differentVersionAvailable = false;
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
@@ -41,17 +41,18 @@
41PackageWindow::PackageWindow( Package *package, const QString &server ) 41PackageWindow::PackageWindow( Package *package, const QString &server )
42 : QWidget( 0, 0, 0 ) 42 : QWidget( 0, 0, 0 )
43{ 43{
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
55 { 56 {
56 if ( package->getInstalledTo() ) 57 if ( package->getInstalledTo() )
57 destName = package->getInstalledTo()->getDestinationName(); 58 destName = package->getInstalledTo()->getDestinationName();
@@ -83,13 +84,13 @@ PackageWindow::PackageWindow( Package *package, const QString &server )
83 str.append( package->getVersion() ); 84 str.append( package->getVersion() );
84 } 85 }
85 else 86 else
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 {
93 str.append( tr( "<p><b>Version Installed</b> - " ) ); 94 str.append( tr( "<p><b>Version Installed</b> - " ) );
94 str.append( package->getInstalledVersion() ); 95 str.append( package->getInstalledVersion() );
95 } 96 }
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
@@ -116,13 +116,13 @@ void Server :: readLocalIpks( Server *local )
116 { 116 {
117 // OK, we have a local IPK file, I think the standard naming conventions 117 // OK, we have a local IPK file, I think the standard naming conventions
118 // for these are packagename_version_arm.ipk 118 // for these are packagename_version_arm.ipk
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 );
126 package->setFilename( file ); 126 package->setFilename( file );
127 package->setPackageStoredLocally( true ); 127 package->setPackageStoredLocally( true );
128 packageList.append( package ); 128 packageList.append( package );
@@ -241,12 +241,15 @@ void Server :: readPackageFile( Server *local, bool clearAll, bool installingToR
241} 241}
242 242
243void Server :: buildLocalPackages( Server *local ) 243void 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();
250 QString name = curr->getPackageName(); 253 QString name = curr->getPackageName();
251 254
252 // If the package name is an ipk name, then convert the filename to a package name 255 // If the package name is an ipk name, then convert the filename to a package name
@@ -256,12 +259,20 @@ void Server :: buildLocalPackages( Server *local )
256 if ( local ) 259 if ( local )
257 { 260 {
258 Package *p = local->getPackage( name ); 261 Package *p = local->getPackage( name );
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 {
265 p->setPackageSize( curr->getPackageSize() ); 276 p->setPackageSize( curr->getPackageSize() );
266 p->setSection( curr->getSection() ); 277 p->setSection( curr->getSection() );
267 p->setDescription( curr->getDescription() ); 278 p->setDescription( curr->getDescription() );