diff options
author | Leandro Melo <leandro.melo@nokia.com> | 2010-09-15 16:09:39 +0200 |
---|---|---|
committer | Leandro Melo <leandro.melo@nokia.com> | 2010-09-15 16:48:51 +0200 |
commit | fd78c4c9e4d905e31618d0f50dfe167e636cdfbf (patch) | |
tree | 3701f22c12010975ef754f365e375bff3e8df7d7 /src/plugins/texteditor/generichighlighter/highlightersettings.cpp | |
parent | e9bf08958f96550e036872975c3c321c63776143 (diff) | |
download | qt-creator-fd78c4c9e4d905e31618d0f50dfe167e636cdfbf.tar.gz |
Generic highlighter: Also look for Kate files using kde4-config.
Only kde-config (and the defined paths) was being considered previously.
Diffstat (limited to 'src/plugins/texteditor/generichighlighter/highlightersettings.cpp')
-rw-r--r-- | src/plugins/texteditor/generichighlighter/highlightersettings.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/plugins/texteditor/generichighlighter/highlightersettings.cpp b/src/plugins/texteditor/generichighlighter/highlightersettings.cpp index 1b41888a25..cf7f99d47c 100644 --- a/src/plugins/texteditor/generichighlighter/highlightersettings.cpp +++ b/src/plugins/texteditor/generichighlighter/highlightersettings.cpp @@ -66,15 +66,21 @@ QString findDefinitionsLocation() if (definitionsLocation.isEmpty()) { // Try kde-config. - QProcess process; - process.start(QLatin1String("kde-config"), QStringList(QLatin1String("--prefix"))); - if (process.waitForStarted(5000)) { - process.waitForFinished(5000); - QString output = QString::fromLocal8Bit(process.readAllStandardOutput()); - output.remove(QLatin1Char('\n')); - dir.setPath(output + kateSyntax); - if (dir.exists()) - definitionsLocation = dir.path(); + QStringList programs; + programs << QLatin1String("kde-config") << QLatin1String("kde4-config"); + foreach (const QString &program, programs) { + QProcess process; + process.start(program, QStringList(QLatin1String("--prefix"))); + if (process.waitForStarted(5000)) { + process.waitForFinished(5000); + QString output = QString::fromLocal8Bit(process.readAllStandardOutput()); + output.remove(QLatin1Char('\n')); + dir.setPath(output + kateSyntax); + if (dir.exists()) { + definitionsLocation = dir.path(); + break; + } + } } } #endif |