diff options
author | Eike Ziller <eike.ziller@theqtcompany.com> | 2015-02-03 16:47:03 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@theqtcompany.com> | 2015-02-17 09:55:30 +0000 |
commit | a22dc36aaf612735d09a51d4fb5865fc64297d02 (patch) | |
tree | 56256db4682d68dd2c9960ec19df0271e22352dc /src/plugins/texteditor/highlighterutils.h | |
parent | 425811291dfd41782cc91f6c1293d41af7b0e4d8 (diff) | |
download | qt-creator-a22dc36aaf612735d09a51d4fb5865fc64297d02.tar.gz |
Generic highlighter: Fix matching the right definition
No longer uses artificial mime types for highlighting files that do not
specify a mime type. No longer registers mime types that are specified
but that Qt Creator does not know about.
Instead, try to match the mime type, and if that fails, or if the result
does not match the file name pattern, try to match file name patterns
instead.
This also fixes the potential problem that mime types were always only
added, never removed, even if the user removed definitions and triggered
a reparse.
Also fixes that a highlight definition in the fallback location could
overwrite a highlight definition in the preferred location, if it has a
higher priority setting.
Task-number: QTCREATORBUG-13912
Change-Id: I86ce10f4f4341f6add0d2b58a04f080501d0cbf4
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Diffstat (limited to 'src/plugins/texteditor/highlighterutils.h')
-rw-r--r-- | src/plugins/texteditor/highlighterutils.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/plugins/texteditor/highlighterutils.h b/src/plugins/texteditor/highlighterutils.h index b0e1b70b69..0d9a9b0942 100644 --- a/src/plugins/texteditor/highlighterutils.h +++ b/src/plugins/texteditor/highlighterutils.h @@ -43,12 +43,10 @@ namespace Core { class MimeType; } namespace TextEditor { class Highlighter; -class SyntaxHighlighter; void setMimeTypeForHighlighter(Highlighter *highlighter, const Core::MimeType &mimeType, + const QString &filePath, QString *foundDefinitionId = 0); -QString findDefinitionId(const Core::MimeType &mimeType, bool considerParents); -TEXTEDITOR_EXPORT SyntaxHighlighter *createGenericSyntaxHighlighter(const Core::MimeType &mimeType); } // namespace TextEditor |