author | kergoth <kergoth> | 2003-08-09 16:12:19 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-08-09 16:12:19 (UTC) |
commit | 1c58d1407f9584fedcdae390a04e2b37e5853361 (patch) (side-by-side diff) | |
tree | 3c6e741c4d382d1a53c182930052b684d6e35b91 /noncore/settings/aqpkg/server.cpp | |
parent | e3f4607edd0c1ca1434adb446df1d4a1d27c6a86 (diff) | |
download | opie-1c58d1407f9584fedcdae390a04e2b37e5853361.zip opie-1c58d1407f9584fedcdae390a04e2b37e5853361.tar.gz opie-1c58d1407f9584fedcdae390a04e2b37e5853361.tar.bz2 |
Merge from BRANCH_1_0
Diffstat (limited to 'noncore/settings/aqpkg/server.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/server.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
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 @@ -106,33 +106,33 @@ void Server :: readLocalIpks( Server *local ) // First, get any local IPKGs in the documents area // Only applicable to Qtopie/Opie DocLnkSet files; Global::findDocuments( &files, "application/ipkg" ); // Now add the items to the list QListIterator<DocLnk> it( files.children() ); for ( ; it.current() ; ++it ) { // OK, we have a local IPK file, I think the standard naming conventions // for these are packagename_version_arm.ipk 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 ); package->setFilename( file ); package->setPackageStoredLocally( true ); packageList.append( package ); } #else QString names[] = { "advancedfm_0.9.1-20020811_arm.ipk", "libopie_0.9.1-20020811_arm.ipk", "libopieobex_0.9.1-20020811.1_arm.ipk", "opie-addressbook_0.9.1-20020811_arm.ipk" }; for ( int i = 0 ; i < 4 ; ++i ) { // OK, we have a local IPK file, I think the standard naming conventions // for these are packagename_version_arm.ipk QString file = names[i]; int p = file.find( "_" ); QString tmp = file.mid( 0, p ); @@ -231,47 +231,58 @@ void Server :: readPackageFile( Server *local, bool clearAll, bool installingToR else if ( key == QString::null ) { newPackage = true; } } f.close(); // build local packages buildLocalPackages( local ); } void Server :: buildLocalPackages( Server *local ) { Package *curr; QListIterator<Package> it( packageList ); + + QList<Package> *locallist = &local->getPackageList(); + for ( ; it.current(); ++it ) { curr = it.current(); QString name = curr->getPackageName(); // If the package name is an ipk name, then convert the filename to a package name if ( name.find( ".ipk" ) != -1 ) name = Utils::getPackageNameFromIpkFilename( curr->getFilename() ); if ( local ) { Package *p = local->getPackage( name ); 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() ) { p->setPackageSize( curr->getPackageSize() ); p->setSection( curr->getSection() ); p->setDescription( curr->getDescription() ); } } } else curr->setLocalPackage( 0 ); } } |