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

Rename method as messageItem

parent d0d53896
Pipeline #34348 passed with stage
in 36 minutes and 44 seconds
......@@ -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<KMime::Message::Ptr>()
&& selectedMessages.first().id() == mMsgView->message().id()) {
&& mMsgView->messageItem().hasPayload<KMime::Message::Ptr>()
&& selectedMessages.first().id() == mMsgView->messageItem().id()) {
Akonadi::Item dummyItem;
dummyItem.setPayload<KMime::Message::Ptr>(mMsgView->message().payload<KMime::Message::Ptr>());
dummyItem.setPayload<KMime::Message::Ptr>(mMsgView->messageItem().payload<KMime::Message::Ptr>());
saveCommand = new KMSaveAttachmentsCommand(this, dummyItem, mMsgView->viewer());
} else {
saveCommand = new KMSaveAttachmentsCommand(this, selectedMessages, mMsgView->viewer());
......
......@@ -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<KMime::Message::Ptr>()) {
if (!mReaderWin->messageItem().hasPayload<KMime::Message::Ptr>()) {
return;
}
KMCommand *command = nullptr;
const Akonadi::Collection parentCol = mReaderWin->message().parentCollection();
const Akonadi::Collection parentCol = mReaderWin->messageItem().parentCollection();
if (parentCol.isValid()) {
QSharedPointer<FolderSettings> 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<KMime::Message::Ptr>()) {
if (!mReaderWin->messageItem().hasPayload<KMime::Message::Ptr>()) {
return;
}
KMCommand *command = nullptr;
const Akonadi::Collection parentCol = mReaderWin->message().parentCollection();
const Akonadi::Collection parentCol = mReaderWin->messageItem().parentCollection();
if (parentCol.isValid()) {
QSharedPointer<FolderSettings> 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<KMime::Message::Ptr>()) {
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<KMime::Message::Ptr>()) {
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<KMime::Message::Ptr>()) {
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<KMime::Message::Ptr>()) {
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()) {
......
......@@ -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>();
KMime::Message::Ptr messagePtr = messageItem().payload<KMime::Message::Ptr>();
composer->infoPart()->setFrom(messagePtr->from()->asUnicodeString());
composer->infoPart()->setTo(QStringList() << messagePtr->to()->asUnicodeString());
composer->infoPart()->setCc(QStringList() << messagePtr->cc()->asUnicodeString());
......
......@@ -143,7 +143,7 @@ public:
QAction *addToExistingContactAction() const;
Akonadi::Item message() const;
Akonadi::Item messageItem() const;
QWidget *mainWindow() const;
......
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