OSDN Git Service

ark: call emitResult() before returning
authorIvailo Monev <xakepa10@gmail.com>
Mon, 2 Mar 2015 08:36:20 +0000 (08:36 +0000)
committerIvailo Monev <xakepa10@gmail.com>
Mon, 2 Mar 2015 08:36:20 +0000 (08:36 +0000)
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

index d13e095..b58f88a 100644 (file)
@@ -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 <command>--autofilename</command> 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;
         }