summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforminputcontexts/compose/generator
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2015-12-09 12:36:10 +0100
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2015-12-09 11:47:22 +0000
commitb4d3f9bd82afed69036015fbfe71526050e0effb (patch)
tree5991d177821f9f11ebfd91da6bde61bbd3a090a0 /src/plugins/platforminputcontexts/compose/generator
parentb64c11f46490840629a72ebe78316342c9f6ff31 (diff)
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 <git@the-compiler.org> Task-number: QTBUG-41557 Change-Id: If4fb58d4c1ed695f2d611236abfe97964b548678 Reviewed-by: Gatis Paeglis <gatis.paeglis@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforminputcontexts/compose/generator')
-rw-r--r--src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp6
1 files 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