Distinguish between settings and explicit override for external content

Summary:
This will allow KMail to properly communicate the difference also when
using per-folder settings for loading external references. This in turn
makes 746e02af07 also work in that case.

Taken from KDE patches and adapted to TDE.
See https://phabricator.kde.org/D12393 and https://phabricator.kde.org/D12394

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit c8e1b254e2)
r14.0.x
Slávek Banko 2 years ago
parent b1ef270c61
commit 2128c14fb2
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -1386,7 +1386,7 @@ void KMMainWidget::slotOverrideHtmlLoadExt()
}
mFolderHtmlLoadExtPref = !mFolderHtmlLoadExtPref;
if (mMsgView) {
mMsgView->setHtmlLoadExtOverride(mFolderHtmlLoadExtPref);
mMsgView->setHtmlLoadExtDefault(mFolderHtmlLoadExtPref);
mMsgView->update( true );
}
}
@ -2084,7 +2084,7 @@ void KMMainWidget::folderSelected( KMFolder* aFolder, bool forceJumpToUnread )
if (mMsgView)
{
mMsgView->setHtmlOverride(mFolderHtmlPref);
mMsgView->setHtmlLoadExtOverride(mFolderHtmlLoadExtPref);
mMsgView->setHtmlLoadExtDefault(mFolderHtmlLoadExtPref);
}
mHeaders->setFolder( mFolder, forceJumpToUnread );
updateMessageActions();
@ -2140,7 +2140,8 @@ void KMMainWidget::slotMsgSelected(KMMessage *msg)
}
// reset HTML override to the folder setting
mMsgView->setHtmlOverride(mFolderHtmlPref);
mMsgView->setHtmlLoadExtOverride(mFolderHtmlLoadExtPref);
mMsgView->setHtmlLoadExtDefault(mFolderHtmlLoadExtPref);
mMsgView->setHtmlLoadExtOverride(false);
mMsgView->setDecryptMessageOverwrite( false );
mMsgView->setShowSignatureDetails( false );
}

@ -50,7 +50,7 @@
#include "kmreadermainwin.h"
KMReaderMainWin::KMReaderMainWin( bool htmlOverride, bool htmlLoadExtOverride,
KMReaderMainWin::KMReaderMainWin( bool htmlOverride, bool htmlLoadExtDefault,
char *name )
: KMail::SecondaryWindow( name ? name : "readerwindow#" ),
mMsg( 0 )
@ -59,7 +59,7 @@ KMReaderMainWin::KMReaderMainWin( bool htmlOverride, bool htmlLoadExtOverride,
//mReaderWin->setShowCompleteMessage( true );
mReaderWin->setAutoDelete( true );
mReaderWin->setHtmlOverride( htmlOverride );
mReaderWin->setHtmlLoadExtOverride( htmlLoadExtOverride );
mReaderWin->setHtmlLoadExtDefault( htmlLoadExtDefault );
mReaderWin->setDecryptMessageOverwrite( true );
mReaderWin->setShowSignatureDetails( false );
initKMReaderMainWin();

@ -26,7 +26,7 @@ class KMReaderMainWin : public KMail::SecondaryWindow
public:
KMReaderMainWin( bool htmlOverride, bool htmlLoadExtOverride, char *name = 0 );
KMReaderMainWin( bool htmlOverride, bool htmlLoadExtDefault, char *name = 0 );
KMReaderMainWin( char *name = 0 );
KMReaderMainWin(KMMessagePart* aMsgPart,
bool aHTML, const TQString& aFileName, const TQString& pname,

@ -462,6 +462,7 @@ KMReaderWin::KMReaderWin(TQWidget *aParent,
readConfig();
mHtmlOverride = false;
mHtmlLoadExtDefault = false;
mHtmlLoadExtOverride = false;
mLevelQuote = GlobalSettings::self()->collapseQuoteLevelSpin() - 1;
@ -895,7 +896,6 @@ void KMReaderWin::readConfig(void)
mToggleFixFontAction->setChecked( mUseFixedFont );
mHtmlMail = reader.readBoolEntry( "htmlMail", false );
mHtmlLoadExternal = reader.readBoolEntry( "htmlLoadExternal", false );
setHeaderStyleAndStrategy( HeaderStyle::create( reader.readEntry( "header-style", "fancy" ) ),
HeaderStrategy::create( reader.readEntry( "header-set-displayed", "rich" ) ) );
@ -2471,11 +2471,14 @@ void KMReaderWin::setHtmlOverride(bool override)
//-----------------------------------------------------------------------------
void KMReaderWin::setHtmlLoadExtOverride(bool override)
void KMReaderWin::setHtmlLoadExtDefault(bool loadExtDefault)
{
mHtmlLoadExtOverride = override;
//if (message())
// message()->setDecodeHTML(htmlMail());
mHtmlLoadExtDefault = loadExtDefault;
}
void KMReaderWin::setHtmlLoadExtOverride(bool loadExtOverride)
{
mHtmlLoadExtOverride = loadExtOverride;
}
@ -2500,8 +2503,8 @@ bool KMReaderWin::htmlLoadExternal()
return mHtmlLoadExtOverride;
}
return ((mHtmlLoadExternal && !mHtmlLoadExtOverride) ||
(!mHtmlLoadExternal && mHtmlLoadExtOverride));
return ((mHtmlLoadExtDefault && !mHtmlLoadExtOverride) ||
(!mHtmlLoadExtDefault && mHtmlLoadExtOverride));
}

@ -199,9 +199,22 @@ public:
bool htmlOverride() const { return mHtmlOverride; }
void setHtmlOverride( bool override );
/** Override default load external references setting */
/** Get the load external references override setting */
bool htmlLoadExtOverride() const { return mHtmlLoadExtOverride; }
void setHtmlLoadExtOverride( bool override );
/** Default behavior for loading external references.
* Use this for specifying the external reference loading behavior as
* specified in the user settings.
* @see setHtmlLoadExtOverride
*/
void setHtmlLoadExtDefault(bool loadExtDefault);
/** Override default load external references setting
* @warning This must only be called when the user has explicitly
* been asked to retrieve external references!
* @see setHtmlLoadExtDefault
*/
void setHtmlLoadExtOverride(bool loadExtOverride);
/** Is html mail to be supported? Takes into account override */
bool htmlMail();
@ -540,7 +553,7 @@ private:
TQString renderAttachments( partNode *node, const TQColor &bgColor );
private:
bool mHtmlMail, mHtmlLoadExternal, mHtmlOverride, mHtmlLoadExtOverride;
bool mHtmlMail, mHtmlLoadExtDefault, mHtmlOverride, mHtmlLoadExtOverride;
int mAtmCurrent;
TQString mAtmCurrentName;
KMMessage *mMessage;

Loading…
Cancel
Save