summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllen Winter <[email protected]>2017-07-27 08:47:44 -0400
committerAllen Winter <[email protected]>2017-07-27 08:47:44 -0400
commit250536cb497b1ae15be5ce6dc67450cbd3b8a691 (patch)
tree6f1a970b52fd10aa297df1ffb7e5758d5338f1a5
parentfa6319fdac441215114afda00b540ad93b760b52 (diff)
src/views/collectionview/quickview.cpp - Save/Restore Splitter Size
Differential Revision: https://phabricator.kde.org/D6939
-rw-r--r--src/views/collectionview/quickview.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/views/collectionview/quickview.cpp b/src/views/collectionview/quickview.cpp
index 803fc87..56ae68a 100644
--- a/src/views/collectionview/quickview.cpp
+++ b/src/views/collectionview/quickview.cpp
@@ -44,6 +44,7 @@
#include <QDialogButtonBox>
#include <QPushButton>
+#include <QSplitter>
#include <QVBoxLayout>
class FreebusyViewCalendar : public EventViews::ViewCalendar
@@ -203,15 +204,28 @@ void Quickview::onTodayClicked()
void Quickview::readConfig()
{
KConfigGroup group = KSharedConfig::openConfig()->group(QStringLiteral("Quickview"));
+
const QSize size = group.readEntry("Size", QSize(775, 600));
if (size.isValid()) {
resize(size);
}
+
+ const QList<int> sizes = group.readEntry("Separator", QList<int>());
+
+ // don't allow invalid/corrupted settings or else agenda becomes invisible
+ if (sizes.count() >= 2 && !sizes.contains(0)) {
+ mAgendaView->splitter()->setSizes(sizes);
+ }
}
void Quickview::writeConfig()
{
KConfigGroup group = KSharedConfig::openConfig()->group(QStringLiteral("Quickview"));
+
group.writeEntry("Size", size());
+
+ QList<int> list = mAgendaView->splitter()->sizes();
+ group.writeEntry("Separator", list);
+
group.sync();
}