From 382b59a5db95c963b109297857d29ef802560216 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= <thorbjorn.lindeijer@nokia.com>
Date: Tue, 3 Aug 2010 11:04:40 +0200
Subject: [PATCH] Use Field instead of Label format for QML properties

In the default style this is currently the same, but in general it makes
more sense to highlight properties as fields.
---
 src/plugins/qmljseditor/qmljseditor.cpp      | 2 +-
 src/plugins/qmljseditor/qmljshighlighter.cpp | 7 +------
 src/plugins/qmljseditor/qmljshighlighter.h   | 4 +---
 3 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp
index 5fa3c18bf36..d49620fc9b9 100644
--- a/src/plugins/qmljseditor/qmljseditor.cpp
+++ b/src/plugins/qmljseditor/qmljseditor.cpp
@@ -1171,7 +1171,7 @@ void QmlJSTextEditor::setFontSettings(const TextEditor::FontSettings &fs)
                 << QLatin1String(TextEditor::Constants::C_STRING)
                 << QLatin1String(TextEditor::Constants::C_TYPE)
                 << QLatin1String(TextEditor::Constants::C_KEYWORD)
-                << QLatin1String(TextEditor::Constants::C_LABEL)
+                << QLatin1String(TextEditor::Constants::C_FIELD)
                 << QLatin1String(TextEditor::Constants::C_COMMENT)
                 << QLatin1String(TextEditor::Constants::C_VISUAL_WHITESPACE);
     }
diff --git a/src/plugins/qmljseditor/qmljshighlighter.cpp b/src/plugins/qmljseditor/qmljshighlighter.cpp
index 423598a4e6d..ab77bb73fe6 100644
--- a/src/plugins/qmljseditor/qmljshighlighter.cpp
+++ b/src/plugins/qmljseditor/qmljshighlighter.cpp
@@ -62,11 +62,6 @@ void Highlighter::setQmlEnabled(bool qmlEnabled)
     m_qmlEnabled = qmlEnabled;
 }
 
-QTextCharFormat Highlighter::labelTextCharFormat() const
-{
-    return m_formats[LabelFormat];
-}
-
 static bool checkStartOfBinding(const Token &token)
 {
     switch (token.kind) {
@@ -197,7 +192,7 @@ void Highlighter::highlightBlock(const QString &text)
                             // it's a binding.
                             for (int i = start; i <= index; ++i) {
                                 const Token &tok = tokens.at(i);
-                                setFormat(tok.offset, tok.length, m_formats[LabelFormat]);
+                                setFormat(tok.offset, tok.length, m_formats[FieldFormat]);
                             }
                             break;
                         } else {
diff --git a/src/plugins/qmljseditor/qmljshighlighter.h b/src/plugins/qmljseditor/qmljshighlighter.h
index 0be4f9bbf45..8d0f8d2077e 100644
--- a/src/plugins/qmljseditor/qmljshighlighter.h
+++ b/src/plugins/qmljseditor/qmljshighlighter.h
@@ -56,7 +56,7 @@ public:
         StringFormat,
         TypeFormat,
         KeywordFormat,
-        LabelFormat,
+        FieldFormat,
         CommentFormat,
         VisualWhitespace,
         NumFormats
@@ -66,8 +66,6 @@ public:
     void setQmlEnabled(bool duiEnabled);
     void setFormats(const QVector<QTextCharFormat> &formats);
 
-    QTextCharFormat labelTextCharFormat() const;
-
 protected:
     virtual void highlightBlock(const QString &text);
 
-- 
GitLab