Diffstat (limited to 'noncore/securityplugins/notice/noticeConfigWidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/securityplugins/notice/noticeConfigWidget.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/securityplugins/notice/noticeConfigWidget.cpp b/noncore/securityplugins/notice/noticeConfigWidget.cpp index e532232..e0468a7 100644 --- a/noncore/securityplugins/notice/noticeConfigWidget.cpp +++ b/noncore/securityplugins/notice/noticeConfigWidget.cpp | |||
@@ -48,36 +48,36 @@ NoticeConfigWidget::~NoticeConfigWidget() | |||
48 | /// write the notice text in the multiauth.conf Config file | 48 | /// write the notice text in the multiauth.conf Config file |
49 | void NoticeConfigWidget::writeConfig() | 49 | void NoticeConfigWidget::writeConfig() |
50 | { | 50 | { |
51 | if ( noticeMLE->edited() ) { | 51 | if ( noticeMLE->edited() ) { |
52 | odebug << "writing new notice text in Security.conf" << oendl; | 52 | odebug << "writing new notice text in Security.conf" << oendl; |
53 | setNoticeText(noticeMLE->text()); | 53 | setNoticeText(noticeMLE->text()); |
54 | } | 54 | } |
55 | } | 55 | } |
56 | 56 | ||
57 | /// reset the notice text to the hard-coded example defaultNoticeText | 57 | /// reset the notice text to the hard-coded example defaultNoticeText |
58 | void NoticeConfigWidget::resetNotice() | 58 | void NoticeConfigWidget::resetNotice() |
59 | { | 59 | { |
60 | noticeMLE->setText(defaultNoticeText); | 60 | noticeMLE->setText(QObject::tr(defaultNoticeText)); |
61 | } | 61 | } |
62 | 62 | ||
63 | /// get the notice text from the config file (with true new lines) | 63 | /// get the notice text from the config file (with true new lines) |
64 | /** | 64 | /** |
65 | * if no text has been defined yet returns defaultNoticeText | 65 | * if no text has been defined yet returns defaultNoticeText |
66 | */ | 66 | */ |
67 | QString NoticeConfigWidget::getNoticeText() { | 67 | QString NoticeConfigWidget::getNoticeText() { |
68 | m_config = new Config("Security"); | 68 | m_config = new Config("Security"); |
69 | m_config->setGroup("NoticePlugin"); | 69 | m_config->setGroup("NoticePlugin"); |
70 | // Note: C++ processes '\' character, so we have to type \\\\ to mean \\ to QRegExp | 70 | // Note: C++ processes '\' character, so we have to type \\\\ to mean \\ to QRegExp |
71 | QString noticeText = m_config->readEntry("noticeText", defaultNoticeText).replace( QRegExp("\\\\n"), "\n" ); | 71 | QString noticeText = m_config->readEntry("noticeText", QObject::tr(defaultNoticeText) ).replace( QRegExp("\\\\n"), "\n" ); |
72 | delete m_config; | 72 | delete m_config; |
73 | return noticeText; | 73 | return noticeText; |
74 | } | 74 | } |
75 | 75 | ||
76 | /// set the notice text in our m_config config file (escaping new lines) | 76 | /// set the notice text in our m_config config file (escaping new lines) |
77 | void NoticeConfigWidget::setNoticeText(QString noticeText) { | 77 | void NoticeConfigWidget::setNoticeText(QString noticeText) { |
78 | m_config = new Config("Security"); | 78 | m_config = new Config("Security"); |
79 | m_config->setGroup("NoticePlugin"); | 79 | m_config->setGroup("NoticePlugin"); |
80 | // since Config files do not allow true newlines, we replace them with litteral "\n" | 80 | // since Config files do not allow true newlines, we replace them with litteral "\n" |
81 | m_config->writeEntry("noticeText", noticeText.replace( QRegExp("\n"), "\\n" )); | 81 | m_config->writeEntry("noticeText", noticeText.replace( QRegExp("\n"), "\\n" )); |
82 | delete m_config; | 82 | delete m_config; |
83 | } | 83 | } |