Changeset View
Changeset View
Standalone View
Standalone View
applets/kimpanel/backend/ibus/emojier/emojier.cpp
Show First 20 Lines • Show All 122 Lines • ▼ Show 20 Line(s) | |||||
123 | { | 123 | { | ||
124 | Q_OBJECT | 124 | Q_OBJECT | ||
125 | Q_PROPERTY(QStringList categories MEMBER m_categories CONSTANT) | 125 | Q_PROPERTY(QStringList categories MEMBER m_categories CONSTANT) | ||
126 | public: | 126 | public: | ||
127 | enum EmojiRole { CategoryRole = Qt::UserRole + 1 }; | 127 | enum EmojiRole { CategoryRole = Qt::UserRole + 1 }; | ||
128 | 128 | | |||
129 | EmojiModel() { | 129 | EmojiModel() { | ||
130 | QLocale locale; | 130 | QLocale locale; | ||
131 | const QString dictName = "ibus/dicts/emoji-" + locale.bcp47Name() + ".dict"; | 131 | const QString dictName = "ibus/dicts/emoji-" + locale.bcp47Name().replace(QLatin1Char('-'), QLatin1Char('_')) + ".dict"; | ||
132 | const QString path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, dictName); | 132 | const QString path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, dictName); | ||
133 | if (path.isEmpty()) { | 133 | if (path.isEmpty()) { | ||
134 | qWarning() << "could not find" << dictName; | 134 | qWarning() << "could not find" << dictName; | ||
135 | return; | 135 | return; | ||
136 | } | 136 | } | ||
137 | 137 | | |||
138 | GSList *list = ibus_emoji_data_load (path.toUtf8().constData()); | 138 | GSList *list = ibus_emoji_data_load (path.toUtf8().constData()); | ||
139 | m_emoji.reserve(g_slist_length(list)); | 139 | m_emoji.reserve(g_slist_length(list)); | ||
▲ Show 20 Lines • Show All 190 Lines • Show Last 20 Lines |