summaryrefslogtreecommitdiff
path: root/noncore/securityplugins/notice/noticeplugin.cpp
Unidiff
Diffstat (limited to 'noncore/securityplugins/notice/noticeplugin.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/securityplugins/notice/noticeplugin.cpp10
1 files changed, 4 insertions, 6 deletions
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
@@ -7,21 +7,17 @@
7 7
8using Opie::Security::MultiauthPluginObject; 8using Opie::Security::MultiauthPluginObject;
9using Opie::Security::MultiauthConfigWidget; 9using Opie::Security::MultiauthConfigWidget;
10 10
11/// creates and initializes the m_config Config object 11/// creates and initializes the m_config Config object
12NoticePlugin::NoticePlugin() : MultiauthPluginObject(), m_noticeW(0) { 12NoticePlugin::NoticePlugin() : MultiauthPluginObject(), m_noticeW(0) {
13 m_config = new Config("Security");
14 m_config->setGroup("NoticePlugin");
15} 13}
16 14
17/// deletes the m_config Config object and noticeW if necessary 15/// deletes the m_config Config object and noticeW if necessary
18NoticePlugin::~NoticePlugin() { 16NoticePlugin::~NoticePlugin() {
19 delete m_config; 17 delete m_noticeW;
20 if (m_noticeW != 0)
21 delete m_noticeW;
22} 18}
23 19
24/// Simply return its name (Notice plugin) 20/// Simply return its name (Notice plugin)
25QString NoticePlugin::pluginName() const { 21QString NoticePlugin::pluginName() const {
26 return "Notice plugin"; 22 return "Notice plugin";
27} 23}
@@ -78,9 +74,11 @@ int NoticePlugin::authenticate() {
78/// get the notice text from our m_config config file (with true new lines) 74/// get the notice text from our m_config config file (with true new lines)
79/** 75/**
80 * if no text has been defined yet returns defaultNoticeText 76 * if no text has been defined yet returns defaultNoticeText
81 */ 77 */
82QString NoticePlugin::getNoticeText() { 78QString NoticePlugin::getNoticeText() {
83 // Note: C++ processes '\' character, so we have to type \\\\ to mean \\ to QRegExp 79 // Note: C++ processes '\' character, so we have to type \\\\ to mean \\ to QRegExp
84 return m_config->readEntry("noticeText", QObject::tr(defaultNoticeText)).replace( QRegExp("\\\\n"), "\n" ); 80 Config config("Security");
81 config.setGroup("NoticePlugin");
82 return config.readEntry("noticeText", QObject::tr(defaultNoticeText)).replace( QRegExp("\\\\n"), "\n" );
85} 83}
86 84