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