updated on Thu Jan 26 00:18:00 UTC 2012
[aur-mirror.git] / qtcreator-patched / add_pod_highlighting.patch
blob52ef650e92e0652ed7b8ac09dabbe3a62acdacb1
1 diff -Naurb ./src/qt-creator-2.3.1-src/src/libs/3rdparty/cplusplus/Token.h ./src_patched/qt-creator-2.4.0-rc-src/src/libs/3rdparty/cplusplus/Token.h
2 --- ./src/qt-creator-2.3.1-src/src/libs/3rdparty/cplusplus/Token.h 2011-09-21 10:31:14.000000000 +0400
3 +++ ./src_patched/qt-creator-2.4.0-rc-src/src/libs/3rdparty/cplusplus/Token.h 2011-11-16 20:25:28.400382335 +0400
4 @@ -103,11 +103,9 @@
5 T_FIRST_KEYWORD,
6 T_ASM = T_FIRST_KEYWORD,
7 T_AUTO,
8 - T_BOOL,
9 T_BREAK,
10 T_CASE,
11 T_CATCH,
12 - T_CHAR,
13 T_CLASS,
14 T_CONST,
15 T_CONST_CAST,
16 @@ -115,7 +113,6 @@
17 T_DEFAULT,
18 T_DELETE,
19 T_DO,
20 - T_DOUBLE,
21 T_DYNAMIC_CAST,
22 T_ELSE,
23 T_ENUM,
24 @@ -123,14 +120,11 @@
25 T_EXPORT,
26 T_EXTERN,
27 T_FALSE,
28 - T_FLOAT,
29 T_FOR,
30 T_FRIEND,
31 T_GOTO,
32 T_IF,
33 T_INLINE,
34 - T_INT,
35 - T_LONG,
36 T_MUTABLE,
37 T_NAMESPACE,
38 T_NEW,
39 @@ -141,8 +135,6 @@
40 T_REGISTER,
41 T_REINTERPRET_CAST,
42 T_RETURN,
43 - T_SHORT,
44 - T_SIGNED,
45 T_SIZEOF,
46 T_STATIC,
47 T_STATIC_CAST,
48 @@ -157,12 +149,9 @@
49 T_TYPEID,
50 T_TYPENAME,
51 T_UNION,
52 - T_UNSIGNED,
53 T_USING,
54 T_VIRTUAL,
55 - T_VOID,
56 T_VOLATILE,
57 - T_WCHAR_T,
58 T_WHILE,
60 T___ATTRIBUTE__,
61 @@ -222,6 +211,20 @@
62 T_Q_GADGET,
63 T_LAST_KEYWORD = T_Q_GADGET,
65 + T_FIRST_POD,
66 + T_BOOL = T_FIRST_POD,
67 + T_CHAR,
68 + T_DOUBLE,
69 + T_FLOAT,
70 + T_INT,
71 + T_LONG,
72 + T_SHORT,
73 + T_SIGNED,
74 + T_UNSIGNED,
75 + T_VOID,
76 + T_WCHAR_T,
77 + T_LAST_POD = T_WCHAR_T,
79 // aliases
80 T_OR = T_PIPE_PIPE,
81 T_AND = T_AMPER_AMPER,
82 @@ -287,6 +290,9 @@
83 inline bool isKeyword() const
84 { return f.kind >= T_FIRST_KEYWORD && f.kind < T_FIRST_QT_KEYWORD; }
86 + inline bool isPodType() const
87 + { return f.kind >= T_FIRST_POD && f.kind <= T_LAST_POD; }
89 inline bool isComment() const
90 { return f.kind == T_COMMENT || f.kind == T_DOXY_COMMENT ||
91 f.kind == T_CPP_COMMENT || f.kind == T_CPP_DOXY_COMMENT; }
92 diff -Naurb ./src/qt-creator-2.3.1-src/src/plugins/cppeditor/cppeditor.cpp ./src_patched/qt-creator-2.3.1-src/src/plugins/cppeditor/cppeditor.cpp
93 --- ./src/qt-creator-2.3.1-src/src/plugins/cppeditor/cppeditor.cpp 2011-09-21 10:31:14.000000000 +0400
94 +++ ./src_patched/qt-creator-2.4.0-rc-src/src/plugins/cppeditor/cppeditor.cpp 2011-11-16 21:37:11.576917776 +0400
95 @@ -2232,6 +2232,7 @@
96 if (categories.isEmpty()) {
97 categories << QLatin1String(TextEditor::Constants::C_NUMBER)
98 << QLatin1String(TextEditor::Constants::C_STRING)
99 + << QLatin1String(TextEditor::Constants::C_POD_TYPE)
100 << QLatin1String(TextEditor::Constants::C_TYPE)
101 << QLatin1String(TextEditor::Constants::C_KEYWORD)
102 << QLatin1String(TextEditor::Constants::C_OPERATOR)
103 diff -Naurb ./src/qt-creator-2.3.1-src/src/plugins/cppeditor/cppeditorenums.h ./src_patched/qt-creator-2.3.1-src/src/plugins/cppeditor/cppeditorenums.h
104 --- ./src/qt-creator-2.3.1-src/src/plugins/cppeditor/cppeditorenums.h 2011-09-21 10:31:14.000000000 +0400
105 +++ ./src_patched/qt-creator-2.4.0-rc-src/src/plugins/cppeditor/cppeditorenums.h 2011-11-16 20:25:28.393715669 +0400
106 @@ -44,6 +44,7 @@
107 enum CppFormats {
108 CppNumberFormat,
109 CppStringFormat,
110 + CppPodTypeFormat,
111 CppTypeFormat,
112 CppKeywordFormat,
113 CppOperatorFormat,
114 diff -Naurb ./src/qt-creator-2.3.1-src/src/plugins/cppeditor/cpphighlighter.cpp ./src_patched/qt-creator-2.3.1-src/src/plugins/cppeditor/cpphighlighter.cpp
115 --- ./src/qt-creator-2.3.1-src/src/plugins/cppeditor/cpphighlighter.cpp 2011-09-21 10:31:14.000000000 +0400
116 +++ ./src_patched/qt-creator-2.4.0-rc-src/src/plugins/cppeditor/cpphighlighter.cpp 2011-11-16 22:25:15.196829839 +0400
117 @@ -195,6 +195,9 @@
118 } else if (tk.isKeyword() || isQtKeyword(text.midRef(tk.begin(), tk.length())) || tk.isObjCAtKeyword())
119 setFormat(tk.begin(), tk.length(), m_formats[CppKeywordFormat]);
121 + else if (tk.isPodType())
122 + setFormat(tk.begin(), tk.length(), m_formats[CppPodTypeFormat]);
124 else if (tk.isOperator())
125 setFormat(tk.begin(), tk.length(), m_formats[CppOperatorFormat]);
127 diff -Naurb ./src/qt-creator-2.3.1-src/src/plugins/texteditor/texteditorconstants.h ./src_patched/qt-creator-2.3.1-src/src/plugins/texteditor/texteditorconstants.h
128 --- ./src/qt-creator-2.3.1-src/src/plugins/texteditor/texteditorconstants.h 2011-09-21 10:31:14.000000000 +0400
129 +++ ./src_patched/qt-creator-2.4.0-rc-src/src/plugins/texteditor/texteditorconstants.h 2011-11-16 21:37:11.580251109 +0400
130 @@ -115,6 +115,7 @@
132 const char * const C_NUMBER = "Number";
133 const char * const C_STRING = "String";
134 +const char * const C_POD_TYPE = "POD";
135 const char * const C_TYPE = "Type";
136 const char * const C_LOCAL = "Local";
137 const char * const C_FIELD = "Field";
138 diff -Naurb ./src/qt-creator-2.3.1-src/src/plugins/texteditor/texteditorsettings.cpp ./src_patched/qt-creator-2.3.1-src/src/plugins/texteditor/texteditorsettings.cpp
139 --- ./src/qt-creator-2.3.1-src/src/plugins/texteditor/texteditorsettings.cpp 2011-09-21 10:31:14.000000000 +0400
140 +++ ./src_patched/qt-creator-2.4.0-rc-src/src/plugins/texteditor/texteditorsettings.cpp 2011-11-16 22:24:37.580164320 +0400
141 @@ -135,6 +135,7 @@
142 // Standard categories
143 formatDescriptions.append(FormatDescription(QLatin1String(C_NUMBER), tr("Number"), Qt::darkBlue));
144 formatDescriptions.append(FormatDescription(QLatin1String(C_STRING), tr("String"), Qt::darkGreen));
145 + formatDescriptions.append(FormatDescription(QLatin1String(C_POD_TYPE), tr("POD Type"), Qt::darkYellow));
146 formatDescriptions.append(FormatDescription(QLatin1String(C_TYPE), tr("Type"), Qt::darkMagenta));
147 formatDescriptions.append(FormatDescription(QLatin1String(C_LOCAL), tr("Local")));
148 formatDescriptions.append(FormatDescription(QLatin1String(C_FIELD), tr("Field"), Qt::darkRed));
149 @@ -144,7 +145,10 @@
150 virtualMethodFormatDescriptor.format().setItalic(true);
151 formatDescriptions.append(virtualMethodFormatDescriptor);
153 - formatDescriptions.append(FormatDescription(QLatin1String(C_KEYWORD), tr("Keyword"), Qt::darkYellow));
154 + FormatDescription keywordFormatDescriptor(QLatin1String(C_KEYWORD), tr("Keyword"), Qt::black);
155 + keywordFormatDescriptor.format().setBold(true);
156 + formatDescriptions.append(keywordFormatDescriptor);
158 formatDescriptions.append(FormatDescription(QLatin1String(C_OPERATOR), tr("Operator")));
159 formatDescriptions.append(FormatDescription(QLatin1String(C_PREPROCESSOR), tr("Preprocessor"), Qt::darkBlue));
160 formatDescriptions.append(FormatDescription(QLatin1String(C_LABEL), tr("Label"), Qt::darkRed));