Commit c9b9a4f4 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

emojier: only search for the more generic dictionary when it exists

Otherwise we end up loading the emoji dictionary twice, and it's not cheap.
parent d860c033
......@@ -138,12 +138,15 @@ public:
return;
}
const QString genericDictName = "ibus/dicts/emoji-" + bcp.left(bcp.indexOf(QLatin1Char('-'))) + ".dict";
const QString genericPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, genericDictName);
QVector<QString> dicts = {path};
if (!genericPath.isEmpty()) {
dicts << genericPath;
const auto idxSpecific = bcp.indexOf(QLatin1Char('-'));
if (idxSpecific > 0) {
const QString genericDictName = "ibus/dicts/emoji-" + bcp.left(idxSpecific) + ".dict";
const QString genericPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, genericDictName);
if (!genericPath.isEmpty()) {
dicts << genericPath;
}
}
QSet<QString> categories;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment