Summary: | Human-readable channel mode announcements don't get translated properly | ||
---|---|---|---|
Product: | [Applications] konversation | Reporter: | Eike Hein <hein> |
Component: | general | Assignee: | Konversation Developers <konversation-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | wordsizzle |
Priority: | NOR | ||
Version: | Git | ||
Target Milestone: | --- | ||
Platform: | Unlisted Binaries | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Eike Hein
2010-02-11 21:02:44 UTC
commit c46b1b0e94c19a9df5f044ad65645034c17358f0 Author: Travis McHenry <wordsizzle@gmail.com> Date: Mon Mar 1 20:46:02 2010 -0700 Fix the translations for the channel modes Previously the channel modes were loaded into the hash at runtime. Now, we load it when it's needed, coincidentally after KInstance has been started, so the i18n() calls now work. BUG:226377 diff --git a/src/common.cpp b/src/common.cpp index 87aac43..f8e740c 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -31,7 +31,7 @@ namespace Konversation "([-.\\d\\w]+@[-.\\d\\w]{2,}\\.[\\w]{2,})"); static QRegExp tdlPattern("(.*)\\.(\\w+),$"); - QHash<QChar,QString> initChanModesHash() + void initChanModesHash() { QHash<QChar,QString> myHash; @@ -47,14 +47,15 @@ namespace Konversation myHash.insert('c', i18n("no colors allowed")); myHash.insert('l', i18n("user throttling")); - return myHash; + m_modesHash = myHash; } - const QHash<QChar,QString> ChanModes::m_hash = initChanModesHash(); - QHash<QChar,QString> getChannelModesHash() { - return ChanModes::m_hash; + if(m_modesHash.isEmpty()) + initChanModesHash(); + + return m_modesHash; } QString removeIrcMarkup(const QString& text) diff --git a/src/common.h b/src/common.h index c0b56ca..c30c9ab 100644 --- a/src/common.h +++ b/src/common.h @@ -49,11 +49,6 @@ namespace Konversation CreateNewConnection }; - struct ChanModes - { - static const QHash<QChar,QString> m_hash; - }; - struct TextUrlData { QList<QPair<int, int> > urlRanges; @@ -74,6 +69,7 @@ namespace Konversation bool isUtf8(const QByteArray& text); uint colorForNick(const QString& nickname); + static QHash<QChar,QString> m_modesHash; QHash<QChar,QString> getChannelModesHash(); QString sterilizeUnicode(const QString& s); |