mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kio: user notification optimization
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
70d01331b7
commit
6f0e672758
3 changed files with 12 additions and 12 deletions
|
@ -579,7 +579,7 @@ void SlaveInterface::messageBox(int type, const QString &text, const QString &ca
|
|||
d->connection->suspend();
|
||||
}
|
||||
|
||||
QHash<UserNotificationHandler::MessageBoxDataType, QVariant> data;
|
||||
QHash<UserNotificationHandler::MessageBoxDataType, QString> data;
|
||||
data.insert(UserNotificationHandler::MSG_TEXT, text);
|
||||
data.insert(UserNotificationHandler::MSG_CAPTION, caption);
|
||||
data.insert(UserNotificationHandler::MSG_YES_BUTTON_TEXT, buttonYes);
|
||||
|
|
|
@ -50,7 +50,7 @@ UserNotificationHandler::~UserNotificationHandler()
|
|||
qDeleteAll(m_pendingRequests);
|
||||
}
|
||||
|
||||
void UserNotificationHandler::requestMessageBox(SlaveInterface* iface, int type, const QHash<MessageBoxDataType, QVariant>& data)
|
||||
void UserNotificationHandler::requestMessageBox(SlaveInterface* iface, int type, const QHash<MessageBoxDataType, QString>& data)
|
||||
{
|
||||
Request* r = new Request;
|
||||
r->type = type;
|
||||
|
@ -80,13 +80,13 @@ void UserNotificationHandler::processRequest()
|
|||
JobUiDelegate ui;
|
||||
const JobUiDelegate::MessageBoxType type = static_cast<JobUiDelegate::MessageBoxType>(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 {
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include <QHash>
|
||||
#include <QCache>
|
||||
#include <QPointer>
|
||||
#include <QVariant>
|
||||
#include <QString>
|
||||
|
||||
|
||||
namespace KIO {
|
||||
|
@ -52,13 +52,13 @@ public:
|
|||
|
||||
int type;
|
||||
QPointer<SlaveInterface> slave;
|
||||
QHash<MessageBoxDataType, QVariant> data;
|
||||
QHash<MessageBoxDataType, QString> data;
|
||||
};
|
||||
|
||||
UserNotificationHandler(QObject* parent = 0);
|
||||
virtual ~UserNotificationHandler();
|
||||
|
||||
void requestMessageBox(SlaveInterface* iface, int type, const QHash<MessageBoxDataType, QVariant>& data);
|
||||
void requestMessageBox(SlaveInterface* iface, int type, const QHash<MessageBoxDataType, QString>& data);
|
||||
|
||||
private Q_SLOTS:
|
||||
void processRequest();
|
||||
|
|
Loading…
Add table
Reference in a new issue