author | andyq <andyq> | 2002-11-19 17:31:00 (UTC) |
---|---|---|
committer | andyq <andyq> | 2002-11-19 17:31:00 (UTC) |
commit | abeb38c25d2cfe90d1a17912a63c9518e602766c (patch) (side-by-side diff) | |
tree | 79df89e95a7dafc4a3bf9a7e377b41467396f20d /noncore/settings/aqpkg/server.cpp | |
parent | 638b671dce5eff05a2ec666492c060fa2fd021a2 (diff) | |
download | opie-abeb38c25d2cfe90d1a17912a63c9518e602766c.zip opie-abeb38c25d2cfe90d1a17912a63c9518e602766c.tar.gz opie-abeb38c25d2cfe90d1a17912a63c9518e602766c.tar.bz2 |
Changed so that the size of a package is passed down into the local package
(as long as the package installed is the same version as the package
available in the feed)
Diffstat (limited to 'noncore/settings/aqpkg/server.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/server.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/noncore/settings/aqpkg/server.cpp b/noncore/settings/aqpkg/server.cpp index 7c3257b..726cf00 100644 --- a/noncore/settings/aqpkg/server.cpp +++ b/noncore/settings/aqpkg/server.cpp @@ -238,25 +238,39 @@ void Server :: readPackageFile( Server *local, bool clearAll, bool installingToR void Server :: buildLocalPackages( Server *local ) { for ( unsigned int i = 0 ; i < packageList.size() ; ++i ) { QString name = packageList[i].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( packageList[i].getFilename() ); if ( local ) - packageList[i].setLocalPackage( local->getPackage( name ) ); + { + Package *p = local->getPackage( name ); + packageList[i].setLocalPackage( p ); + if ( p ) + { + // Set some default stuff like size and things + if ( p->getInstalledVersion() == packageList[i].getVersion() ) + { + p->setPackageSize( packageList[i].getPackageSize() ); + p->setSection( packageList[i].getSection() ); + p->setDescription( packageList[i].getDescription() ); + } + } + + } else packageList[i].setLocalPackage( 0 ); } } Package *Server :: getPackage( QString &name ) { return getPackage( (const char *)name ); } Package *Server :: getPackage( const char *name ) @@ -274,25 +288,19 @@ Package *Server :: getPackage( const char *name ) QString Server :: toString() { QString ret = "Server\n name - " + serverName + "\n url - " + serverUrl + "\n"; for ( unsigned int i = 0 ; i < packageList.size() ; ++i ) ret += "\n " + packageList[i].toString(); return ret; -} /* -void addAvailableSection( QString section ) -{ - if ( DataManager::availableCategories.find( value ) == -1 ) -// DataManager::availableCategories += "#" + value; } -*/ vector<Package> &Server::getPackageList() { return packageList; } |