1 From: David Faure <faure@kde.org>
2 Date: Wed, 18 Jun 2014 18:29:04 +0000
3 Subject: Don't require a job to handle messageboxes.
4 X-Git-Url: http://quickgit.kde.org/?p=kdelibs.git&a=commitdiff&h=bbae87dc1be3ae063796a582774bd5642cacdd5d
6 Don't require a job to handle messageboxes.
8 The POP3 ioslave doesn't have a job when it gets here.
12 --- a/kio/kio/usernotificationhandler.cpp
13 +++ b/kio/kio/usernotificationhandler.cpp
15 #include "usernotificationhandler_p.h"
19 +#include "jobuidelegate.h"
25 if (m_cachedResults.contains(key)) {
26 result = *(m_cachedResults[key]);
27 - } else if (r->slave->job()) {
28 - SimpleJobPrivate* jobPrivate = SimpleJobPrivate::get(r->slave->job());
30 - result = jobPrivate->requestMessageBox(r->type,
31 - r->data.value(MSG_TEXT).toString(),
32 - r->data.value(MSG_CAPTION).toString(),
33 - r->data.value(MSG_YES_BUTTON_TEXT).toString(),
34 - r->data.value(MSG_NO_BUTTON_TEXT).toString(),
35 - r->data.value(MSG_YES_BUTTON_ICON).toString(),
36 - r->data.value(MSG_NO_BUTTON_ICON).toString(),
37 - r->data.value(MSG_DONT_ASK_AGAIN).toString(),
38 - r->data.value(MSG_META_DATA).toMap());
42 + const JobUiDelegate::MessageBoxType type = static_cast<JobUiDelegate::MessageBoxType>(r->type);
43 + result = ui.requestMessageBox(type,
44 + r->data.value(MSG_TEXT).toString(),
45 + r->data.value(MSG_CAPTION).toString(),
46 + r->data.value(MSG_YES_BUTTON_TEXT).toString(),
47 + r->data.value(MSG_NO_BUTTON_TEXT).toString(),
48 + r->data.value(MSG_YES_BUTTON_ICON).toString(),
49 + r->data.value(MSG_NO_BUTTON_ICON).toString(),
50 + r->data.value(MSG_DONT_ASK_AGAIN).toString(),
51 + r->data.value(MSG_META_DATA).toMap());
52 m_cachedResults.insert(key, new int(result));