summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/networkpkgmgr.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/aqpkg/networkpkgmgr.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/networkpkgmgr.cpp88
1 files changed, 61 insertions, 27 deletions
diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp
index 6f528a1..ed5bf75 100644
--- a/noncore/settings/aqpkg/networkpkgmgr.cpp
+++ b/noncore/settings/aqpkg/networkpkgmgr.cpp
@@ -206,2 +206,20 @@ void NetworkPackageManager :: serverSelected( int )
QCheckListItem *item = new QCheckListItem( packagesList, text, QCheckListItem::CheckBox );
+
+ if ( it->isInstalled() )
+ {
+ QString destName = "";
+ if ( it->getLocalPackage() )
+ {
+ if ( it->getLocalPackage()->getInstalledTo() )
+ destName = it->getLocalPackage()->getInstalledTo()->getDestinationName();
+ }
+ else
+ {
+ if ( it->getInstalledTo() )
+ destName = it->getInstalledTo()->getDestinationName();
+ }
+ if ( destName != "" )
+ new QCheckListItem( item, QString( "Installed To - " ) + destName );
+ }
+
if ( !it->isPackageStoredLocally() )
@@ -257,16 +275,9 @@ void NetworkPackageManager :: updateServer()
-// if ( serverName == LOCAL_SERVER )
-// ;
-// else if ( serverName == LOCAL_IPKGS )
-// ;
-// else
- {
- QString option = "update";
- QString dummy = "";
- Ipkg ipkg;
- connect( &ipkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &)));
- ipkg.setOption( option );
-
- ipkg.runIpkg( );
- }
+ QString option = "update";
+ QString dummy = "";
+ Ipkg ipkg;
+ connect( &ipkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &)));
+ ipkg.setOption( option );
+
+ ipkg.runIpkg( );
@@ -396,3 +407,3 @@ void NetworkPackageManager :: applyChanges()
{
- // Disable buttons to stop silly people clicking lots on them :)
+ stickyOption = "";
@@ -404,3 +415,3 @@ void NetworkPackageManager :: applyChanges()
- vector<QString> workingPackages;
+ vector<InstallData> workingPackages;
for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild();
@@ -411,4 +422,4 @@ void NetworkPackageManager :: applyChanges()
{
- QString p = dealWithItem( item );
- workingPackages.push_back( p );
+ InstallData data = dealWithItem( item );
+ workingPackages.push_back( data );
}
@@ -439,3 +450,3 @@ void NetworkPackageManager :: applyChanges()
// If installed and version up to date - remove
-QString NetworkPackageManager :: dealWithItem( QCheckListItem *item )
+InstallData NetworkPackageManager :: dealWithItem( QCheckListItem *item )
{
@@ -460,6 +471,21 @@ QString NetworkPackageManager :: dealWithItem( QCheckListItem *item )
if ( !p->isInstalled() )
- return QString( "I" ) + name;
+ {
+ InstallData item;
+ item.option = "I";
+ item.packageName = name;
+ return item;
+ }
else
{
- if ( p->getVersion() == p->getInstalledVersion() )
+ InstallData item;
+ item.option = "D";
+ item.packageName = name;
+ if ( p->getInstalledTo() )
+ item.destination = p->getInstalledTo();
+ 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 == "" )
{
@@ -471,14 +497,22 @@ QString NetworkPackageManager :: dealWithItem( QCheckListItem *item )
case 0: // Try again or Enter
- return QString( "D" ) + name;
+ item.option = "D";
break;
case 1: // Quit or Escape
- return QString( "U" ) + name;
+ item.option = "U";
break;
}
-
- // User hit cancel (on dlg - assume remove)
- return QString( "D" ) + name;
}
else
- return QString( "U" ) + name;
+ {
+// item.option = stickyOption;
+ }
+
+ // Check if we are reinstalling the same version
+ if ( p->getVersion() != p->getInstalledVersion() )
+ item.recreateLinks = true;
+ else
+ item.recreateLinks = false;
+
+ // User hit cancel (on dlg - assume remove)
+ return item;
}