summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-08-01 07:51:56 +0200
committerMontel Laurent <[email protected]>2017-08-01 07:51:56 +0200
commite1eb8256df8f4545399df6723944386913b2e826 (patch)
tree9f46094eae5ca83d7232e05f7cd31fa933d2dcf4
parent8ae0240044e672389c9f9722b7f56c6ae6008e05 (diff)
Make it compile with new api
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/kmcommands.cpp5
-rw-r--r--src/kmcommands.h3
-rw-r--r--src/kmmainwidget.cpp14
4 files changed, 14 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ff11183..47025b7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -65,7 +65,7 @@ find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED DBus Network Test Widget
set(LIBGRAVATAR_VERSION_LIB "5.6.40")
set(MAILCOMMON_LIB_VERSION_LIB "5.6.40")
set(KDEPIM_APPS_LIB_VERSION_LIB "5.6.40")
-set(MESSAGELIB_LIB_VERSION_LIB "5.6.40")
+set(MESSAGELIB_LIB_VERSION_LIB "5.6.41")
set(LIBKLEO_LIB_VERSION_LIB "5.6.40")
set(PIMCOMMON_LIB_VERSION_LIB "5.6.40")
set(LIBKDEPIM_LIB_VERSION_LIB "5.6.40")
diff --git a/src/kmcommands.cpp b/src/kmcommands.cpp
index 880c1cc..ffc5e93 100644
--- a/src/kmcommands.cpp
+++ b/src/kmcommands.cpp
@@ -1640,8 +1640,9 @@ KMCommand::Result KMShareImageCommand::execute()
return OK;
}
-KMFetchMessageCommand::KMFetchMessageCommand(QWidget *parent, const Akonadi::Item &item)
+KMFetchMessageCommand::KMFetchMessageCommand(QWidget *parent, const Akonadi::Item &item, MessageViewer::Viewer *viewer)
: KMCommand(parent, item)
+ , mViewer(viewer)
{
// Workaround KMCommand::transferSelectedMsgs() expecting non-empty fetchscope
fetchScope().fetchFullPayload(true);
@@ -1650,7 +1651,7 @@ KMFetchMessageCommand::KMFetchMessageCommand(QWidget *parent, const Akonadi::Ite
Akonadi::ItemFetchJob *KMFetchMessageCommand::createFetchJob(const Akonadi::Item::List &items)
{
Q_ASSERT(items.size() == 1);
- Akonadi::ItemFetchJob *fetch = MessageViewer::Viewer::createFetchJob(items.first());
+ Akonadi::ItemFetchJob *fetch = mViewer->createFetchJob(items.first());
fetchScope() = fetch->fetchScope();
return fetch;
}
diff --git a/src/kmcommands.h b/src/kmcommands.h
index 6ade8f8..9c6bf8b 100644
--- a/src/kmcommands.h
+++ b/src/kmcommands.h
@@ -578,7 +578,7 @@ class KMFetchMessageCommand : public KMCommand
{
Q_OBJECT
public:
- explicit KMFetchMessageCommand(QWidget *parent, const Akonadi::Item &item);
+ explicit KMFetchMessageCommand(QWidget *parent, const Akonadi::Item &item, MessageViewer::Viewer *viewer);
Akonadi::Item item() const;
@@ -587,6 +587,7 @@ private:
Result execute() override;
Akonadi::Item mItem;
+ MessageViewer::Viewer *mViewer;
};
#endif /*KMCommands_h*/
diff --git a/src/kmmainwidget.cpp b/src/kmmainwidget.cpp
index 939ac7f..d06a7e1 100644
--- a/src/kmmainwidget.cpp
+++ b/src/kmmainwidget.cpp
@@ -2582,11 +2582,13 @@ void KMMainWidget::slotMessageActivated(const Akonadi::Item &msg)
return;
}
- // Try to fetch the mail, even in offline mode, it might be cached
- KMFetchMessageCommand *cmd = new KMFetchMessageCommand(this, msg);
- connect(cmd, &KMCommand::completed,
- this, &KMMainWidget::slotItemsFetchedForActivation);
- cmd->start();
+ if (mMsgView) {
+ // Try to fetch the mail, even in offline mode, it might be cached
+ KMFetchMessageCommand *cmd = new KMFetchMessageCommand(this, msg, mMsgView->viewer());
+ connect(cmd, &KMCommand::completed,
+ this, &KMMainWidget::slotItemsFetchedForActivation);
+ cmd->start();
+ }
}
void KMMainWidget::slotItemsFetchedForActivation(KMCommand *command)
@@ -4333,7 +4335,7 @@ void KMMainWidget::slotMessageSelected(const Akonadi::Item &item)
connect(mShowBusySplashTimer, &QTimer::timeout, this, &KMMainWidget::slotShowBusySplash);
mShowBusySplashTimer->start(1000);
- Akonadi::ItemFetchJob *itemFetchJob = MessageViewer::Viewer::createFetchJob(item);
+ Akonadi::ItemFetchJob *itemFetchJob = mMsgView->viewer()->createFetchJob(item);
if (mCurrentCollection.isValid()) {
const QString resource = mCurrentCollection.resource();
itemFetchJob->setProperty("_resource", QVariant::fromValue(resource));