From 8f2db8a1631e58f6222a2456eb491bd44857812e Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Mon, 2 Mar 2015 08:36:20 +0000 Subject: [PATCH] ark: call emitResult() before returning even when used from the ark app it still locks up, and even if it was ment to be called only from the ark app it's a shared library which everyone can use so to this is neccessary anyway. --- ark/kerfuffle/addtoarchive.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ark/kerfuffle/addtoarchive.cpp b/ark/kerfuffle/addtoarchive.cpp index d13e0958..b58f88af 100644 --- a/ark/kerfuffle/addtoarchive.cpp +++ b/ark/kerfuffle/addtoarchive.cpp @@ -118,8 +118,6 @@ void AddToArchive::start() QTimer::singleShot(0, this, SLOT(slotStartJob())); } -// TODO: If this class should ever be called outside main.cpp, -// the returns should be preceded by emitResult(). void AddToArchive::slotStartJob(void) { kDebug(); @@ -138,11 +136,13 @@ void AddToArchive::slotStartJob(void) } else { if (m_autoFilenameSuffix.isEmpty()) { KMessageBox::error(NULL, i18n("You need to either supply a filename for the archive or a suffix (such as rar, tar.gz) with the --autofilename argument.")); + emitResult(); return; } if (m_firstPath.isEmpty()) { kDebug() << "Weird, this should not happen. no firstpath defined. aborting"; + emitResult(); return; } @@ -167,15 +167,18 @@ void AddToArchive::slotStartJob(void) if (archive == NULL) { KMessageBox::error(NULL, i18n("Failed to create the new archive. Permissions might not be sufficient.")); + emitResult(); return; } else if (archive->isReadOnly()) { KMessageBox::error(NULL, i18n("It is not possible to create archives of this type.")); + emitResult(); return; } if (m_changeToFirstPath) { if (m_firstPath.isEmpty()) { kDebug() << "Weird, this should not happen. no firstpath defined. aborting"; + emitResult(); return; } -- 2.11.0