summaryrefslogtreecommitdiffstats
path: root/kmail/kmreaderwin.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2019-04-20 23:25:34 +0900
committerTDE Gitea <gitea@mirror.git.trinitydesktop.org>2019-05-02 11:18:05 +0000
commit70cc9c74084dac5234b64facb8c0488574b1acac (patch)
tree1ff3d6d11eb04452cdcffcd08ed525ff7be32fdb /kmail/kmreaderwin.cpp
parentc0e793908389b71c54ed0685b634609b5e1f71a3 (diff)
downloadtdepim-70cc9c74084dac5234b64facb8c0488574b1acac.tar.gz
tdepim-70cc9c74084dac5234b64facb8c0488574b1acac.zip
Improvements on previous commit and other commits published in #19. This removes the need for mIsPlainText caching and also avoid to reread the configuration every time a message is changed.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'kmail/kmreaderwin.cpp')
-rw-r--r--kmail/kmreaderwin.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/kmail/kmreaderwin.cpp b/kmail/kmreaderwin.cpp
index 1b6ca4874..76b25715d 100644
--- a/kmail/kmreaderwin.cpp
+++ b/kmail/kmreaderwin.cpp
@@ -447,6 +447,7 @@ KMReaderWin::KMReaderWin(TQWidget *aParent,
mExternalWindow = (aParent == mainWindow );
mSplitterSizes << 180 << 100;
mMimeTreeMode = 1;
+ mMimeTreeModeOverride = -1;
mMimeTreeAtBottom = true;
mAutoDelete = false;
mLastSerNum = 0;
@@ -1449,10 +1450,11 @@ int KMReaderWin::pointsToPixel(int pointSize) const
//-----------------------------------------------------------------------------
void KMReaderWin::showHideMimeTree( bool isPlainTextTopLevel ) {
- mIsPlainText = isPlainTextTopLevel;
- if ( mMimeTreeMode == 2 ||
- ( mMimeTreeMode == 1 && !isPlainTextTopLevel ) )
+ if ( mMimeTreeModeOverride == 2 ||
+ ( mMimeTreeModeOverride != 0 && (mMimeTreeMode == 2 ||
+ ( mMimeTreeMode == 1 && !isPlainTextTopLevel ) ) ) ) {
mMimePartTree->show();
+ }
else {
// don't rely on TQSplitter maintaining sizes for hidden widgets:
TDEConfigGroup reader( KMKernel::config(), "Reader" );
@@ -1468,6 +1470,7 @@ void KMReaderWin::displayMessage() {
KMMessage * msg = message();
mMimePartTree->clear();
+ mMimeTreeModeOverride = -1; // clear any previous manual overiding
showHideMimeTree( !msg || // treat no message as "text/plain"
( msg->type() == DwMime::kTypeText
&& msg->subtype() == DwMime::kSubtypePlain ) );
@@ -2147,11 +2150,11 @@ void KMReaderWin::slotToggleFixedFont()
void KMReaderWin::slotToggleMimePartTree()
{
if ( mToggleMimePartTreeAction->isChecked() ) {
- mMimeTreeMode = 2; // always
+ mMimeTreeModeOverride = 2; // always
} else {
- mMimeTreeMode = 0; // never
+ mMimeTreeModeOverride = 0; // never
}
- showHideMimeTree();
+ showHideMimeTree(false);
}
//-----------------------------------------------------------------------------