Commit e8a9a0e9 authored by Laurent Montel's avatar Laurent Montel 😁

Avoid potential problem about config name

parent 6177f693
......@@ -14,7 +14,9 @@
#include <QPushButton>
using namespace KABGravatar;
namespace {
static const char myConfigGroupName[] = "GravatarUpdateDialog";
}
GravatarUpdateDialog::GravatarUpdateDialog(QWidget *parent)
: QDialog(parent)
{
......@@ -96,7 +98,7 @@ void GravatarUpdateDialog::setOriginalPixmap(const QPixmap &pix)
void GravatarUpdateDialog::readConfig()
{
KConfigGroup grp(KSharedConfig::openConfig(), "GravatarUpdateDialog");
KConfigGroup grp(KSharedConfig::openConfig(), myConfigGroupName);
const QSize size = grp.readEntry("Size", QSize(300, 200));
if (size.isValid()) {
resize(size);
......@@ -105,7 +107,7 @@ void GravatarUpdateDialog::readConfig()
void GravatarUpdateDialog::writeConfig()
{
KConfigGroup grp(KSharedConfig::openConfig(), "GravatarUpdateDialog");
KConfigGroup grp(KSharedConfig::openConfig(), myConfigGroupName);
grp.writeEntry("Size", size());
grp.sync();
}
......@@ -23,6 +23,9 @@
#include <QStackedWidget>
using namespace KABMergeContacts;
namespace {
static const char myConfigGroupName[] = "MergeContactsDialog";
}
MergeContactsDialog::MergeContactsDialog(QWidget *parent)
: QDialog(parent)
{
......@@ -89,7 +92,7 @@ void MergeContactsDialog::slotCustomizeMergeContact(const Akonadi::Item::List &l
void MergeContactsDialog::readConfig()
{
KConfigGroup grp(KSharedConfig::openConfig(), "MergeContactsDialog");
KConfigGroup grp(KSharedConfig::openConfig(), myConfigGroupName);
const QSize size = grp.readEntry("Size", QSize(300, 200));
if (size.isValid()) {
resize(size);
......@@ -98,7 +101,7 @@ void MergeContactsDialog::readConfig()
void MergeContactsDialog::writeConfig()
{
KConfigGroup grp(KSharedConfig::openConfig(), "MergeContactsDialog");
KConfigGroup grp(KSharedConfig::openConfig(), myConfigGroupName);
grp.writeEntry("Size", size());
grp.sync();
}
......
......@@ -22,7 +22,9 @@
#include <QVBoxLayout>
using namespace KABMergeContacts;
namespace {
static const char myConfigGroupName[] = "SearchAndMergeContactDuplicateContactDialog";
}
SearchAndMergeContactDuplicateContactDialog::SearchAndMergeContactDuplicateContactDialog(QWidget *parent)
: QDialog(parent)
{
......@@ -91,7 +93,7 @@ void SearchAndMergeContactDuplicateContactDialog::searchPotentialDuplicateContac
void SearchAndMergeContactDuplicateContactDialog::readConfig()
{
KConfigGroup grp(KSharedConfig::openConfig(), "MergeContactDuplicateContactDialog");
KConfigGroup grp(KSharedConfig::openConfig(), myConfigGroupName);
const QSize size = grp.readEntry("Size", QSize(300, 200));
if (size.isValid()) {
resize(size);
......@@ -100,7 +102,7 @@ void SearchAndMergeContactDuplicateContactDialog::readConfig()
void SearchAndMergeContactDuplicateContactDialog::writeConfig()
{
KConfigGroup grp(KSharedConfig::openConfig(), "MergeContactDuplicateContactDialog");
KConfigGroup grp(KSharedConfig::openConfig(), myConfigGroupName);
grp.writeEntry("Size", size());
grp.sync();
}
......
......@@ -10,6 +10,9 @@
#include <KSharedConfig>
#include <QCheckBox>
#include <QVBoxLayout>
namespace {
static const char myConfigGroupName[] = "Markdown";
}
MarkdownConfigureWidget::MarkdownConfigureWidget(QWidget *parent)
: MessageComposer::PluginEditorConvertTextConfigureWidget(parent)
{
......@@ -33,14 +36,14 @@ MarkdownConfigureWidget::~MarkdownConfigureWidget()
void MarkdownConfigureWidget::loadSettings()
{
KConfigGroup grp(KSharedConfig::openConfig(), "Markdown");
KConfigGroup grp(KSharedConfig::openConfig(), myConfigGroupName);
mLatexSupport->setChecked(grp.readEntry("Enable Embedded Latex", false));
mExtraDefinitionLists->setChecked(grp.readEntry("Enable Extra Definition Lists", false));
}
void MarkdownConfigureWidget::saveSettings()
{
KConfigGroup grp(KSharedConfig::openConfig(), "Markdown");
KConfigGroup grp(KSharedConfig::openConfig(), myConfigGroupName);
grp.writeEntry("Enable Embedded Latex", mLatexSupport->isChecked());
grp.writeEntry("Enable Extra Definition Lists", mExtraDefinitionLists->isChecked());
}
......
......@@ -11,6 +11,9 @@
#include <KConfigGroup>
#include <KSharedConfig>
namespace {
static const char myConfigGroupName[] = "SelectMailDialog";
}
SelectMailDialog::SelectMailDialog(QWidget *parent)
: QDialog(parent)
{
......@@ -46,7 +49,7 @@ void SelectMailDialog::accept()
void SelectMailDialog::readConfig()
{
KConfigGroup grp(KSharedConfig::openConfig(), "SelectMailDialog");
KConfigGroup grp(KSharedConfig::openConfig(), myConfigGroupName);
const QSize size = grp.readEntry("Size", QSize(300, 200));
if (size.isValid()) {
resize(size);
......@@ -55,7 +58,7 @@ void SelectMailDialog::readConfig()
void SelectMailDialog::writeConfig()
{
KConfigGroup grp(KSharedConfig::openConfig(), "SelectMailDialog");
KConfigGroup grp(KSharedConfig::openConfig(), myConfigGroupName);
grp.writeEntry("Size", size());
grp.sync();
}
......@@ -14,7 +14,9 @@
#include <QComboBox>
#include <QLabel>
#include <QVBoxLayout>
namespace {
static const char myConfigGroupName[] = "ShortUrl";
}
InsertShorturlConfigureWidget::InsertShorturlConfigureWidget(QWidget *parent)
: QWidget(parent)
{
......@@ -49,7 +51,7 @@ void InsertShorturlConfigureWidget::slotChanged()
void InsertShorturlConfigureWidget::loadConfig()
{
KConfigGroup grp(KSharedConfig::openConfig(), "ShortUrl");
KConfigGroup grp(KSharedConfig::openConfig(), myConfigGroupName);
const QString engineName = grp.readEntry("EngineName");
int index = mShortUrlServer->findData(engineName);
if (index < 0) {
......@@ -62,7 +64,7 @@ void InsertShorturlConfigureWidget::loadConfig()
void InsertShorturlConfigureWidget::writeConfig()
{
if (mChanged) {
KConfigGroup grp(KSharedConfig::openConfig(), "ShortUrl");
KConfigGroup grp(KSharedConfig::openConfig(), myConfigGroupName);
grp.writeEntry("EngineName", mShortUrlServer->itemData(mShortUrlServer->currentIndex()).toString());
grp.sync();
}
......
......@@ -10,7 +10,9 @@
#include <QCheckBox>
#include <KConfigGroup>
#include <KSharedConfig>
namespace {
static const char myConfigGroupName[] = "Check Before Send";
}
CheckBeforeSendConfigureWidget::CheckBeforeSendConfigureWidget(QWidget *parent)
: MessageComposer::PluginEditorCheckBeforeSendConfigureWidget(parent)
{
......@@ -47,7 +49,7 @@ CheckBeforeSendConfigureWidget::~CheckBeforeSendConfigureWidget()
void CheckBeforeSendConfigureWidget::loadSettings()
{
KConfigGroup grp(KSharedConfig::openConfig(), "Check Before Send");
KConfigGroup grp(KSharedConfig::openConfig(), myConfigGroupName);
mCheckPlainTextMail->setChecked(grp.readEntry("SendPlainText", false));
mCheckMailTransport->setChecked(grp.readEntry("SmtpDefinedInIdentity", false));
mCheckDuplicateEmailsAddresses->setChecked(grp.readEntry("CheckDuplicatedEmails", false));
......@@ -56,7 +58,7 @@ void CheckBeforeSendConfigureWidget::loadSettings()
void CheckBeforeSendConfigureWidget::saveSettings()
{
KConfigGroup grp(KSharedConfig::openConfig(), "Check Before Send");
KConfigGroup grp(KSharedConfig::openConfig(), myConfigGroupName);
grp.writeEntry("SendPlainText", mCheckPlainTextMail->isChecked());
grp.writeEntry("SmtpDefinedInIdentity", mCheckMailTransport->isChecked());
grp.writeEntry("CheckDuplicatedEmails", mCheckDuplicateEmailsAddresses->isChecked());
......
......@@ -17,7 +17,9 @@
#include <KIdentityManagement/Identity>
#include <MessageComposer/AliasesExpandJob>
#include <PimCommon/PimUtil>
namespace {
static const char myConfigGroupName[] = "Confirm Address";
}
ConfirmAddressInterface::ConfirmAddressInterface(QObject *parent)
: MessageComposer::PluginEditorCheckBeforeSendInterface(parent)
{
......@@ -82,7 +84,7 @@ bool ConfirmAddressInterface::exec(const MessageComposer::PluginEditorCheckBefor
void ConfirmAddressInterface::slotAddWhiteListEmails(const QStringList &lst, uint currentIdentity)
{
KConfigGroup grp(KSharedConfig::openConfig(), "Confirm Address");
KConfigGroup grp(KSharedConfig::openConfig(), myConfigGroupName);
KConfigGroup identityGroup = grp.group(QStringLiteral("Confirm Address %1").arg(currentIdentity));
QStringList oldWhiteList = identityGroup.readEntry("Emails", QStringList());
for (const QString &email : lst) {
......@@ -97,7 +99,7 @@ void ConfirmAddressInterface::slotAddWhiteListEmails(const QStringList &lst, uin
void ConfirmAddressInterface::reloadConfig()
{
KConfigGroup grp(KSharedConfig::openConfig(), "Confirm Address");
KConfigGroup grp(KSharedConfig::openConfig(), myConfigGroupName);
mHashSettings.clear();
KIdentityManagement::IdentityManager *im = KIdentityManagement::IdentityManager::self();
......
......@@ -8,7 +8,9 @@
#include <KConfigGroup>
#include <KSharedConfig>
#include <QStandardPaths>
namespace {
static const char myConfigGroupName[] = "Grammalecte";
}
GrammalecteManager::GrammalecteManager(QObject *parent)
: QObject(parent)
{
......@@ -27,7 +29,7 @@ GrammalecteManager *GrammalecteManager::self()
void GrammalecteManager::saveSettings()
{
KConfigGroup grp(KSharedConfig::openConfig(), "Grammalecte");
KConfigGroup grp(KSharedConfig::openConfig(), myConfigGroupName);
grp.writeEntry(QStringLiteral("pythonpath"), mPythonPath);
grp.writeEntry(QStringLiteral("grammalectepath"), mGrammalectePath);
grp.writeEntry(QStringLiteral("options"), mOptions);
......@@ -45,7 +47,7 @@ void GrammalecteManager::setOptions(const QStringList &saveOptions)
void GrammalecteManager::loadSettings()
{
KConfigGroup grp(KSharedConfig::openConfig(), "Grammalecte");
KConfigGroup grp(KSharedConfig::openConfig(), myConfigGroupName);
mPythonPath = grp.readEntry(QStringLiteral("pythonpath"));
if (mPythonPath.isEmpty()) {
mPythonPath = QStandardPaths::findExecutable(QStringLiteral("python3"));
......
......@@ -11,7 +11,9 @@
#include <QNetworkAccessManager>
#include <QColor>
#include <QRandomGenerator>
namespace {
static const char myConfigGroupName[] = "LanguageTool";
}
LanguageToolManager::LanguageToolManager(QObject *parent)
: QObject(parent)
, mNetworkAccessManager(new QNetworkAccessManager(this))
......@@ -82,7 +84,7 @@ void LanguageToolManager::setLanguageToolPath(const QString &path)
void LanguageToolManager::loadSettings()
{
KConfigGroup grp(KSharedConfig::openConfig(), "LanguageTool");
KConfigGroup grp(KSharedConfig::openConfig(), myConfigGroupName);
mLanguageToolPath = grp.readEntry(QStringLiteral("languagetoolpath"), QStringLiteral("https://languagetool.org/api/v2"));
mLanguage = grp.readEntry(QStringLiteral("language"), QStringLiteral("en"));
mUseLocalInstance = grp.readEntry(QStringLiteral("useLocalInstance"), false);
......@@ -91,7 +93,7 @@ void LanguageToolManager::loadSettings()
void LanguageToolManager::saveSettings()
{
KConfigGroup grp(KSharedConfig::openConfig(), "LanguageTool");
KConfigGroup grp(KSharedConfig::openConfig(), myConfigGroupName);
grp.writeEntry(QStringLiteral("languagetoolpath"), mLanguageToolPath);
grp.writeEntry(QStringLiteral("language"), mLanguage);
grp.writeEntry(QStringLiteral("useLocalInstance"), mUseLocalInstance);
......
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