summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Montel <[email protected]>2018-02-13 13:51:53 +0100
committerLaurent Montel <[email protected]>2018-02-13 13:51:53 +0100
commitfbfa271f6d2d6f9af1f8b55ab4c156ca65ed3b3d (patch)
tree0c41a6222232c3f2ab423ef27c538df3baf45a9d
parent25449978e1b0482aba290fa27ce590f6b6765875 (diff)
Patch from aleksejshilin
Previously, current message selection was saved only when switching collections. As the result, selection changes were not always saved, breaking the PreSelectLastSelected mode (which is the default one in e.g. KMail). This commit fixes the issue by saving current selection at tab close and at Pane destruction (i.e. application exit). Differential Revision: https://phabricator.kde.org/D10478
-rw-r--r--messagelist/src/pane.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/messagelist/src/pane.cpp b/messagelist/src/pane.cpp
index 0204349..70d519c 100644
--- a/messagelist/src/pane.cpp
+++ b/messagelist/src/pane.cpp
@@ -188,6 +188,7 @@ Pane::Pane(bool restoreSession, QAbstractItemModel *model, QItemSelectionModel *
Pane::~Pane()
{
+ saveCurrentSelection();
writeConfig(true);
delete d;
}
@@ -606,6 +607,11 @@ void Pane::Private::closeTab(QWidget *w)
return;
}
+ Widget *wWidget = qobject_cast<Widget *>(w);
+ if (wWidget) {
+ wWidget->saveCurrentSelection();
+ }
+
delete w;
updateTabControls();
}
@@ -692,6 +698,7 @@ void Pane::Private::onTabContextMenuRequest(const QPoint &pos)
}
foreach (Widget *other, widgets) {
+ other->saveCurrentSelection();
delete other;
}