Commit 54fa7ae1 authored by Laurent Montel's avatar Laurent Montel
Browse files

Avoid potential problem

parent edf694f5
Pipeline #237975 passed with stage
in 15 minutes and 37 seconds
......@@ -6,7 +6,6 @@
#include "automaticaddcontactsplugin.h"
#include "automaticaddcontactsconfiguredialog.h"
#include "automaticaddcontactsconfigurewidget.h"
#include "automaticaddcontactsinterface.h"
#include <KPluginFactory>
......
......@@ -14,6 +14,10 @@
#include <QListWidget>
#include <QVBoxLayout>
namespace
{
static const char myConfigCheckDuplicateEmailsDialog[] = "CheckDuplicateEmailsDialog";
}
CheckDuplicateEmailsDialog::CheckDuplicateEmailsDialog(QWidget *parent)
: QDialog(parent)
, mListWidget(new QListWidget(this))
......@@ -51,13 +55,13 @@ void CheckDuplicateEmailsDialog::setDuplicatedEmails(const QMap<QString, int> &e
void CheckDuplicateEmailsDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "CheckDuplicateEmailsDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigCheckDuplicateEmailsDialog);
group.writeEntry("Size", size());
}
void CheckDuplicateEmailsDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "CheckDuplicateEmailsDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigCheckDuplicateEmailsDialog);
const QSize sizeDialog = group.readEntry("Size", QSize(500, 300));
if (sizeDialog.isValid()) {
resize(sizeDialog);
......
......@@ -12,6 +12,10 @@
#include <QListWidget>
#include <QVBoxLayout>
namespace
{
static const char myConfigCheckAttachmentDialog[] = "CheckAttachmentDialog";
}
CheckAttachmentDialog::CheckAttachmentDialog(QWidget *parent)
: QDialog(parent)
, mListWidget(new QListWidget(this))
......@@ -47,13 +51,13 @@ void CheckAttachmentDialog::setEmails(const QStringList &emails)
void CheckAttachmentDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "CheckAttachmentDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigCheckAttachmentDialog);
group.writeEntry("Size", size());
}
void CheckAttachmentDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "CheckAttachmentDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigCheckAttachmentDialog);
const QSize sizeDialog = group.readEntry("Size", QSize(500, 300));
if (sizeDialog.isValid()) {
resize(sizeDialog);
......
......@@ -14,6 +14,10 @@
#include <QPushButton>
#include <QVBoxLayout>
namespace
{
static const char myConfigConfirmAddressDialog[] = "ConfirmAddressDialog";
}
ConfirmAddressDialog::ConfirmAddressDialog(QWidget *parent)
: QDialog(parent)
, mConfirmWidget(new ConfirmAddressWidget(this))
......@@ -48,13 +52,13 @@ ConfirmAddressDialog::~ConfirmAddressDialog()
void ConfirmAddressDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "ConfirmAddressDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigConfirmAddressDialog);
group.writeEntry("Size", size());
}
void ConfirmAddressDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "ConfirmAddressDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigConfirmAddressDialog);
const QSize sizeDialog = group.readEntry("Size", QSize(500, 300));
if (sizeDialog.isValid()) {
resize(sizeDialog);
......
......@@ -12,6 +12,10 @@
#include <QDialogButtonBox>
#include <QVBoxLayout>
namespace
{
static const char myConfigGrammalecteConfigDialog[] = "GrammalecteConfigDialog";
}
GrammalecteConfigDialog::GrammalecteConfigDialog(QWidget *parent, bool disableMessageBox)
: QDialog(parent)
, mConfigWidget(new GrammalecteConfigWidget(this, disableMessageBox))
......@@ -38,13 +42,13 @@ GrammalecteConfigDialog::~GrammalecteConfigDialog()
void GrammalecteConfigDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "GrammalecteConfigDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigGrammalecteConfigDialog);
group.writeEntry("Size", size());
}
void GrammalecteConfigDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "GrammalecteConfigDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigGrammalecteConfigDialog);
const QSize sizeDialog = group.readEntry("Size", QSize(500, 300));
if (sizeDialog.isValid()) {
resize(sizeDialog);
......
......@@ -17,6 +17,10 @@
#include <QTreeView>
#include <QVBoxLayout>
namespace
{
static const char myConfigEmailAddressSelectionLdapDialog[] = "EmailAddressSelectionLdapDialog";
}
K_PLUGIN_CLASS_WITH_JSON(EmailAddressSelectionLdapDialog, "emailaddressselectionldapdialog.json")
EmailAddressSelectionLdapDialog::EmailAddressSelectionLdapDialog(QWidget *parent, const QList<QVariant> &)
......@@ -51,7 +55,7 @@ EmailAddressSelectionLdapDialog::EmailAddressSelectionLdapDialog(QWidget *parent
void EmailAddressSelectionLdapDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), QStringLiteral("EmailAddressSelectionLdapDialog"));
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigEmailAddressSelectionLdapDialog);
const QSize size = group.readEntry("Size", QSize());
if (size.isValid()) {
resize(size);
......@@ -62,7 +66,7 @@ void EmailAddressSelectionLdapDialog::readConfig()
void EmailAddressSelectionLdapDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), QStringLiteral("EmailAddressSelectionLdapDialog"));
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigEmailAddressSelectionLdapDialog);
group.writeEntry("Size", size());
}
......
......@@ -15,6 +15,10 @@
#include <QPushButton>
#include <QVBoxLayout>
namespace
{
static const char myConfigReactionToInvitationDialog[] = "ReactionToInvitationDialog";
}
ReactionToInvitationDialog::ReactionToInvitationDialog(QWidget *parent)
: QDialog(parent)
, mPlainTextEditor(new KPIMTextEdit::PlainTextEditorWidget(this))
......@@ -57,7 +61,7 @@ QString ReactionToInvitationDialog::comment() const
void ReactionToInvitationDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "ReactionToInvitationDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigReactionToInvitationDialog);
const QSize size = group.readEntry("Size", QSize(600, 400));
if (size.isValid()) {
resize(size);
......@@ -66,7 +70,7 @@ void ReactionToInvitationDialog::readConfig()
void ReactionToInvitationDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "ReactionToInvitationDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigReactionToInvitationDialog);
group.writeEntry("Size", size());
group.sync();
}
......@@ -15,6 +15,10 @@
#include <QDialogButtonBox>
#include <QPushButton>
#include <QVBoxLayout>
namespace
{
static const char myConfigAdBlockBlockableItemsDialog[] = "AdBlockBlockableItemsDialog";
}
using namespace AdBlock;
AdBlockBlockableItemsDialog::AdBlockBlockableItemsDialog(QWidget *parent)
: QDialog(parent)
......@@ -62,13 +66,13 @@ void AdBlockBlockableItemsDialog::setAdblockResult(const QVector<AdBlock::AdBloc
void AdBlockBlockableItemsDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "AdBlockBlockableItemsDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigAdBlockBlockableItemsDialog);
group.writeEntry("Size", size());
}
void AdBlockBlockableItemsDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "AdBlockBlockableItemsDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigAdBlockBlockableItemsDialog);
const QSize sizeDialog = group.readEntry("Size", QSize(500, 300));
if (sizeDialog.isValid()) {
resize(sizeDialog);
......
......@@ -24,6 +24,11 @@
#include <QUrl>
#include <QVBoxLayout>
namespace
{
static const char myConfigAdBlockShowListDialog[] = "AdBlockShowListDialog";
}
using namespace AdBlock;
AdBlockShowListDialog::AdBlockShowListDialog(bool showDeleteBrokenList, QWidget *parent)
: QDialog(parent)
......@@ -69,13 +74,13 @@ AdBlockShowListDialog::~AdBlockShowListDialog()
void AdBlockShowListDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "AdBlockShowListDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigAdBlockShowListDialog);
group.writeEntry("Size", size());
}
void AdBlockShowListDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "AdBlockShowListDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigAdBlockShowListDialog);
const QSize sizeDialog = group.readEntry("Size", QSize(800, 600));
if (sizeDialog.isValid()) {
resize(sizeDialog);
......
......@@ -14,6 +14,10 @@
#include <QDialogButtonBox>
#include <QPushButton>
#include <QVBoxLayout>
namespace
{
static const char myConfigSelectImapFolderDialog[] = "SelectImapFolderDialog";
}
SelectImapFolderDialog::SelectImapFolderDialog(const KSieveUi::SieveImapAccountSettings &account, QWidget *parent)
: QDialog(parent)
......@@ -54,13 +58,13 @@ QString SelectImapFolderDialog::selectedFolderName() const
void SelectImapFolderDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "SelectImapFolderDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigSelectImapFolderDialog);
group.writeEntry("Size", size());
}
void SelectImapFolderDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "SelectImapFolderDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigSelectImapFolderDialog);
const QSize sizeDialog = group.readEntry("Size", QSize(500, 300));
if (sizeDialog.isValid()) {
resize(sizeDialog);
......
Supports Markdown
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