diff options
Diffstat (limited to 'src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp')
-rw-r--r-- | src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp index ea0b5261c4..395bb5b090 100644 --- a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp +++ b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp @@ -111,21 +111,17 @@ void TableGenerator::findComposeFile() } // check for the system provided compose files if (!found && cleanState()) { - QByteArray loc = locale().toUpper().toUtf8(); - QString table = readLocaleMappings(loc); - if (table.isEmpty()) - table = readLocaleMappings(readLocaleAliases(loc)); - + QString table = composeTableForLocale(); if (cleanState()) { if (table.isEmpty()) // no table mappings for the system's locale in the compose.dir m_state = UnsupportedLocale; else - found = processFile(systemComposeDir() + QLatin1String("/") + table); + found = processFile(systemComposeDir() + QLatin1Char('/') + table); #ifdef DEBUG_GENERATOR if (found) qDebug() << "Using Compose file from: " << - systemComposeDir() + QLatin1String("/") + table; + systemComposeDir() + QLatin1Char('/') + table; #endif } } @@ -137,6 +133,15 @@ void TableGenerator::findComposeFile() m_state = MissingComposeFile; } +QString TableGenerator::composeTableForLocale() +{ + QByteArray loc = locale().toUpper().toUtf8(); + QString table = readLocaleMappings(loc); + if (table.isEmpty()) + table = readLocaleMappings(readLocaleAliases(loc)); + return table; +} + bool TableGenerator::findSystemComposeDir() { bool found = false; @@ -311,7 +316,7 @@ void TableGenerator::parseIncludeInstruction(QString line) // expand substitutions if present line.replace(QLatin1String("%H"), QString(qgetenv("HOME"))); - line.replace(QLatin1String("%L"), locale()); + line.replace(QLatin1String("%L"), systemComposeDir() + QLatin1Char('/') + composeTableForLocale()); line.replace(QLatin1String("%S"), systemComposeDir()); processFile(line); |