From 6f0e672758b575d86454abb059166f31c81ddec0 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Fri, 22 Mar 2024 12:55:38 +0200 Subject: [PATCH] kio: user notification optimization Signed-off-by: Ivailo Monev --- kio/kio/slaveinterface.cpp | 2 +- kio/kio/usernotificationhandler.cpp | 16 ++++++++-------- kio/kio/usernotificationhandler_p.h | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/kio/kio/slaveinterface.cpp b/kio/kio/slaveinterface.cpp index cfdbfe71..e46aef9d 100644 --- a/kio/kio/slaveinterface.cpp +++ b/kio/kio/slaveinterface.cpp @@ -579,7 +579,7 @@ void SlaveInterface::messageBox(int type, const QString &text, const QString &ca d->connection->suspend(); } - QHash data; + QHash data; data.insert(UserNotificationHandler::MSG_TEXT, text); data.insert(UserNotificationHandler::MSG_CAPTION, caption); data.insert(UserNotificationHandler::MSG_YES_BUTTON_TEXT, buttonYes); diff --git a/kio/kio/usernotificationhandler.cpp b/kio/kio/usernotificationhandler.cpp index aeb6e25b..cf0dee78 100644 --- a/kio/kio/usernotificationhandler.cpp +++ b/kio/kio/usernotificationhandler.cpp @@ -50,7 +50,7 @@ UserNotificationHandler::~UserNotificationHandler() qDeleteAll(m_pendingRequests); } -void UserNotificationHandler::requestMessageBox(SlaveInterface* iface, int type, const QHash& data) +void UserNotificationHandler::requestMessageBox(SlaveInterface* iface, int type, const QHash& data) { Request* r = new Request; r->type = type; @@ -80,13 +80,13 @@ void UserNotificationHandler::processRequest() JobUiDelegate ui; const JobUiDelegate::MessageBoxType type = static_cast(r->type); result = ui.requestMessageBox(type, - r->data.value(MSG_TEXT).toString(), - r->data.value(MSG_CAPTION).toString(), - r->data.value(MSG_YES_BUTTON_TEXT).toString(), - r->data.value(MSG_NO_BUTTON_TEXT).toString(), - r->data.value(MSG_YES_BUTTON_ICON).toString(), - r->data.value(MSG_NO_BUTTON_ICON).toString(), - r->data.value(MSG_DONT_ASK_AGAIN).toString()); + r->data.value(MSG_TEXT), + r->data.value(MSG_CAPTION), + r->data.value(MSG_YES_BUTTON_TEXT), + r->data.value(MSG_NO_BUTTON_TEXT), + r->data.value(MSG_YES_BUTTON_ICON), + r->data.value(MSG_NO_BUTTON_ICON), + r->data.value(MSG_DONT_ASK_AGAIN)); m_cachedResults.insert(key, new int(result)); } } else { diff --git a/kio/kio/usernotificationhandler_p.h b/kio/kio/usernotificationhandler_p.h index 3828401c..4c1f373f 100644 --- a/kio/kio/usernotificationhandler_p.h +++ b/kio/kio/usernotificationhandler_p.h @@ -23,7 +23,7 @@ #include #include #include -#include +#include namespace KIO { @@ -52,13 +52,13 @@ public: int type; QPointer slave; - QHash data; + QHash data; }; UserNotificationHandler(QObject* parent = 0); virtual ~UserNotificationHandler(); - void requestMessageBox(SlaveInterface* iface, int type, const QHash& data); + void requestMessageBox(SlaveInterface* iface, int type, const QHash& data); private Q_SLOTS: void processRequest();