Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

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

not necessary to create as static

parent 539d0090
......@@ -66,11 +66,12 @@ void PreviewWidget::slotMainFileNameChanged(const QString &filename)
void PreviewWidget::loadConfig()
{
KSharedConfig::Ptr config = KGlobal::config();
ThemeEditorUtil themeutil;
if (config->hasGroup(QLatin1String("Global"))) {
KConfigGroup group = config->group(QLatin1String("Global"));
mDefaultEmail = group.readEntry("defaultEmail", themeeditorutil::defaultMail()).toLatin1();
mDefaultEmail = group.readEntry("defaultEmail", themeutil.defaultMail()).toLatin1();
} else {
mDefaultEmail = themeeditorutil::defaultMail().toLatin1();
mDefaultEmail = themeutil.defaultMail().toLatin1();
}
updateViewer();
}
......
......@@ -78,7 +78,8 @@ ThemeConfigureDialog::~ThemeConfigureDialog()
void ThemeConfigureDialog::slotDefaultClicked()
{
mConfigureWidget->setDefault();
mDefaultEmail->setPlainText(themeeditorutil::defaultMail());
ThemeEditorUtil themeutil;
mDefaultEmail->setPlainText(themeutil.defaultMail());
mDefaultTemplate->editor()->clear();
}
......@@ -90,13 +91,14 @@ void ThemeConfigureDialog::slotOkClicked()
void ThemeConfigureDialog::readConfig()
{
KSharedConfig::Ptr config = KGlobal::config();
ThemeEditorUtil themeutil;
if (config->hasGroup(QLatin1String("Global"))) {
KConfigGroup group = config->group(QLatin1String("Global"));
mConfigureWidget->readConfig();
mDefaultEmail->setPlainText(group.readEntry("defaultEmail",themeeditorutil::defaultMail()));
mDefaultEmail->setPlainText(group.readEntry("defaultEmail",themeutil.defaultMail()));
mDefaultTemplate->setPlainText(group.readEntry("defaultTemplate",QString()));
} else {
mDefaultEmail->setPlainText(themeeditorutil::defaultMail());
mDefaultEmail->setPlainText(themeutil.defaultMail());
}
KConfigGroup group = KConfigGroup( config, "ThemeConfigureDialog" );
......
......@@ -17,7 +17,12 @@
#include "themeeditorutil.h"
QString themeeditorutil::defaultMail()
ThemeEditorUtil::ThemeEditorUtil()
{
}
QString ThemeEditorUtil::defaultMail() const
{
const QString mail = QString::fromLatin1("From: montel@example.com\n"
"To: kde@example.com\n"
......
......@@ -21,9 +21,11 @@
#include <QString>
namespace themeeditorutil
class ThemeEditorUtil
{
QString defaultMail();
}
public:
ThemeEditorUtil();
QString defaultMail() const;
};
#endif // THEMEEDITORUTIL_H
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