summaryrefslogtreecommitdiff
Unidiff
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
@@ -475,29 +475,35 @@ InstallData NetworkPackageManager :: dealWithItem( QCheckListItem *item )
475 QString dest = "root"; 475 QString dest = "root";
476 if ( !p->isInstalled() ) 476 if ( !p->isInstalled() )
477 { 477 {
478 InstallData item; 478 InstallData item;
479 item.option = "I"; 479 item.option = "I";
480 item.packageName = name; 480 item.packageName = name;
481 return item; 481 return item;
482 } 482 }
483 else 483 else
484 { 484 {
485 InstallData item; 485 InstallData item;
486 item.option = "D"; 486 item.option = "D";
487 item.packageName = name; 487 item.packageName = p->getInstalledPackageName();
488 if ( p->getInstalledTo() ) 488 if ( p->getInstalledTo() )
489 {
489 item.destination = p->getInstalledTo(); 490 item.destination = p->getInstalledTo();
491 cout << "dest - " << p->getInstalledTo()->getDestinationName() << endl;
492 cout << "dest - " << p->getInstalledTo()->getDestinationPath() << endl;
493 }
490 else 494 else
495 {
491 item.destination = p->getLocalPackage()->getInstalledTo(); 496 item.destination = p->getLocalPackage()->getInstalledTo();
497 }
492 498
493 // Sticky option not implemented yet, but will eventually allow 499 // Sticky option not implemented yet, but will eventually allow
494 // the user to say something like 'remove all' 500 // the user to say something like 'remove all'
495 if ( stickyOption == "" ) 501 if ( stickyOption == "" )
496 { 502 {
497 QString msgtext; 503 QString msgtext;
498 msgtext.sprintf( "Do you wish to remove or reinstall\n%s?", (const char *)name ); 504 msgtext.sprintf( "Do you wish to remove or reinstall\n%s?", (const char *)name );
499 switch( QMessageBox::information( this, "Remove or ReInstall", 505 switch( QMessageBox::information( this, "Remove or ReInstall",
500 msgtext, "Remove", "ReInstall" ) ) 506 msgtext, "Remove", "ReInstall" ) )
501 { 507 {
502 case 0: // Try again or Enter 508 case 0: // Try again or Enter
503 item.option = "D"; 509 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
@@ -16,30 +16,37 @@
16 ***************************************************************************/ 16 ***************************************************************************/
17 17
18#include "package.h" 18#include "package.h"
19#include "global.h" 19#include "global.h"
20 20
21Package::Package( QString &name ) 21Package::Package( QString &name )
22{ 22{
23 packageName = name; 23 packageName = name;
24 localPackage = 0; 24 localPackage = 0;
25 installed = false; 25 installed = false;
26 packageStoredLocally = false; 26 packageStoredLocally = false;
27 installedToRoot = false; 27 installedToRoot = false;
28 installed = false;
29 installedTo = 0;
28} 30}
29 31
30Package::Package( char *name ) 32Package::Package( char *name )
31{ 33{
32 packageName = name; 34 packageName = name;
33 localPackage = 0; 35 localPackage = 0;
36 installed = false;
37 packageStoredLocally = false;
38 installedToRoot = false;
39 installed = false;
40 installedTo = 0;
34} 41}
35 42
36Package::~Package() 43Package::~Package()
37{ 44{
38} 45}
39 46
40QString Package :: toString() 47QString Package :: toString()
41{ 48{
42 QString ret = "Package - " + getPackageName() + 49 QString ret = "Package - " + getPackageName() +
43 "\n version - " + getVersion(); 50 "\n version - " + getVersion();
44 51
45 if ( localPackage ) 52 if ( localPackage )
@@ -94,16 +101,24 @@ void Package :: setFilename( QString &f )
94 filename = f; 101 filename = f;
95} 102}
96 103
97 104
98QString Package :: getInstalledVersion() 105QString Package :: getInstalledVersion()
99{ 106{
100 if ( localPackage ) 107 if ( localPackage )
101 return localPackage->getVersion(); 108 return localPackage->getVersion();
102 else 109 else
103 return getVersion(); 110 return getVersion();
104} 111}
105 112
113QString Package :: getInstalledPackageName()
114{
115 if ( localPackage )
116 return localPackage->getPackageName();
117 else
118 return getPackageName();
119}
120
106bool Package :: isInstalled() 121bool Package :: isInstalled()
107{ 122{
108 return installed || ( localPackage && localPackage->isInstalled() ); 123 return installed || ( localPackage && localPackage->isInstalled() );
109} 124}
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,24 +46,25 @@ public:
46 46
47 Package *getLocalPackage() { return localPackage; } 47 Package *getLocalPackage() { return localPackage; }
48 QString getPackageName() { return packageName; } 48 QString getPackageName() { return packageName; }
49 QString getVersion() { return version; } 49 QString getVersion() { return version; }
50 QString getStatus() { return status; } 50 QString getStatus() { return status; }
51 QString getDescription() { return description; } 51 QString getDescription() { return description; }
52 QString getFilename() { return filename; } 52 QString getFilename() { return filename; }
53 53
54 bool isInstalled(); 54 bool isInstalled();
55 bool isPackageStoredLocally(){ return packageStoredLocally; } 55 bool isPackageStoredLocally(){ return packageStoredLocally; }
56 bool isInstalledToRoot() { return installedToRoot; } 56 bool isInstalledToRoot() { return installedToRoot; }
57 QString getInstalledVersion(); 57 QString getInstalledVersion();
58 QString getInstalledPackageName();
58 Destination *getInstalledTo() { return installedTo; } 59 Destination *getInstalledTo() { return installedTo; }
59 60
60 QString toString(); 61 QString toString();
61 62
62 63
63private: 64private:
64 Package *localPackage; 65 Package *localPackage;
65 66
66 QString packageName; 67 QString packageName;
67 QString version; 68 QString version;
68 QString status; 69 QString status;
69 QString description; 70 QString description;
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