summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/server.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/aqpkg/server.cpp') (more/less context) (ignore 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 )
{
// 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 );
@@ -241,12 +241,15 @@ void Server :: readPackageFile( Server *local, bool clearAll, bool installingToR
}
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
@@ -256,12 +259,20 @@ void Server :: buildLocalPackages( Server *local )
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() );