summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-10-03 13:44:49 +0200
committerMontel Laurent <[email protected]>2017-10-03 13:44:49 +0200
commit97977513636112a021a45be1145febe21248ab89 (patch)
tree4949406c69ed8f88a7f63f6098321752d79ca24c
parentdd9469df4d3f69a13957813f757d275f8d269b43 (diff)
Save/restore dialog size
-rw-r--r--src/searchdialog/incompleteindexdialog.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/searchdialog/incompleteindexdialog.cpp b/src/searchdialog/incompleteindexdialog.cpp
index c50ed70..31b9750 100644
--- a/src/searchdialog/incompleteindexdialog.cpp
+++ b/src/searchdialog/incompleteindexdialog.cpp
@@ -38,6 +38,8 @@
#include <QTimer>
#include <QHBoxLayout>
#include <QDialogButtonBox>
+#include <KConfigGroup>
+#include <KSharedConfig>
Q_DECLARE_METATYPE(Qt::CheckState)
Q_DECLARE_METATYPE(QVector<qint64>)
@@ -142,10 +144,28 @@ IncompleteIndexDialog::IncompleteIndexDialog(const QVector<qint64> &unindexedCol
mUi->buttonBox->button(QDialogButtonBox::Cancel)->setText(i18n("Search Anyway"));
connect(mUi->buttonBox, &QDialogButtonBox::accepted, this, &IncompleteIndexDialog::waitForIndexer);
connect(mUi->buttonBox, &QDialogButtonBox::rejected, this, &IncompleteIndexDialog::reject);
+ readConfig();
}
IncompleteIndexDialog::~IncompleteIndexDialog()
{
+ writeConfig();
+}
+
+void IncompleteIndexDialog::readConfig()
+{
+ KConfigGroup group(KSharedConfig::openConfig(), "IncompleteIndexDialog");
+ const QSize size = group.readEntry("Size", QSize(500, 400));
+ if (size.isValid()) {
+ resize(size);
+ }
+}
+
+void IncompleteIndexDialog::writeConfig()
+{
+ KConfigGroup group(KSharedConfig::openConfig(), "IncompleteIndexDialog");
+ group.writeEntry("Size", size());
+ group.sync();
}
void IncompleteIndexDialog::selectAll()