diff --git a/kmreadermainwin.cpp b/kmreadermainwin.cpp index 51c861efe..8366c5730 100644 --- a/kmreadermainwin.cpp +++ b/kmreadermainwin.cpp @@ -553,9 +553,10 @@ void KMReaderMainWin::showMessagePopup(const Akonadi::Item &msg , const KUrl &ur } } - menu->addAction(mReaderWin->viewSourceAction()); - menu->addAction(mReaderWin->toggleFixFontAction()); - menu->addAction(mReaderWin->toggleMimePartTreeAction()); + menu->addAction( mReaderWin->viewSourceAction() ); + menu->addAction( mReaderWin->toggleFixFontAction() ); + if (!mReaderWin->mimePartTreeIsEmpty()) + menu->addAction( mReaderWin->toggleMimePartTreeAction() ); menu->addSeparator(); if (mMsgActions->printPreviewAction()) { menu->addAction(mMsgActions->printPreviewAction()); @@ -572,14 +573,16 @@ void KMReaderMainWin::showMessagePopup(const Akonadi::Item &msg , const KUrl &ur menu->addAction(mReaderWin->resetMessageDisplayFormatAction()); } } else { - menu->addAction(mReaderWin->toggleFixFontAction()); - menu->addAction(mReaderWin->toggleMimePartTreeAction()); + menu->addAction( mReaderWin->toggleFixFontAction() ); + if (!mReaderWin->mimePartTreeIsEmpty()) + menu->addAction( mReaderWin->toggleMimePartTreeAction() ); } if (mReaderWin->adblockEnabled()) { menu->addSeparator(); menu->addAction(mReaderWin->openBlockableItems()); } - menu->addAction(mMsgActions->addFollowupReminderAction()); + if (msg.isValid()) + menu->addAction( mMsgActions->addFollowupReminderAction() ); if (kmkernel->allowToDebugBalooSupport()) { menu->addSeparator(); menu->addAction(mMsgActions->debugBalooAction()); diff --git a/kmreaderwin.cpp b/kmreaderwin.cpp index 7e168cb26..7b3b1d9ad 100644 --- a/kmreaderwin.cpp +++ b/kmreaderwin.cpp @@ -581,6 +581,11 @@ KToggleAction *KMReaderWin::toggleFixFontAction() const return mViewer->toggleFixFontAction(); } +bool KMReaderWin::mimePartTreeIsEmpty() const +{ + return mViewer->mimePartTreeIsEmpty(); +} + QAction *KMReaderWin::toggleMimePartTreeAction() const { return mViewer->toggleMimePartTreeAction(); diff --git a/kmreaderwin.h b/kmreaderwin.h index 14220b662..eab1e7a84 100644 --- a/kmreaderwin.h +++ b/kmreaderwin.h @@ -221,6 +221,7 @@ public: bool adblockEnabled() const; bool isAShortUrl(const QUrl &url) const; + bool mimePartTreeIsEmpty() const; Q_SIGNALS: /** Emitted after parsing of a message to have it stored in unencrypted state in it's folder. */