summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/aqpkg/networkpkgmgr.cpp8
-rw-r--r--noncore/settings/aqpkg/package.cpp15
-rw-r--r--noncore/settings/aqpkg/package.h1
-rw-r--r--noncore/settings/aqpkg/server.cpp0
4 files changed, 23 insertions, 1 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
@@ -463,53 +463,59 @@ InstallData NetworkPackageManager :: dealWithItem( QCheckListItem *item )
pos = name.find( "(installed)" );
if ( pos > 0 )
name.truncate( pos - 1 );
// Get package
Server *s = dataMgr->getServer( serversList->currentText() );
Package *p = s->getPackage( name );
// If the package has a filename then it is a local file
if ( p->isPackageStoredLocally() )
name = p->getFilename();
QString option;
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";
break;
case 1: // Quit or Escape
item.option = "U";
break;
}
}
else
{
// item.option = stickyOption;
}
// Check if we are reinstalling the same version
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
@@ -4,54 +4,61 @@
begin : Mon Aug 26 2002
copyright : (C) 2002 by Andy Qua
email : andy.qua@blueyonder.co.uk
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "package.h"
#include "global.h"
Package::Package( QString &name )
{
packageName = name;
localPackage = 0;
installed = 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 )
ret += "\n inst version - " + localPackage->getVersion();
return ret;
}
void Package :: setStatus( QString &s )
{
status = s;
if ( status.find( "installed" ) != -1 )
installed = true;
@@ -82,28 +89,36 @@ void Package :: setVersion( QString &v )
void Package :: setPackageName( QString &name )
{
packageName = name;
}
void Package :: setDescription( QString &d )
{
description = d;
}
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
@@ -34,46 +34,47 @@ public:
Package( char *name );
~Package();
void setLocalPackage( Package *p );
void setPackageName( QString &name );
void setVersion( QString &v );
void setStatus( QString &s );
void setDescription( QString &d );
void setFilename( QString &f );
void setPackageStoredLocally( bool local ) { packageStoredLocally = local; }
void setInstalledToRoot( bool root ) { installedToRoot = root; }
void setInstalledTo( Destination *d ) { installedTo = d; }
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 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