From a24218529668ca387827ed520cea6d1890df7a88 Mon Sep 17 00:00:00 2001 From: andyq Date: Sun, 20 Oct 2002 16:48:26 +0000 Subject: fixed bug with removing from local IPKGS folder --- (limited to 'noncore/settings') diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp index 3aee7bd..d84fb4b 100644 --- a/noncore/settings/aqpkg/networkpkgmgr.cpp +++ b/noncore/settings/aqpkg/networkpkgmgr.cpp @@ -484,11 +484,17 @@ InstallData NetworkPackageManager :: dealWithItem( QCheckListItem *item ) { InstallData item; item.option = "D"; - item.packageName = name; + item.packageName = p->getInstalledPackageName(); if ( p->getInstalledTo() ) + { item.destination = p->getInstalledTo(); + cout << "dest - " << p->getInstalledTo()->getDestinationName() << endl; + cout << "dest - " << p->getInstalledTo()->getDestinationPath() << endl; + } else + { item.destination = p->getLocalPackage()->getInstalledTo(); + } // Sticky option not implemented yet, but will eventually allow // the user to say something like 'remove all' diff --git a/noncore/settings/aqpkg/package.cpp b/noncore/settings/aqpkg/package.cpp index 48b6934..fd75450 100644 --- a/noncore/settings/aqpkg/package.cpp +++ b/noncore/settings/aqpkg/package.cpp @@ -23,14 +23,21 @@ Package::Package( QString &name ) packageName = name; localPackage = 0; installed = false; - packageStoredLocally = false; + packageStoredLocally = false; installedToRoot = false; + installed = false; + installedTo = 0; } Package::Package( char *name ) { packageName = name; localPackage = 0; + installed = false; + packageStoredLocally = false; + installedToRoot = false; + installed = false; + installedTo = 0; } Package::~Package() @@ -103,6 +110,14 @@ QString Package :: getInstalledVersion() return getVersion(); } +QString Package :: getInstalledPackageName() +{ + if ( localPackage ) + return localPackage->getPackageName(); + else + return getPackageName(); +} + bool Package :: isInstalled() { return installed || ( localPackage && localPackage->isInstalled() ); diff --git a/noncore/settings/aqpkg/package.h b/noncore/settings/aqpkg/package.h index 8ba5a6a..2f2a165 100644 --- a/noncore/settings/aqpkg/package.h +++ b/noncore/settings/aqpkg/package.h @@ -55,6 +55,7 @@ public: bool isPackageStoredLocally() { return packageStoredLocally; } bool isInstalledToRoot() { return installedToRoot; } QString getInstalledVersion(); + QString getInstalledPackageName(); Destination *getInstalledTo() { return installedTo; } QString toString(); @@ -68,7 +69,7 @@ private: QString status; QString description; QString filename; - bool packageStoredLocally; + bool packageStoredLocally; bool installedToRoot; bool installed; bool differentVersionAvailable; diff --git a/noncore/settings/aqpkg/server.cpp b/noncore/settings/aqpkg/server.cpp index 7d103a2..8bca892 100644 --- a/noncore/settings/aqpkg/server.cpp +++ b/noncore/settings/aqpkg/server.cpp @@ -106,16 +106,16 @@ void Server :: readLocalIpks( Server *local ) for ( ; it.current() ; ++it ) { - // OK, we have a local IPK file, I think the standard naming conventions - // for these are packagename_version_arm.ipk - QString file = (*it)->file(); + // OK, we have a local IPK file, I think the standard naming conventions + // for these are packagename_version_arm.ipk + QString file = (*it)->file(); QString packageName = Utils::getPackageNameFromIpkFilename( file ); QString ver = Utils::getPackageVersionFromIpkFilename( file ); packageList.push_back( Package( packageName ) ); - packageList.back().setVersion( ver ); - packageList.back().setFilename( file ); - packageList.back().setPackageStoredLocally( true ); + packageList.back().setVersion( ver ); + packageList.back().setFilename( file ); + packageList.back().setPackageStoredLocally( true ); } #else -- cgit v0.9.0.2