Commit 9b2ef3d9 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Store window size in openStateConfig

parent 71dd2cf1
Pipeline #58857 passed with stage
in 14 minutes and 13 seconds
......@@ -75,7 +75,7 @@ public:
private:
void readConfig()
{
KConfigGroup dialog(KSharedConfig::openConfig(), "DumpCrlCacheDialog");
KConfigGroup dialog(KSharedConfig::openStateConfig(), "DumpCrlCacheDialog");
const QSize size = dialog.readEntry("Size", QSize(600, 400));
if (size.isValid()) {
resize(size);
......@@ -84,7 +84,7 @@ private:
void writeConfig()
{
KConfigGroup dialog(KSharedConfig::openConfig(), "DumpCrlCacheDialog");
KConfigGroup dialog(KSharedConfig::openStateConfig(), "DumpCrlCacheDialog");
dialog.writeEntry("Size", size());
dialog.sync();
}
......
......@@ -44,7 +44,7 @@ ConfigureDialog::ConfigureDialog(QWidget *parent)
// the KCMultiDialog starts with the size of the first kcm, not
// the largest one. This way at least after the first showing of
// the largest kcm the size is kept.
const KConfigGroup geometry(KSharedConfig::openConfig(), "Geometry");
const KConfigGroup geometry(KSharedConfig::openStateConfig(), "Geometry");
const int width = geometry.readEntry("ConfigureDialogWidth", 0);
const int height = geometry.readEntry("ConfigureDialogHeight", 0);
if (width != 0 && height != 0) {
......@@ -55,7 +55,7 @@ ConfigureDialog::ConfigureDialog(QWidget *parent)
void ConfigureDialog::hideEvent(QHideEvent *e)
{
const QSize minSize = minimumSizeHint();
KConfigGroup geometry(KSharedConfig::openConfig(), "Geometry");
KConfigGroup geometry(KSharedConfig::openStateConfig(), "Geometry");
geometry.writeEntry("ConfigureDialogWidth", minSize.width());
geometry.writeEntry("ConfigureDialogHeight", minSize.height());
#if HAVE_KCMUTILS
......
......@@ -47,14 +47,14 @@ public:
private:
void saveLayout()
{
KConfigGroup configGroup(KSharedConfig::openConfig(), "GroupsConfigDialog");
KConfigGroup configGroup(KSharedConfig::openStateConfig(), "GroupsConfigDialog");
configGroup.writeEntry("Size", q->size());
configGroup.sync();
}
void restoreLayout(const QSize &defaultSize = QSize())
{
const KConfigGroup configGroup(KSharedConfig::openConfig(), "GroupsConfigDialog");
const KConfigGroup configGroup(KSharedConfig::openStateConfig(), "GroupsConfigDialog");
const QSize size = configGroup.readEntry("Size", defaultSize);
if (size.isValid()) {
q->resize(size);
......
......@@ -109,7 +109,7 @@ public:
void readConfig()
{
KConfigGroup dialog(KSharedConfig::openConfig(), "ResultDialog");
KConfigGroup dialog(KSharedConfig::openStateConfig(), "ResultDialog");
const QSize size = dialog.readEntry("Size", QSize(600, 400));
if (size.isValid()) {
resize(size);
......@@ -117,7 +117,7 @@ public:
}
void writeConfig()
{
KConfigGroup dialog(KSharedConfig::openConfig(), "ResultDialog");
KConfigGroup dialog(KSharedConfig::openStateConfig(), "ResultDialog");
dialog.writeEntry("Size", size());
dialog.sync();
}
......
......@@ -227,7 +227,7 @@ void DecryptVerifyFilesDialog::readConfig()
windowHandle()->resize(640, 480);
// restore size from config file
KConfigGroup cfgGroup(KSharedConfig::openConfig(), "DecryptVerifyFilesDialog");
KConfigGroup cfgGroup(KSharedConfig::openStateConfig(), "DecryptVerifyFilesDialog");
KWindowConfig::restoreWindowSize(windowHandle(), cfgGroup);
// NOTICE: QWindow::setGeometry() does NOT impact the backing QWidget geometry even if the platform
......@@ -238,7 +238,7 @@ void DecryptVerifyFilesDialog::readConfig()
void DecryptVerifyFilesDialog::writeConfig()
{
KConfigGroup cfgGroup(KSharedConfig::openConfig(), "DecryptVerifyFilesDialog");
KConfigGroup cfgGroup(KSharedConfig::openStateConfig(), "DecryptVerifyFilesDialog");
KWindowConfig::saveWindowSize(windowHandle(), cfgGroup);
cfgGroup.sync();
}
......@@ -647,7 +647,7 @@ CertificateDetailsDialog::~CertificateDetailsDialog()
void CertificateDetailsDialog::readConfig()
{
KConfigGroup dialog(KSharedConfig::openConfig(), "CertificateDetailsDialog");
KConfigGroup dialog(KSharedConfig::openStateConfig(), "CertificateDetailsDialog");
const QSize size = dialog.readEntry("Size", QSize(730, 280));
if (size.isValid()) {
resize(size);
......@@ -656,7 +656,7 @@ void CertificateDetailsDialog::readConfig()
void CertificateDetailsDialog::writeConfig()
{
KConfigGroup dialog(KSharedConfig::openConfig(), "CertificateDetailsDialog");
KConfigGroup dialog(KSharedConfig::openStateConfig(), "CertificateDetailsDialog");
dialog.writeEntry("Size", size());
dialog.sync();
}
......
......@@ -78,7 +78,7 @@ CertifyCertificateDialog::CertifyCertificateDialog(QWidget *p, Qt::WindowFlags f
});
mainLay->addWidget(buttonBox);
KConfigGroup cfgGroup(KSharedConfig::openConfig(), "CertifyDialog");
KConfigGroup cfgGroup(KSharedConfig::openStateConfig(), "CertifyDialog");
const QByteArray geom = cfgGroup.readEntry("geometry", QByteArray());
if (!geom.isEmpty()) {
restoreGeometry(geom);
......@@ -89,7 +89,7 @@ CertifyCertificateDialog::CertifyCertificateDialog(QWidget *p, Qt::WindowFlags f
CertifyCertificateDialog::~CertifyCertificateDialog()
{
KConfigGroup cfgGroup(KSharedConfig::openConfig(), "CertifyDialog");
KConfigGroup cfgGroup(KSharedConfig::openStateConfig(), "CertifyDialog");
cfgGroup.writeEntry("geometry", saveGeometry());
cfgGroup.sync();
}
......
......@@ -68,14 +68,14 @@ public:
private:
void saveGeometry()
{
KConfigGroup cfgGroup(KSharedConfig::openConfig(), "CreateCSRForCardKeyDialog");
KConfigGroup cfgGroup(KSharedConfig::openStateConfig(), "CreateCSRForCardKeyDialog");
cfgGroup.writeEntry("Size", q->size());
cfgGroup.sync();
}
void restoreGeometry(const QSize &defaultSize)
{
KConfigGroup cfgGroup(KSharedConfig::openConfig(), "CreateCSRForCardKeyDialog");
KConfigGroup cfgGroup(KSharedConfig::openStateConfig(), "CreateCSRForCardKeyDialog");
const QSize size = cfgGroup.readEntry("Size", defaultSize);
if (size.isValid()) {
q->resize(size);
......
......@@ -61,7 +61,7 @@ public:
void readConfig()
{
KConfigGroup dialog(KSharedConfig::openConfig(), "DeleteCertificatesDialog");
KConfigGroup dialog(KSharedConfig::openStateConfig(), "DeleteCertificatesDialog");
ui.selectedKTV.restoreLayout(dialog);
ui.unselectedKTV.restoreLayout(dialog);
const QSize size = dialog.readEntry("Size", QSize(600, 400));
......@@ -72,7 +72,7 @@ public:
void writeConfig()
{
KConfigGroup dialog(KSharedConfig::openConfig(), "DeleteCertificatesDialog");
KConfigGroup dialog(KSharedConfig::openStateConfig(), "DeleteCertificatesDialog");
ui.selectedKTV.saveLayout(dialog);
dialog.writeEntry("Size", q->size());
dialog.sync();
......
......@@ -187,7 +187,7 @@ ExportDialog::ExportDialog(QWidget *parent)
: QDialog(parent),
mWidget(new ExportWidget(this))
{
KConfigGroup dialog(KSharedConfig::openConfig(), "ExportDialog");
KConfigGroup dialog(KSharedConfig::openStateConfig(), "ExportDialog");
const auto size = dialog.readEntry("Size", QSize(600, 800));
if (size.isValid()) {
resize(size);
......@@ -205,7 +205,7 @@ ExportDialog::ExportDialog(QWidget *parent)
ExportDialog::~ExportDialog()
{
KConfigGroup dialog(KSharedConfig::openConfig(), "ExportDialog");
KConfigGroup dialog(KSharedConfig::openStateConfig(), "ExportDialog");
dialog.writeEntry("Size", size());
dialog.sync();
}
......
......@@ -94,7 +94,7 @@ public:
private:
void saveLayout()
{
KConfigGroup configGroup(KSharedConfig::openConfig(), "GroupDetailsDialog");
KConfigGroup configGroup(KSharedConfig::openStateConfig(), "GroupDetailsDialog");
ui.treeView->saveLayout(configGroup);
configGroup.writeEntry("Size", q->size());
configGroup.sync();
......@@ -102,7 +102,7 @@ private:
void restoreLayout(const QSize &defaultSize)
{
const KConfigGroup configGroup(KSharedConfig::openConfig(), "GroupDetailsDialog");
const KConfigGroup configGroup(KSharedConfig::openStateConfig(), "GroupDetailsDialog");
ui.treeView->restoreLayout(configGroup);
const QSize size = configGroup.readEntry("Size", defaultSize);
if (size.isValid()) {
......
......@@ -61,14 +61,14 @@ RevokeCertificationDialog::Private::~Private()
void RevokeCertificationDialog::Private::saveGeometry()
{
KConfigGroup cfgGroup(KSharedConfig::openConfig(), "RevokeCertificationDialog");
KConfigGroup cfgGroup(KSharedConfig::openStateConfig(), "RevokeCertificationDialog");
cfgGroup.writeEntry("geometry", q->saveGeometry());
cfgGroup.sync();
}
void RevokeCertificationDialog::Private::restoreGeometry(const QSize &defaultSize)
{
KConfigGroup cfgGroup(KSharedConfig::openConfig(), "RevokeCertificationDialog");
KConfigGroup cfgGroup(KSharedConfig::openStateConfig(), "RevokeCertificationDialog");
const QByteArray geometry = cfgGroup.readEntry("geometry", QByteArray());
if (!geometry.isEmpty()) {
q->restoreGeometry(geometry);
......
......@@ -226,7 +226,7 @@ SubKeysDialog::~SubKeysDialog()
void SubKeysDialog::readConfig()
{
KConfigGroup dialog(KSharedConfig::openConfig(), "SubKeysDialog");
KConfigGroup dialog(KSharedConfig::openStateConfig(), "SubKeysDialog");
const QSize size = dialog.readEntry("Size", QSize(820, 280));
if (size.isValid()) {
resize(size);
......@@ -235,7 +235,7 @@ void SubKeysDialog::readConfig()
void SubKeysDialog::writeConfig()
{
KConfigGroup dialog(KSharedConfig::openConfig(), "SubKeysDialog");
KConfigGroup dialog(KSharedConfig::openStateConfig(), "SubKeysDialog");
dialog.writeEntry("Size", size());
dialog.sync();
}
......
......@@ -21,7 +21,7 @@ using namespace Kleo;
WebOfTrustDialog::WebOfTrustDialog(QWidget *parent)
: QDialog(parent)
{
KConfigGroup dialog(KSharedConfig::openConfig(), "WebOfTrustDialog");
KConfigGroup dialog(KSharedConfig::openStateConfig(), "WebOfTrustDialog");
const QSize size = dialog.readEntry("Size", QSize(900, 400));
if (size.isValid()) {
resize(size);
......@@ -50,7 +50,7 @@ GpgME::Key WebOfTrustDialog::key() const
WebOfTrustDialog::~WebOfTrustDialog()
{
KConfigGroup dialog(KSharedConfig::openConfig(), "WebOfTrustDialog");
KConfigGroup dialog(KSharedConfig::openStateConfig(), "WebOfTrustDialog");
dialog.writeEntry("Size", size());
dialog.sync();
}
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