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 ) // 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 ); } } @@ -280,19 +294,13 @@ QString Server :: toString() 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; } |