-rw-r--r-- | noncore/settings/aqpkg/networkpkgmgr.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp index ff8f182..06e2a03 100644 --- a/noncore/settings/aqpkg/networkpkgmgr.cpp +++ b/noncore/settings/aqpkg/networkpkgmgr.cpp @@ -219,97 +219,97 @@ void NetworkPackageManager :: updateServer() ipkg.runIpkg( ); } // Reload data dataMgr->reloadServerData( serversList->currentText() ); serverSelected(-1); delete dlg; } void NetworkPackageManager :: downloadPackage() { if ( download->text() == "Download" ) { // First, write out ipkg_conf file so that ipkg can use it dataMgr->writeOutIpkgConf(); // Display dialog to user asking where to download the files to bool ok = FALSE; QString dir = ""; #ifdef QWS // read download directory from config file Config cfg( "aqpkg" ); cfg.setGroup( "settings" ); dir = cfg.readEntry( "downloadDir", "/home/root/Documents/application/ipkg" ); #endif QString text = InputDialog::getText( tr( "Download to where" ), tr( "Enter path to download to" ), dir, &ok, this ); if ( ok && !text.isEmpty() ) dir = text; // user entered something and pressed ok else return; // user entered nothing or pressed cancel #ifdef QWS // Store download directory in config file cfg.writeEntry( "downloadDir", dir ); #endif // Get starting directory char initDir[PATH_MAX]; getcwd( initDir, PATH_MAX ); // Download each package Ipkg ipkg; connect( &ipkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &))); QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); ipkg.setOption( "download" ); - ipkg.setRuntimeDirectory( initDir ); + ipkg.setRuntimeDirectory( dir ); do { if ( item->isOn() ) { QString name = item->text(); int pos = name.find( "*" ); name.truncate( pos ); // if (there is a (installed), remove it pos = name.find( "(installed)" ); if ( pos > 0 ) name.truncate( pos - 1 ); ipkg.setPackage( name ); ipkg.runIpkg( ); } item = (QCheckListItem *)item->nextSibling(); } while ( item ); } else if ( download->text() == "Remove" ) { QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); do { if ( item->isOn() ) { QString name = item->text(); int pos = name.find( "*" ); name.truncate( pos ); // if (there is a (installed), remove it pos = name.find( "(installed)" ); if ( pos > 0 ) name.truncate( pos - 1 ); Package *p = dataMgr->getServer( serversList->currentText() )->getPackage( name ); QFile f( p->getFilename() ); f.remove(); } item = (QCheckListItem *)item->nextSibling(); } while ( item ); } dataMgr->reloadServerData( LOCAL_IPKGS ); serverSelected( -1 ); } |