summaryrefslogtreecommitdiff
authorandyq <andyq>2002-10-20 16:48:26 (UTC)
committer andyq <andyq>2002-10-20 16:48:26 (UTC)
commita24218529668ca387827ed520cea6d1890df7a88 (patch) (side-by-side diff)
tree0d9b03c671b57e636fe003dbd185922297396b5a
parent1f106a8b44ae659f30361588f53354e8f1985974 (diff)
downloadopie-a24218529668ca387827ed520cea6d1890df7a88.zip
opie-a24218529668ca387827ed520cea6d1890df7a88.tar.gz
opie-a24218529668ca387827ed520cea6d1890df7a88.tar.bz2
fixed bug with removing from local IPKGS folder
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/networkpkgmgr.cpp8
-rw-r--r--noncore/settings/aqpkg/package.cpp17
-rw-r--r--noncore/settings/aqpkg/package.h3
-rw-r--r--noncore/settings/aqpkg/server.cpp12
4 files changed, 31 insertions, 9 deletions
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
@@ -475,29 +475,35 @@ InstallData NetworkPackageManager :: dealWithItem( QCheckListItem *item )
QString dest = "root";
if ( !p->isInstalled() )
{
InstallData item;
item.option = "I";
item.packageName = name;
return item;
}
else
{
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'
if ( stickyOption == "" )
{
QString msgtext;
msgtext.sprintf( "Do you wish to remove or reinstall\n%s?", (const char *)name );
switch( QMessageBox::information( this, "Remove or ReInstall",
msgtext, "Remove", "ReInstall" ) )
{
case 0: // Try again or Enter
item.option = "D";
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
@@ -14,32 +14,39 @@
* (at your option) any later version. *
* *
***************************************************************************/
#include "package.h"
#include "global.h"
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()
{
}
QString Package :: toString()
{
QString ret = "Package - " + getPackageName() +
"\n version - " + getVersion();
if ( localPackage )
@@ -94,16 +101,24 @@ void Package :: setFilename( QString &f )
filename = f;
}
QString Package :: getInstalledVersion()
{
if ( localPackage )
return localPackage->getVersion();
else
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
@@ -46,34 +46,35 @@ public:
Package *getLocalPackage() { return localPackage; }
QString getPackageName() { return packageName; }
QString getVersion() { return version; }
QString getStatus() { return status; }
QString getDescription() { return description; }
QString getFilename() { return filename; }
bool isInstalled();
bool isPackageStoredLocally() { return packageStoredLocally; }
bool isInstalledToRoot() { return installedToRoot; }
QString getInstalledVersion();
+ QString getInstalledPackageName();
Destination *getInstalledTo() { return installedTo; }
QString toString();
private:
Package *localPackage;
QString packageName;
QString version;
QString status;
QString description;
QString filename;
- bool packageStoredLocally;
+ bool packageStoredLocally;
bool installedToRoot;
bool installed;
bool differentVersionAvailable;
Destination *installedTo;
};
#endif
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
@@ -97,34 +97,34 @@ void Server :: readLocalIpks( Server *local )
#ifdef QWS
// First, get any local IPKGs in the documents area
// Only applicable to Qtopie/Opie
DocLnkSet files;
Global::findDocuments( &files, "application/ipkg" );
// Now add the items to the list
QListIterator<DocLnk> it( files.children() );
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
QString names[] = { "advancedfm_0.9.1-20020811_arm.ipk", "libopie_0.9.1-20020811_arm.ipk", "libopieobex_0.9.1-20020811.1_arm.ipk", "opie-addressbook_0.9.1-20020811_arm.ipk" };
for ( int i = 0 ; i < 4 ; ++i )
{
// OK, we have a local IPK file, I think the standard naming conventions
// for these are packagename_version_arm.ipk
QString file = names[i];
int p = file.find( "_" );
QString tmp = file.mid( 0, p );
packageList.push_back( Package( tmp ) );