From b4d3f9bd82afed69036015fbfe71526050e0effb Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Wed, 9 Dec 2015 12:36:10 +0100 Subject: Check for any existing file in XCOMPOSEFILE. Before this change, it was checked if the path ends with "Compose", which was an invalid assumption as the file can have any name (see [1]) This replaces the check with a check for any existing file (which wasn't checked before). [1] http://www.x.org/releases/X11R7.7/doc/man/man5/Compose.5.xhtml Done-with: Florian Bruhin Task-number: QTBUG-41557 Change-Id: If4fb58d4c1ed695f2d611236abfe97964b548678 Reviewed-by: Gatis Paeglis --- .../platforminputcontexts/compose/generator/qtablegenerator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp index ad9877eb25..4126456f90 100644 --- a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp +++ b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp @@ -263,11 +263,11 @@ QString TableGenerator::findComposeFile() { // check if XCOMPOSEFILE points to a Compose file if (qEnvironmentVariableIsSet("XCOMPOSEFILE")) { - QString path(qgetenv("XCOMPOSEFILE")); - if (path.endsWith(QLatin1String("Compose"))) + const QString path = QFile::decodeName(qgetenv("XCOMPOSEFILE")); + if (QFile::exists(path)) return path; else - qWarning("Qt Warning: XCOMPOSEFILE doesn't point to a valid Compose file"); + qWarning("$XCOMPOSEFILE doesn't point to an existing file"); } // check if user’s home directory has a file named .XCompose -- cgit v1.2.3