Commit 6c3c612f authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use openStateConfig here too

parent 4443cf4c
Pipeline #74306 passed with stage
in 5 minutes and 58 seconds
......@@ -21,6 +21,10 @@
#include <QStackedWidget>
#include <QTabBar>
namespace
{
static const char mySieveEditorMainWidgetConfigGroupName[] = "SieveEditorMainWidget";
}
SieveEditorMainWidget::SieveEditorMainWidget(KActionCollection *ac, QWidget *parent)
: QSplitter(parent)
{
......@@ -49,7 +53,7 @@ SieveEditorMainWidget::SieveEditorMainWidget(KActionCollection *ac, QWidget *par
setChildrenCollapsible(false);
QList<int> splitterSizes;
splitterSizes << 80 << 20;
KConfigGroup myGroup(KSharedConfig::openConfig(), "SieveEditorMainWidget");
KConfigGroup myGroup(KSharedConfig::openStateConfig(), mySieveEditorMainWidgetConfigGroupName);
setSizes(myGroup.readEntry("mainSplitter", splitterSizes));
updateStackedWidget();
}
......@@ -57,7 +61,7 @@ SieveEditorMainWidget::SieveEditorMainWidget(KActionCollection *ac, QWidget *par
SieveEditorMainWidget::~SieveEditorMainWidget()
{
disconnect(mScriptManagerWidget, &SieveEditorScriptManagerWidget::updateButtons, this, &SieveEditorMainWidget::updateButtons);
KConfigGroup myGroup(KSharedConfig::openConfig(), "SieveEditorMainWidget");
KConfigGroup myGroup(KSharedConfig::openStateConfig(), mySieveEditorMainWidgetConfigGroupName);
myGroup.writeEntry("mainSplitter", sizes());
myGroup.sync();
}
......
......@@ -40,6 +40,10 @@
#include <KUserFeedback/Provider>
#endif
namespace
{
static const char mySieveEditorMainWindowConfigGroupName[] = "SieveEditorMainWindow";
}
SieveEditorMainWindow::SieveEditorMainWindow(QWidget *parent)
: KXmlGuiWindow(parent)
{
......@@ -77,8 +81,8 @@ SieveEditorMainWindow::SieveEditorMainWindow(QWidget *parent)
SieveEditorMainWindow::~SieveEditorMainWindow()
{
KSharedConfig::Ptr config = KSharedConfig::openConfig();
KConfigGroup group = config->group(QStringLiteral("SieveEditorMainWindow"));
KSharedConfig::Ptr config = KSharedConfig::openStateConfig();
KConfigGroup group = config->group(mySieveEditorMainWindowConfigGroupName);
group.writeEntry("Size", size());
}
......@@ -110,8 +114,8 @@ void SieveEditorMainWindow::slotUpdateButtons(bool newScriptAction, bool editScr
void SieveEditorMainWindow::readConfig()
{
KSharedConfig::Ptr config = KSharedConfig::openConfig();
KConfigGroup group = KConfigGroup(config, "SieveEditorMainWindow");
KSharedConfig::Ptr config = KSharedConfig::openStateConfig();
KConfigGroup group = KConfigGroup(config, mySieveEditorMainWindowConfigGroupName);
const QSize sizeDialog = group.readEntry("Size", QSize(800, 600));
if (sizeDialog.isValid()) {
resize(sizeDialog);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment