Commit 2920a7ec authored by Laurent Montel's avatar Laurent Montel
Browse files

USe namespace for group name

parent 953554d6
Pipeline #240958 passed with stage
in 8 minutes and 11 seconds
......@@ -16,7 +16,10 @@
#include <QVBoxLayout>
using namespace KSieveUi;
namespace
{
static const char myAutoCreateScriptDialogGroupName[] = "AutoCreateScriptDialog";
}
AutoCreateScriptDialog::AutoCreateScriptDialog(QWidget *parent)
: QDialog(parent)
, mEditor(new SieveEditorGraphicalModeWidget(this))
......@@ -67,7 +70,7 @@ QString AutoCreateScriptDialog::script(QStringList &required) const
void AutoCreateScriptDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "AutoCreateScriptDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), myAutoCreateScriptDialogGroupName);
const QSize sizeDialog = group.readEntry("Size", QSize(800, 600));
if (sizeDialog.isValid()) {
resize(sizeDialog);
......@@ -76,7 +79,7 @@ void AutoCreateScriptDialog::readConfig()
void AutoCreateScriptDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "AutoCreateScriptDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), myAutoCreateScriptDialogGroupName);
group.writeEntry("Size", size());
}
......
......@@ -20,7 +20,10 @@
#include <QVBoxLayout>
using namespace KSieveUi;
namespace
{
static const char mySelectFlagsListDialogGroupName[] = "SelectFlagsListDialog";
}
SelectFlagsListDialog::SelectFlagsListDialog(QWidget *parent)
: QDialog(parent)
, mListWidget(new SelectFlagsListWidget(this))
......@@ -47,7 +50,7 @@ SelectFlagsListDialog::~SelectFlagsListDialog()
void SelectFlagsListDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "SelectFlagsListDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), mySelectFlagsListDialogGroupName);
const QSize sizeDialog = group.readEntry("Size", QSize(300, 200));
if (sizeDialog.isValid()) {
resize(sizeDialog);
......@@ -56,7 +59,7 @@ void SelectFlagsListDialog::readConfig()
void SelectFlagsListDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "SelectFlagsListDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), mySelectFlagsListDialogGroupName);
group.writeEntry("Size", size());
}
......
......@@ -20,6 +20,10 @@
#include <QLabel>
#include <QVBoxLayout>
using namespace KSieveUi;
namespace
{
static const char mySelectFlagsListDialogGroupName[] = "SelectHeadersDialog";
}
const KLazyLocalizedString selectMultipleHeaders = kli18n("Select multiple headers...");
SelectHeadersDialog::SelectHeadersDialog(QWidget *parent)
: QDialog(parent)
......@@ -82,7 +86,7 @@ SelectHeadersDialog::~SelectHeadersDialog()
void SelectHeadersDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "SelectHeadersDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), mySelectFlagsListDialogGroupName);
const QSize size = group.readEntry("Size", QSize(400, 300));
if (size.isValid()) {
resize(size);
......@@ -91,7 +95,7 @@ void SelectHeadersDialog::readConfig()
void SelectHeadersDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "SelectHeadersDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), mySelectFlagsListDialogGroupName);
group.writeEntry("Size", size());
group.sync();
}
......
......@@ -21,7 +21,10 @@
#include <QVBoxLayout>
using namespace KSieveUi;
namespace
{
static const char myAutoCreateScriptDialogGroupName[] = "AutoCreateScriptDialog";
}
SieveEditorGraphicalModeWidget::SieveEditorGraphicalModeWidget(QWidget *parent)
: SieveEditorGraphicalModeWidgetAbstract::SieveEditorGraphicalModeWidgetAbstract(parent)
, mSieveScript(new SieveScriptListBox(i18n("Sieve Script"), this))
......@@ -65,14 +68,14 @@ void SieveEditorGraphicalModeWidget::loadScript(const QString &doc, QString &err
void SieveEditorGraphicalModeWidget::readConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "AutoCreateScriptDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), myAutoCreateScriptDialogGroupName);
const QList<int> size{100, 400};
mSplitter->setSizes(group.readEntry("mainSplitter", size));
}
void SieveEditorGraphicalModeWidget::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "AutoCreateScriptDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), myAutoCreateScriptDialogGroupName);
group.writeEntry("mainSplitter", mSplitter->sizes());
}
......
......@@ -15,7 +15,10 @@
#include <QVBoxLayout>
using namespace KSieveUi;
namespace
{
static const char mySieveScriptDescriptionDialogGroupName[] = "SieveScriptDescriptionDialog";
}
SieveScriptDescriptionDialog::SieveScriptDescriptionDialog(QWidget *parent)
: QDialog(parent)
, mEdit(new KPIMTextEdit::PlainTextEditorWidget(this))
......@@ -53,7 +56,7 @@ QString SieveScriptDescriptionDialog::description() const
void SieveScriptDescriptionDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "SieveScriptDescriptionDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), mySieveScriptDescriptionDialogGroupName);
const QSize sizeDialog = group.readEntry("Size", QSize(800, 600));
if (sizeDialog.isValid()) {
resize(sizeDialog);
......@@ -62,6 +65,6 @@ void SieveScriptDescriptionDialog::readConfig()
void SieveScriptDescriptionDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "SieveScriptDescriptionDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), mySieveScriptDescriptionDialogGroupName);
group.writeEntry("Size", size());
}
......@@ -17,6 +17,10 @@
#include <QVBoxLayout>
#include <cerrno>
using namespace KSieveUi;
namespace
{
static const char mySieveScriptParsingErrorDialogGroupName[] = "SieveScriptParsingErrorDialog";
}
SieveScriptParsingErrorDialog::SieveScriptParsingErrorDialog(QWidget *parent)
: QDialog(parent)
, mTextEdit(new KPIMTextEdit::RichTextEditorWidget(this))
......@@ -54,7 +58,7 @@ void SieveScriptParsingErrorDialog::setError(QString script, QString error)
void SieveScriptParsingErrorDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "SieveScriptParsingErrorDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), mySieveScriptParsingErrorDialogGroupName);
const QSize sizeDialog = group.readEntry("Size", QSize(800, 600));
if (sizeDialog.isValid()) {
resize(sizeDialog);
......@@ -63,7 +67,7 @@ void SieveScriptParsingErrorDialog::readConfig()
void SieveScriptParsingErrorDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "SieveScriptParsingErrorDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), mySieveScriptParsingErrorDialogGroupName);
group.writeEntry("Size", size());
}
......
......@@ -27,7 +27,10 @@
#include <QVBoxLayout>
using namespace KSieveUi;
namespace
{
static const char mySieveDebugDialogGroupName[] = "SieveDebugDialog";
}
SieveDebugDialog::SieveDebugDialog(SieveImapPasswordProvider *passwordProvider, QWidget *parent)
: QDialog(parent)
, mPasswordProvider(passwordProvider)
......@@ -77,7 +80,7 @@ SieveDebugDialog::~SieveDebugDialog()
void SieveDebugDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "SieveDebugDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), mySieveDebugDialogGroupName);
const QSize sizeDialog = group.readEntry("Size", QSize(640, 480));
if (sizeDialog.isValid()) {
resize(sizeDialog);
......@@ -86,7 +89,7 @@ void SieveDebugDialog::readConfig()
void SieveDebugDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "SieveDebugDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), mySieveDebugDialogGroupName);
group.writeEntry("Size", size());
}
......
......@@ -26,7 +26,10 @@ public:
SieveEditorWidget *mSieveEditorWidget = nullptr;
QPushButton *mOkButton = nullptr;
};
namespace
{
static const char mySieveEditorGroupName[] = "SieveEditor";
}
SieveEditor::SieveEditor(QWidget *parent)
: QDialog(parent)
, d(new KSieveUi::SieveEditorPrivate)
......@@ -96,13 +99,13 @@ void SieveEditor::slotEnableButtonOk(bool b)
void SieveEditor::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "SieveEditor");
KConfigGroup group(KSharedConfig::openStateConfig(), mySieveEditorGroupName);
group.writeEntry("Size", size());
}
void SieveEditor::readConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "SieveEditor");
KConfigGroup group(KSharedConfig::openStateConfig(), mySieveEditorGroupName);
const QSize sizeDialog = group.readEntry("Size", QSize(800, 600));
if (sizeDialog.isValid()) {
resize(sizeDialog);
......
......@@ -21,7 +21,10 @@
#include <QVBoxLayout>
using namespace KSieveUi;
namespace
{
static const char myParsingResultDialogGroupName[] = "ParsingResultDialog";
}
ParsingResultDialog::ParsingResultDialog(QWidget *parent)
: QDialog(parent)
{
......@@ -59,7 +62,7 @@ void ParsingResultDialog::setResultParsing(const QString &result)
void ParsingResultDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "ParsingResultDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), myParsingResultDialogGroupName);
const QSize sizeDialog = group.readEntry("Size", QSize(800, 600));
if (sizeDialog.isValid()) {
resize(sizeDialog);
......@@ -68,7 +71,7 @@ void ParsingResultDialog::readConfig()
void ParsingResultDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "ParsingResultDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), myParsingResultDialogGroupName);
group.writeEntry("Size", size());
}
......
......@@ -27,7 +27,10 @@
#include <KPIMTextEdit/TextToSpeechWidget>
#endif
using namespace KSieveUi;
namespace
{
static const char mySieveTemplateEditDialogGroupName[] = "SieveTemplateEditDialog";
}
SieveTemplateEditDialog::SieveTemplateEditDialog(QWidget *parent, bool defaultTemplate)
: QDialog(parent)
{
......@@ -105,13 +108,13 @@ SieveTemplateEditDialog::~SieveTemplateEditDialog()
void SieveTemplateEditDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "SieveTemplateEditDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), mySieveTemplateEditDialogGroupName);
group.writeEntry("Size", size());
}
void SieveTemplateEditDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "SieveTemplateEditDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), mySieveTemplateEditDialogGroupName);
const QSize sizeDialog = group.readEntry("Size", QSize(600, 400));
if (sizeDialog.isValid()) {
resize(sizeDialog);
......
......@@ -23,7 +23,10 @@
#include <QVBoxLayout>
using namespace KSieveUi;
namespace
{
static const char myMultiImapVacationDialogGroupName[] = "MultiImapVacationDialog";
}
class KSieveUi::MultiImapVacationDialogPrivate
{
public:
......@@ -182,7 +185,7 @@ void MultiImapVacationDialog::createPage(const QString &serverName, const KSieve
void MultiImapVacationDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "MultiImapVacationDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), myMultiImapVacationDialogGroupName);
const QSize size = group.readEntry("Size", QSize());
if (size.isValid()) {
resize(size);
......@@ -193,7 +196,7 @@ void MultiImapVacationDialog::readConfig()
void MultiImapVacationDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "MultiImapVacationDialog");
KConfigGroup group(KSharedConfig::openStateConfig(), myMultiImapVacationDialogGroupName);
group.writeEntry("Size", size());
}
......
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