TextEditor: FilePathify Repository *highlightRepository()

Change-Id: I66ed44e199fa26b28e23497c2650224e6331baa7
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2021-06-29 17:57:49 +02:00
parent 0df21e8f1b
commit bce19b73c5

View File

@@ -62,9 +62,9 @@ KSyntaxHighlighting::Repository *highlightRepository()
if (!repository) {
repository = new KSyntaxHighlighting::Repository();
repository->addCustomSearchPath(TextEditorSettings::highlighterSettings().definitionFilesPath());
QDir dir(Core::ICore::resourcePath("generic-highlighter/syntax").toDir());
if (dir.exists() && dir.cdUp())
repository->addCustomSearchPath(dir.path());
const Utils::FilePath dir = Core::ICore::resourcePath("generic-highlighter/syntax");
if (dir.exists())
repository->addCustomSearchPath(dir.parentDir().path());
}
return repository;
}