Commit e1eb8256 authored by Laurent Montel's avatar Laurent Montel 😁

Make it compile with new api

parent 8ae02400
......@@ -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")
......
......@@ -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;
}
......
......@@ -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*/
......@@ -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));
......
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