summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/server.cpp
Unidiff
Diffstat (limited to 'noncore/settings/aqpkg/server.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/aqpkg/server.cpp13
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
@@ -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() );