From 2be4d5bf420dc4aff71cf78601c095a96ed88c47 Mon Sep 17 00:00:00 2001 From: zecke Date: Mon, 20 Dec 2004 22:21:55 +0000 Subject: Create the 'Config' instance on the Stack to avoid that we revert changes done in between of our creation and deletion --- (limited to 'noncore/securityplugins/notice/noticeplugin.cpp') 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 @@ -10,15 +10,11 @@ using Opie::Security::MultiauthConfigWidget; /// creates and initializes the m_config Config object NoticePlugin::NoticePlugin() : MultiauthPluginObject(), m_noticeW(0) { - m_config = new Config("Security"); - m_config->setGroup("NoticePlugin"); } /// deletes the m_config Config object and noticeW if necessary NoticePlugin::~NoticePlugin() { - delete m_config; - if (m_noticeW != 0) - delete m_noticeW; + delete m_noticeW; } /// Simply return its name (Notice plugin) @@ -81,6 +77,8 @@ int NoticePlugin::authenticate() { */ 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" ); } -- cgit v0.9.0.2