Commit 5a8bdaa7 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Improve action support

parent 37461b6a
......@@ -88,19 +88,24 @@ public:
KMailActionURLHandler() : URLHandler() {}
~KMailActionURLHandler() {}
bool handleClick(const QUrl &url, ViewerPrivate *) const Q_DECL_OVERRIDE
bool handleClick(const QUrl &url, ViewerPrivate *viewer) const Q_DECL_OVERRIDE
{
if (url.scheme() == QLatin1String("kmailaction")) {
const QString urlPath(url.path());
if (urlPath == QStringLiteral("trash")) {
viewer->setMailAction(ViewerPrivate::Trash);
return true;
} else if (urlPath == QStringLiteral("reply")) {
viewer->setMailAction(ViewerPrivate::Reply);
return true;
} else if (urlPath == QStringLiteral("replyToAll")) {
viewer->setMailAction(ViewerPrivate::ReplyToAll);
return true;
} else if (urlPath == QStringLiteral("forward")) {
viewer->setMailAction(ViewerPrivate::Forward);
return true;
} else if (urlPath == QStringLiteral("newMessage")) {
viewer->setMailAction(ViewerPrivate::NewMessage);
return true;
}
}
......
......@@ -2929,6 +2929,11 @@ void ViewerPrivate::saveMainFrameScreenshotInFile(const QString &filename)
mViewer->saveMainFrameScreenshotInFile(filename);
}
void ViewerPrivate::setMailAction(ViewerPrivate::MailAction type)
{
//TODO
}
void ViewerPrivate::slotAddToWhiteList()
{
if (mMessageItem.isValid()) {
......
......@@ -184,6 +184,13 @@ class ViewerPrivate : public QObject
{
Q_OBJECT
public:
enum MailAction {
Trash = 0,
Reply,
ReplyToAll,
Forward,
NewMessage
};
ViewerPrivate(Viewer *aParent, QWidget *mainWindow, KActionCollection *actionCollection);
......@@ -277,6 +284,8 @@ public:
void saveMainFrameScreenshotInFile(const QString &filename);
void setMailAction(MailAction type);
private:
/** HTML initialization. */
void initHtmlWidget();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment