summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGatis Paeglis <gatis.paeglis@digia.com>2014-03-04 16:27:23 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-06 12:21:14 +0100
commit9580f3484d35a9b2c805aa302b990f1b69671f7e (patch)
treeaffa10939013901ea6cdb699e8b72cba63c47a48
parent1f802afc49e10647e89e00da68feff73ea66a90f (diff)
Append additional compose file search paths
On FreeBSD Compose files are stored in different place than on Linux distributions, this patch adds new search paths. Change-Id: Ic1e745801a2f9a53d1af058be8a1dfaced5032a7 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
-rw-r--r--src/plugins/platforminputcontexts/compose/compose.pro2
-rw-r--r--src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp20
2 files changed, 14 insertions, 8 deletions
diff --git a/src/plugins/platforminputcontexts/compose/compose.pro b/src/plugins/platforminputcontexts/compose/compose.pro
index c206e99e57..546a0a2af7 100644
--- a/src/plugins/platforminputcontexts/compose/compose.pro
+++ b/src/plugins/platforminputcontexts/compose/compose.pro
@@ -8,7 +8,7 @@ QT += gui-private
LIBS += $$QMAKE_LIBS_XKBCOMMON
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_XKBCOMMON
-DEFINES += COMPOSE_X11_PREFIX='\\"$$QMAKE_X11_PREFIX\\"'
+DEFINES += X11_PREFIX='\\"$$QMAKE_X11_PREFIX\\"'
SOURCES += $$PWD/main.cpp \
$$PWD/qcomposeplatforminputcontext.cpp \
diff --git a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
index e2810c8448..ca61b0e495 100644
--- a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
+++ b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
@@ -73,13 +73,19 @@ TableGenerator::TableGenerator() : m_state(NoErrors),
void TableGenerator::initPossibleLocations()
{
- // To add an extra system path use the QTCOMPOSE environment variable
- if (qEnvironmentVariableIsSet("QTCOMPOSE")) {
- m_possibleLocations.append(QString(qgetenv("QTCOMPOSE")));
- }
-
- m_possibleLocations.append(QStringLiteral(COMPOSE_X11_PREFIX "/share/X11/locale"));
- m_possibleLocations.append(QStringLiteral(COMPOSE_X11_PREFIX "/lib/X11/locale"));
+ // Compose files come as a part of Xlib library. Xlib doesn't provide
+ // a mechanism how to retrieve the location of these files reliably, since it was
+ // never meant for external software to parse compose tables directly. Best we
+ // can do is to hardcode search paths. To add an extra system path use
+ // the QTCOMPOSE environment variable
+ if (qEnvironmentVariableIsSet("QTCOMPOSE"))
+ m_possibleLocations.append(QString::fromLocal8Bit(qgetenv("QTCOMPOSE")));
+ m_possibleLocations.append(QStringLiteral("/usr/share/X11/locale"));
+ m_possibleLocations.append(QStringLiteral("/usr/local/share/X11/locale"));
+ m_possibleLocations.append(QStringLiteral("/usr/lib/X11/locale"));
+ m_possibleLocations.append(QStringLiteral("/usr/local/lib/X11/locale"));
+ m_possibleLocations.append(QStringLiteral(X11_PREFIX "/share/X11/locale"));
+ m_possibleLocations.append(QStringLiteral(X11_PREFIX "/lib/X11/locale"));
}
void TableGenerator::findComposeFile()