[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [ark/Applications/15.12] kerfuffle: Do not show a messagebox with empty error message
From:       Elvis Angelaccio <elvis.angelaccio () kdemail ! net>
Date:       2015-12-08 21:26:49
Message-ID: E1a6Pmb-0002js-4J () scm ! kde ! org
[Download RAW message or body]

Git commit d059701e0a07bc8214e6e0a4104732d09c05cf35 by Elvis Angelaccio.
Committed on 08/12/2015 at 21:09.
Pushed by elvisangelaccio into branch 'Applications/15.12'.

Do not show a messagebox with empty error message

When the user stops an AddToArchive job (e.g. from the Notifications plasmo=
id),
the errorText() of the stopped AddJob is empty and a meaningless KMessageBo=
x is
displayed. With this patch, the messagebox is created only if there is an e=
rror to show.

As a side effect, Ark stops crashing when using cliplugins, because emitRes=
ult() is not
blocked anymore by the messagebox. For the same reason, the end of the clip=
lugin's
QProcess is not anymore delayed until the user closes the messagebox.

Note that if there would be an error message, Ark would crash anyway.

CCBUG: 222392

M  +2    -2    kerfuffle/addtoarchive.cpp

http://commits.kde.org/ark/d059701e0a07bc8214e6e0a4104732d09c05cf35

diff --git a/kerfuffle/addtoarchive.cpp b/kerfuffle/addtoarchive.cpp
index 134aacb..6ded97f 100644
--- a/kerfuffle/addtoarchive.cpp
+++ b/kerfuffle/addtoarchive.cpp
@@ -223,9 +223,9 @@ void AddToArchive::slotStartJob()
 =

 void AddToArchive::slotFinished(KJob *job)
 {
-    qCDebug(ARK) << "Job finished";
+    qCDebug(ARK) << "AddToArchive job finished";
 =

-    if (job->error()) {
+    if (job->error() && !job->errorText().isEmpty()) {
         KMessageBox::error(Q_NULLPTR, job->errorText());
     }
 =


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic