Commit 41de5e47 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Minor optimization

parent e9cd1ddd
......@@ -2670,20 +2670,20 @@ void ViewerPrivate::slotHandleAttachment(int choice)
void ViewerPrivate::replyMessageToAuthor(KMime::Content *atmNode)
{
if (atmNode) {
const bool isEncapsulatedMessage = atmNode->parent() && atmNode->parent()->bodyIsMessage();
if (isEncapsulatedMessage) {
Q_EMIT replyMessageTo(atmNode->parent()->bodyAsMessage(), false);
}
}
replyMessage(atmNode, false);
}
void ViewerPrivate::replyMessageToAll(KMime::Content *atmNode)
{
replyMessage(atmNode, true);
}
void ViewerPrivate::replyMessage(KMime::Content *atmNode, bool replyToAll)
{
if (atmNode) {
const bool isEncapsulatedMessage = atmNode->parent() && atmNode->parent()->bodyIsMessage();
if (isEncapsulatedMessage) {
Q_EMIT replyMessageTo(atmNode->parent()->bodyAsMessage(), true);
Q_EMIT replyMessageTo(atmNode->parent()->bodyAsMessage(), replyToAll);
}
}
}
......@@ -2775,7 +2775,6 @@ void ViewerPrivate::saveRelativePosition()
}
}
//TODO(Andras) inline them
bool ViewerPrivate::htmlMail() const
{
if (mDisplayFormatMessageOverwrite == Viewer::UseGlobalSetting) {
......@@ -2802,10 +2801,12 @@ bool ViewerPrivate::htmlLoadExternal() const
void ViewerPrivate::setDisplayFormatMessageOverwrite(Viewer::DisplayFormatMessage format)
{
mDisplayFormatMessageOverwrite = format;
// keep toggle display mode action state in sync.
if (mToggleDisplayModeAction) {
mToggleDisplayModeAction->setChecked(htmlMail());
if (mDisplayFormatMessageOverwrite != format) {
mDisplayFormatMessageOverwrite = format;
// keep toggle display mode action state in sync.
if (mToggleDisplayModeAction) {
mToggleDisplayModeAction->setChecked(htmlMail());
}
}
}
......@@ -2890,9 +2891,11 @@ void ViewerPrivate::scrollToAttachment(KMime::Content *node)
void ViewerPrivate::setUseFixedFont(bool useFixedFont)
{
mUseFixedFont = useFixedFont;
if (mToggleFixFontAction) {
mToggleFixFontAction->setChecked(mUseFixedFont);
if (mUseFixedFont != useFixedFont) {
mUseFixedFont = useFixedFont;
if (mToggleFixFontAction) {
mToggleFixFontAction->setChecked(mUseFixedFont);
}
}
}
......
......@@ -596,6 +596,7 @@ private:
void replyMessageToAuthor(KMime::Content *atmNode);
void replyMessageToAll(KMime::Content *atmNode);
void replyMessage(KMime::Content *atmNode, bool replyToAll);
Q_REQUIRED_RESULT bool urlIsAMalwareButContinue();
Q_REQUIRED_RESULT bool messageIsInSpecialFolder() 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