diff --git a/src/kmmainwidget.cpp b/src/kmmainwidget.cpp index 014f6245b..72811204a 100644 --- a/src/kmmainwidget.cpp +++ b/src/kmmainwidget.cpp @@ -2325,10 +2325,10 @@ void KMMainWidget::slotSaveAttachments() // so that KMCommand doesn't download it. KMSaveAttachmentsCommand *saveCommand = nullptr; if (mMsgView && selectedMessages.size() == 1 - && mMsgView->message().hasPayload() - && selectedMessages.first().id() == mMsgView->message().id()) { + && mMsgView->messageItem().hasPayload() + && selectedMessages.first().id() == mMsgView->messageItem().id()) { Akonadi::Item dummyItem; - dummyItem.setPayload(mMsgView->message().payload()); + dummyItem.setPayload(mMsgView->messageItem().payload()); saveCommand = new KMSaveAttachmentsCommand(this, dummyItem, mMsgView->viewer()); } else { saveCommand = new KMSaveAttachmentsCommand(this, selectedMessages, mMsgView->viewer()); diff --git a/src/kmreadermainwin.cpp b/src/kmreadermainwin.cpp index b1bda77cc..f473b607a 100644 --- a/src/kmreadermainwin.cpp +++ b/src/kmreadermainwin.cpp @@ -99,7 +99,7 @@ void KMReaderMainWin::initKMReaderMainWin() statusBar()->addPermanentWidget(mZoomLabelIndicator); setZoomChanged(mReaderWin->viewer()->webViewZoomFactor()); statusBar()->addPermanentWidget(mReaderWin->viewer()->dkimWidgetInfo()); - if (!mReaderWin->message().isValid()) { + if (!mReaderWin->messageItem().isValid()) { menuBar()->hide(); toolBar(QStringLiteral("mainToolBar"))->hide(); } else { @@ -316,21 +316,21 @@ void KMReaderMainWin::slotTrashMessage() void KMReaderMainWin::slotForwardInlineMsg() { - if (!mReaderWin->message().hasPayload()) { + if (!mReaderWin->messageItem().hasPayload()) { return; } KMCommand *command = nullptr; - const Akonadi::Collection parentCol = mReaderWin->message().parentCollection(); + const Akonadi::Collection parentCol = mReaderWin->messageItem().parentCollection(); if (parentCol.isValid()) { QSharedPointer fd = FolderSettings::forCollection(parentCol, false); if (fd) { - command = new KMForwardCommand(this, mReaderWin->message(), + command = new KMForwardCommand(this, mReaderWin->messageItem(), fd->identity(), QString(), mReaderWin->copyText()); } else { - command = new KMForwardCommand(this, mReaderWin->message(), 0, QString(), mReaderWin->copyText()); + command = new KMForwardCommand(this, mReaderWin->messageItem(), 0, QString(), mReaderWin->copyText()); } } else { - command = new KMForwardCommand(this, mReaderWin->message(), 0, QString(), mReaderWin->copyText()); + command = new KMForwardCommand(this, mReaderWin->messageItem(), 0, QString(), mReaderWin->copyText()); } connect(command, &KMTrashMsgCommand::completed, this, &KMReaderMainWin::slotReplyOrForwardFinished); command->start(); @@ -338,21 +338,21 @@ void KMReaderMainWin::slotForwardInlineMsg() void KMReaderMainWin::slotForwardAttachedMessage() { - if (!mReaderWin->message().hasPayload()) { + if (!mReaderWin->messageItem().hasPayload()) { return; } KMCommand *command = nullptr; - const Akonadi::Collection parentCol = mReaderWin->message().parentCollection(); + const Akonadi::Collection parentCol = mReaderWin->messageItem().parentCollection(); if (parentCol.isValid()) { QSharedPointer fd = FolderSettings::forCollection(parentCol, false); if (fd) { - command = new KMForwardAttachedCommand(this, mReaderWin->message(), + command = new KMForwardAttachedCommand(this, mReaderWin->messageItem(), fd->identity()); } else { - command = new KMForwardAttachedCommand(this, mReaderWin->message()); + command = new KMForwardAttachedCommand(this, mReaderWin->messageItem()); } } else { - command = new KMForwardAttachedCommand(this, mReaderWin->message()); + command = new KMForwardAttachedCommand(this, mReaderWin->messageItem()); } connect(command, &KMTrashMsgCommand::completed, this, &KMReaderMainWin::slotReplyOrForwardFinished); @@ -361,7 +361,7 @@ void KMReaderMainWin::slotForwardAttachedMessage() void KMReaderMainWin::slotRedirectMessage() { - const Akonadi::Item currentItem = mReaderWin->message(); + const Akonadi::Item currentItem = mReaderWin->messageItem(); if (!currentItem.hasPayload()) { return; } @@ -372,7 +372,7 @@ void KMReaderMainWin::slotRedirectMessage() void KMReaderMainWin::slotCustomReplyToMsg(const QString &tmpl) { - const Akonadi::Item currentItem = mReaderWin->message(); + const Akonadi::Item currentItem = mReaderWin->messageItem(); if (!currentItem.hasPayload()) { return; } @@ -388,7 +388,7 @@ void KMReaderMainWin::slotCustomReplyToMsg(const QString &tmpl) void KMReaderMainWin::slotCustomReplyAllToMsg(const QString &tmpl) { - const Akonadi::Item currentItem = mReaderWin->message(); + const Akonadi::Item currentItem = mReaderWin->messageItem(); if (!currentItem.hasPayload()) { return; } @@ -405,7 +405,7 @@ void KMReaderMainWin::slotCustomReplyAllToMsg(const QString &tmpl) void KMReaderMainWin::slotCustomForwardMsg(const QString &tmpl) { - const Akonadi::Item currentItem = mReaderWin->message(); + const Akonadi::Item currentItem = mReaderWin->messageItem(); if (!currentItem.hasPayload()) { return; } @@ -477,8 +477,8 @@ void KMReaderMainWin::setupAccel() this, &KMReaderMainWin::slotSelectMoreMessageTagList); mTagActionManager->createActions(); - if (mReaderWin->message().isValid()) { - mTagActionManager->updateActionStates(1, mReaderWin->message()); + if (mReaderWin->messageItem().isValid()) { + mTagActionManager->updateActionStates(1, mReaderWin->messageItem()); } mHideMenuBarAction = KStandardAction::showMenubar(this, &KMReaderMainWin::slotToggleMenubar, actionCollection()); mHideMenuBarAction->setChecked(KMailSettings::self()->readerShowMenuBar()); @@ -495,7 +495,7 @@ void KMReaderMainWin::setupAccel() void KMReaderMainWin::slotToggleMenubar(bool dontShowWarning) { - if (!mReaderWin->message().isValid()) { + if (!mReaderWin->messageItem().isValid()) { return; } if (menuBar()) { diff --git a/src/kmreaderwin.cpp b/src/kmreaderwin.cpp index 87a5a48a6..3e73cf333 100644 --- a/src/kmreaderwin.cpp +++ b/src/kmreaderwin.cpp @@ -411,7 +411,7 @@ bool KMReaderWin::htmlLoadExternal() return mViewer->htmlLoadExternal(); } -Akonadi::Item KMReaderWin::message() const +Akonadi::Item KMReaderWin::messageItem() const { return mViewer->messageItem(); } @@ -423,14 +423,14 @@ QWidget *KMReaderWin::mainWindow() const void KMReaderWin::slotMailtoCompose() { - KMCommand *command = new KMMailtoComposeCommand(urlClicked(), message()); + KMCommand *command = new KMMailtoComposeCommand(urlClicked(), messageItem()); command->start(); } void KMReaderWin::slotMailtoForward() { KMCommand *command = new KMMailtoForwardCommand(mMainWindow, urlClicked(), - message()); + messageItem()); command->start(); } @@ -513,7 +513,7 @@ void KMReaderWin::slotSaveImageOnDisk() void KMReaderWin::slotMailtoReply() { KMMailtoReplyCommand *command = new KMMailtoReplyCommand(mMainWindow, urlClicked(), - message(), copyText()); + messageItem(), copyText()); command->setReplyAsHtml(htmlMail()); command->start(); } @@ -743,7 +743,7 @@ bool KMReaderWin::printSelectedText(bool preview) ::MessageComposer::Composer *composer = new ::MessageComposer::Composer; composer->textPart()->setCleanPlainText(str); composer->textPart()->setWrappedPlainText(str); - KMime::Message::Ptr messagePtr = message().payload(); + KMime::Message::Ptr messagePtr = messageItem().payload(); composer->infoPart()->setFrom(messagePtr->from()->asUnicodeString()); composer->infoPart()->setTo(QStringList() << messagePtr->to()->asUnicodeString()); composer->infoPart()->setCc(QStringList() << messagePtr->cc()->asUnicodeString()); diff --git a/src/kmreaderwin.h b/src/kmreaderwin.h index 61139832f..e515874cc 100644 --- a/src/kmreaderwin.h +++ b/src/kmreaderwin.h @@ -143,7 +143,7 @@ public: QAction *addToExistingContactAction() const; - Akonadi::Item message() const; + Akonadi::Item messageItem() const; QWidget *mainWindow() const;