author | andyq <andyq> | 2002-11-19 17:31:00 (UTC) |
---|---|---|
committer | andyq <andyq> | 2002-11-19 17:31:00 (UTC) |
commit | abeb38c25d2cfe90d1a17912a63c9518e602766c (patch) (unidiff) | |
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 | |||
@@ -244,13 +244,27 @@ void Server :: buildLocalPackages( Server *local ) | |||
244 | 244 | ||
245 | // If the package name is an ipk name, then convert the filename to a package name | 245 | // If the package name is an ipk name, then convert the filename to a package name |
246 | if ( name.find( ".ipk" ) != -1 ) | 246 | if ( name.find( ".ipk" ) != -1 ) |
247 | name = Utils::getPackageNameFromIpkFilename( packageList[i].getFilename() ); | 247 | name = Utils::getPackageNameFromIpkFilename( packageList[i].getFilename() ); |
248 | 248 | ||
249 | if ( local ) | 249 | if ( local ) |
250 | packageList[i].setLocalPackage( local->getPackage( name ) ); | 250 | { |
251 | Package *p = local->getPackage( name ); | ||
252 | packageList[i].setLocalPackage( p ); | ||
253 | if ( p ) | ||
254 | { | ||
255 | // Set some default stuff like size and things | ||
256 | if ( p->getInstalledVersion() == packageList[i].getVersion() ) | ||
257 | { | ||
258 | p->setPackageSize( packageList[i].getPackageSize() ); | ||
259 | p->setSection( packageList[i].getSection() ); | ||
260 | p->setDescription( packageList[i].getDescription() ); | ||
261 | } | ||
262 | } | ||
263 | |||
264 | } | ||
251 | else | 265 | else |
252 | packageList[i].setLocalPackage( 0 ); | 266 | packageList[i].setLocalPackage( 0 ); |
253 | } | 267 | } |
254 | 268 | ||
255 | } | 269 | } |
256 | 270 | ||
@@ -280,19 +294,13 @@ QString Server :: toString() | |||
280 | 294 | ||
281 | for ( unsigned int i = 0 ; i < packageList.size() ; ++i ) | 295 | for ( unsigned int i = 0 ; i < packageList.size() ; ++i ) |
282 | ret += "\n " + packageList[i].toString(); | 296 | ret += "\n " + packageList[i].toString(); |
283 | 297 | ||
284 | 298 | ||
285 | return ret; | 299 | return ret; |
286 | } /* | ||
287 | void addAvailableSection( QString section ) | ||
288 | { | ||
289 | if ( DataManager::availableCategories.find( value ) == -1 ) | ||
290 | // DataManager::availableCategories += "#" + value; | ||
291 | } | 300 | } |
292 | */ | ||
293 | 301 | ||
294 | vector<Package> &Server::getPackageList() | 302 | vector<Package> &Server::getPackageList() |
295 | { | 303 | { |
296 | return packageList; | 304 | return packageList; |
297 | } | 305 | } |
298 | 306 | ||