Commit 410e7b31 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use unique method for assigning Item

parent 99f09431
......@@ -1240,6 +1240,11 @@ void ViewerPrivate::setMessageInternal(const KMime::Message::Ptr &message, MimeT
update(updateMode);
}
void ViewerPrivate::assignMessageItem(const Akonadi::Item &item)
{
mMessageItem = item;
}
void ViewerPrivate::setMessageItem(const Akonadi::Item &item, MimeTreeParser::UpdateMode updateMode)
{
resetStateForNewMessage();
......@@ -1248,7 +1253,7 @@ void ViewerPrivate::setMessageItem(const Akonadi::Item &item, MimeTreeParser::Up
}
Q_ASSERT(mMonitor.itemsMonitoredEx().isEmpty());
mMessageItem = item;
assignMessageItem(item);
if (mMessageItem.isValid()) {
mMonitor.setItemMonitored(mMessageItem, true);
}
......@@ -1293,7 +1298,7 @@ void ViewerPrivate::setMessage(const KMime::Message::Ptr &aMsg, MimeTreeParser::
Akonadi::Item item;
item.setMimeType(KMime::Message::mimeType());
item.setPayload(aMsg);
mMessageItem = item;
assignMessageItem(item);
setMessageInternal(aMsg, updateMode);
}
......
......@@ -592,6 +592,7 @@ private:
bool mHtmlMailGlobalSetting = false;
bool mHtmlLoadExternalDefaultSetting = false;
bool mHtmlLoadExtOverride = false;
void assignMessageItem(const Akonadi::Item &item);
public:
KMime::Message::Ptr mMessage; //the current message, if it was set manually
Akonadi::Item mMessageItem; //the message item from Akonadi
......
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