author | andyq <andyq> | 2002-10-17 22:58:36 (UTC) |
---|---|---|
committer | andyq <andyq> | 2002-10-17 22:58:36 (UTC) |
commit | cd48ed3935f1baa6392afee5764d0927abcf62cc (patch) (side-by-side diff) | |
tree | 54423b7242c59457ded23ce0dd1e89ce05b630b1 /noncore/settings/aqpkg/networkpkgmgr.cpp | |
parent | 4ce3fb5c10a50aece4ef8a78d07ed116ad754c27 (diff) | |
download | opie-cd48ed3935f1baa6392afee5764d0927abcf62cc.zip opie-cd48ed3935f1baa6392afee5764d0927abcf62cc.tar.gz opie-cd48ed3935f1baa6392afee5764d0927abcf62cc.tar.bz2 |
Changed so that installings/removing and upgrading from/to multiple destinations
works better
Diffstat (limited to 'noncore/settings/aqpkg/networkpkgmgr.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/networkpkgmgr.cpp | 88 |
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; } |