Diffstat (limited to 'noncore/securityplugins/notice') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/securityplugins/notice/noticeConfigWidget.cpp | 14 | ||||
-rw-r--r-- | noncore/securityplugins/notice/noticeplugin.cpp | 8 | ||||
-rw-r--r-- | noncore/securityplugins/notice/noticeplugin.h | 1 |
3 files changed, 9 insertions, 14 deletions
diff --git a/noncore/securityplugins/notice/noticeConfigWidget.cpp b/noncore/securityplugins/notice/noticeConfigWidget.cpp index e0468a7..02084f8 100644 --- a/noncore/securityplugins/notice/noticeConfigWidget.cpp +++ b/noncore/securityplugins/notice/noticeConfigWidget.cpp @@ -67,7 +67,6 @@ void NoticeConfigWidget::resetNotice() QString NoticeConfigWidget::getNoticeText() { - m_config = new Config("Security"); - m_config->setGroup("NoticePlugin"); + Config config("Security"); + config.setGroup("NoticePlugin"); // Note: C++ processes '\' character, so we have to type \\\\ to mean \\ to QRegExp - QString noticeText = m_config->readEntry("noticeText", QObject::tr(defaultNoticeText) ).replace( QRegExp("\\\\n"), "\n" ); - delete m_config; + QString noticeText = config.readEntry("noticeText", QObject::tr(defaultNoticeText) ).replace( QRegExp("\\\\n"), "\n" ); return noticeText; @@ -77,7 +76,6 @@ QString NoticeConfigWidget::getNoticeText() { void NoticeConfigWidget::setNoticeText(QString noticeText) { - m_config = new Config("Security"); - m_config->setGroup("NoticePlugin"); + Config config("Security"); + config.setGroup("NoticePlugin"); // since Config files do not allow true newlines, we replace them with litteral "\n" - m_config->writeEntry("noticeText", noticeText.replace( QRegExp("\n"), "\\n" )); - delete m_config; + config.writeEntry("noticeText", noticeText.replace( QRegExp("\n"), "\\n" )); } diff --git a/noncore/securityplugins/notice/noticeplugin.cpp b/noncore/securityplugins/notice/noticeplugin.cpp index 5617855..d3dc7a4 100644 --- a/noncore/securityplugins/notice/noticeplugin.cpp +++ b/noncore/securityplugins/notice/noticeplugin.cpp @@ -12,4 +12,2 @@ using Opie::Security::MultiauthConfigWidget; NoticePlugin::NoticePlugin() : MultiauthPluginObject(), m_noticeW(0) { - m_config = new Config("Security"); - m_config->setGroup("NoticePlugin"); } @@ -18,4 +16,2 @@ NoticePlugin::NoticePlugin() : MultiauthPluginObject(), m_noticeW(0) { NoticePlugin::~NoticePlugin() { - delete m_config; - if (m_noticeW != 0) delete m_noticeW; @@ -83,3 +79,5 @@ QString NoticePlugin::getNoticeText() { // Note: C++ processes '\' character, so we have to type \\\\ to mean \\ to QRegExp - return m_config->readEntry("noticeText", QObject::tr(defaultNoticeText)).replace( QRegExp("\\\\n"), "\n" ); + Config config("Security"); + config.setGroup("NoticePlugin"); + return config.readEntry("noticeText", QObject::tr(defaultNoticeText)).replace( QRegExp("\\\\n"), "\n" ); } diff --git a/noncore/securityplugins/notice/noticeplugin.h b/noncore/securityplugins/notice/noticeplugin.h index 2828f58..22b2322 100644 --- a/noncore/securityplugins/notice/noticeplugin.h +++ b/noncore/securityplugins/notice/noticeplugin.h @@ -59,3 +59,2 @@ private: NoticeConfigWidget * m_noticeW; - Config * m_config; QString getNoticeText(); |