Fixed bugs related to archive unpacking. This resolves bug 2655.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
feat/lzip-support
Michele Calgaro 8 years ago
parent b5e19dc055
commit c69a0d8f6b

@ -59,6 +59,7 @@
KURL KChooseDir::getDir(TQString text,const KURL& url, const KURL& cwd) {
KURLRequesterDlg *dlg = new KURLRequesterDlg( vfs::pathOrURL( url, 1 ),text,krApp,"");
dlg->urlRequester()->completionObject()->setDir(cwd.url());
dlg->urlRequester()->setMode(KFile::LocalOnly | KFile::Directory);
KURL u;
if (dlg->exec() == TQDialog::Accepted) {
u = vfs::fromPathOrURL(dlg->urlRequester()->completionObject()->replacedPath(

@ -903,7 +903,6 @@ void ListPanelFunc::testArchive() {
}
void ListPanelFunc::unpack() {
TQStringList fileNames;
panel->getSelectedNames( &fileNames );
if ( fileNames.isEmpty() )
@ -917,7 +916,9 @@ void ListPanelFunc::unpack() {
// ask the user for the copy dest
KURL dest = KChooseDir::getDir(s, panel->otherPanel->virtualPath(), panel->virtualPath());
if ( dest.isEmpty() ) return ; // the user canceled
if ( dest.isEmpty() ) {
return ; // the user canceled
}
bool packToOtherPanel = ( dest.equals( panel->otherPanel->virtualPath(), true ) );
@ -940,6 +941,24 @@ void ListPanelFunc::unpack() {
} else
url = arcURL.path( -1 );
// for local destionation, check whether it exists or not
if ( dest.isLocalFile() ) {
TQDir destdir = TQDir(dest.path(1));
if (!destdir.exists()) {
// Destination folder does not exists
int res = KMessageBox::warningContinueCancel( NULL,
i18n("The destination folder does not exist.\nDo you want to create it?"),
i18n("Create folder"));
if ( res != KMessageBox::Continue ) {
return;
}
// Create destination folder. If failed, return
if (!destdir.mkdir(destdir.absPath())) {
KMessageBox::error(NULL, i18n("Unable to create the destionation folder. Aborting operation."), i18n("Error!"));
}
}
}
// if the destination is in remote directory use temporary one instead
dest.adjustPath(1);
KURL originalDestURL;

Loading…
Cancel
Save