Merge remote-tracking branch 'origin/4.4'
Conflicts: qtcreator.pri Change-Id: If5f4a9821a23ac0df81eb84b3980f9cf7ecd70ba
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 69 KiB |
BIN
doc/images/qtcreator-semanticerror-clang.png
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
doc/images/qtcreator-syntaxerror-clang.png
Normal file
After Width: | Height: | Size: 31 KiB |
@@ -187,11 +187,35 @@
|
|||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
In addition, you can run static checks on the QML and JavaScript code in
|
When using the Clang code model, errors and warnings are additionally marked
|
||||||
your project to find common problems.
|
with icons and annotated. If a \l{http://clang.llvm.org/diagnostics.html}
|
||||||
|
{Clang fix-it} is available, you can execute it by clicking the
|
||||||
|
\inlineimage refactormarker.png
|
||||||
|
icon and pressing \key Enter.
|
||||||
|
|
||||||
|
In the following figure, a semicolon is missing at the end of the
|
||||||
|
line.
|
||||||
|
|
||||||
|
\image qtcreator-syntaxerror-clang.png
|
||||||
|
|
||||||
|
In the following figure, the variable is not used.
|
||||||
|
|
||||||
|
\image qtcreator-semanticerror-clang.png
|
||||||
|
|
||||||
|
To specify the position where the annotations are displayed, select
|
||||||
|
\uicontrol Tools > \uicontrol Options > \uicontrol {Text Editor} >
|
||||||
|
\uicontrol Display > \uicontrol {Annotations next to lines}, and then
|
||||||
|
select whether to display the annotations directly next to the code,
|
||||||
|
aligned to the right of the code, or in the right margin.
|
||||||
|
|
||||||
|
If you hide the annotations by deselecting the check box, you can move the
|
||||||
|
mouse pointer over an icon to view them.
|
||||||
|
|
||||||
\section1 Checking JSON Data Structure
|
\section1 Checking JSON Data Structure
|
||||||
|
|
||||||
|
You can run static checks on the QML and JavaScript code in
|
||||||
|
your project to find common problems.
|
||||||
|
|
||||||
\QC validates instances of JSON entities against
|
\QC validates instances of JSON entities against
|
||||||
\l{http://tools.ietf.org/html/draft-zyp-json-schema-03}
|
\l{http://tools.ietf.org/html/draft-zyp-json-schema-03}
|
||||||
{A JSON Media Type for Describing the Structure and Meaning of JSON Documents}.
|
{A JSON Media Type for Describing the Structure and Meaning of JSON Documents}.
|
||||||
@@ -1956,6 +1980,9 @@
|
|||||||
|
|
||||||
\section1 Renaming Symbols
|
\section1 Renaming Symbols
|
||||||
|
|
||||||
|
You can rename symbols in all files in a project. When you rename a class,
|
||||||
|
you can also change filenames that match the class name.
|
||||||
|
|
||||||
To rename a specific symbol in a Qt project:
|
To rename a specific symbol in a Qt project:
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
@@ -1973,15 +2000,18 @@
|
|||||||
\image qtcreator-refactoring-replace.png
|
\image qtcreator-refactoring-replace.png
|
||||||
|
|
||||||
\li To replace all selected instances, enter the name of the new symbol
|
\li To replace all selected instances, enter the name of the new symbol
|
||||||
in the \uicontrol {Replace with} text box and click
|
in the \uicontrol {Replace with} text box.
|
||||||
\uicontrol Replace.
|
|
||||||
|
|
||||||
To omit an instance, uncheck the check-box next to the instance.
|
To omit an instance, uncheck the check-box next to the instance.
|
||||||
|
|
||||||
|
\li If the symbol is a class, select the \uicontrol {Rename files} check
|
||||||
|
box to also change the filenames that match the class name.
|
||||||
|
|
||||||
|
\li Select \uicontrol Replace.
|
||||||
|
|
||||||
\note This action replaces all selected instances of the symbol in
|
\note This action replaces all selected instances of the symbol in
|
||||||
all files listed in the \uicontrol {Search Results} pane. You cannot
|
all files listed in the \uicontrol {Search Results} pane. You cannot
|
||||||
undo this action.
|
undo this action.
|
||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\note Renaming local symbols does not open the \uicontrol {Search Results}
|
\note Renaming local symbols does not open the \uicontrol {Search Results}
|
||||||
|
@@ -17,6 +17,8 @@ Module {
|
|||||||
property string qtcreator_compat_version: ide_compat_version_major + '.'
|
property string qtcreator_compat_version: ide_compat_version_major + '.'
|
||||||
+ ide_compat_version_minor + '.' + ide_compat_version_release
|
+ ide_compat_version_minor + '.' + ide_compat_version_release
|
||||||
|
|
||||||
|
property string qtcreator_copyright_year: '2017'
|
||||||
|
|
||||||
property string libDirName: "lib"
|
property string libDirName: "lib"
|
||||||
property string ide_app_path: qbs.targetOS.contains("macos") ? "" : "bin"
|
property string ide_app_path: qbs.targetOS.contains("macos") ? "" : "bin"
|
||||||
property string ide_app_target: qbs.targetOS.contains("macos") ? "Qt Creator" : "qtcreator"
|
property string ide_app_target: qbs.targetOS.contains("macos") ? "Qt Creator" : "qtcreator"
|
||||||
|
@@ -5,6 +5,7 @@ QTCREATOR_VERSION = 4.4.82
|
|||||||
QTCREATOR_COMPAT_VERSION = 4.4.82
|
QTCREATOR_COMPAT_VERSION = 4.4.82
|
||||||
VERSION = $$QTCREATOR_VERSION
|
VERSION = $$QTCREATOR_VERSION
|
||||||
QTCREATOR_DISPLAY_VERSION = 4.5.0-beta1
|
QTCREATOR_DISPLAY_VERSION = 4.5.0-beta1
|
||||||
|
QTCREATOR_COPYRIGHT_YEAR = 2017
|
||||||
BINARY_ARTIFACTS_BRANCH = master
|
BINARY_ARTIFACTS_BRANCH = master
|
||||||
|
|
||||||
CONFIG += c++14
|
CONFIG += c++14
|
||||||
|
@@ -94,7 +94,7 @@ runCodeCompletion()
|
|||||||
if [ -n "${CINDEXTEST_EXEC}" ]; then
|
if [ -n "${CINDEXTEST_EXEC}" ]; then
|
||||||
command="${CINDEXTEST_EXEC} -code-completion-at=${FILE}:${LINE}:${COLUMN} ${FILE}"
|
command="${CINDEXTEST_EXEC} -code-completion-at=${FILE}:${LINE}:${COLUMN} ${FILE}"
|
||||||
else
|
else
|
||||||
command="${CLANG_EXEC} -cc1 -code-completion-at ${FILE}:${LINE}:${COLUMN} ${FILE}"
|
command="${CLANG_EXEC} -fsyntax-only -Xclang -code-completion-at -Xclang ${FILE}:${LINE}:${COLUMN} ${FILE}"
|
||||||
fi
|
fi
|
||||||
echo "Command: $command"
|
echo "Command: $command"
|
||||||
eval $command
|
eval $command
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
"trDescription": "Creates a C++ header and a source file for a new class that you can add to a C++ project.",
|
"trDescription": "Creates a C++ header and a source file for a new class that you can add to a C++ project.",
|
||||||
"trDisplayName": "C++ Class",
|
"trDisplayName": "C++ Class",
|
||||||
"trDisplayCategory": "C++",
|
"trDisplayCategory": "C++",
|
||||||
|
"iconText": "h/cpp",
|
||||||
"enabled": "%{JS: [ %{Plugins} ].indexOf('CppEditor') >= 0}",
|
"enabled": "%{JS: [ %{Plugins} ].indexOf('CppEditor') >= 0}",
|
||||||
|
|
||||||
"options":
|
"options":
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
"trDescription": "Creates new Python class file.",
|
"trDescription": "Creates new Python class file.",
|
||||||
"trDisplayName": "Python Class",
|
"trDisplayName": "Python Class",
|
||||||
"trDisplayCategory": "Python",
|
"trDisplayCategory": "Python",
|
||||||
|
"iconText": "py",
|
||||||
"enabled": "%{JS: [ %{Plugins} ].indexOf('PythonEditor') >= 0}",
|
"enabled": "%{JS: [ %{Plugins} ].indexOf('PythonEditor') >= 0}",
|
||||||
|
|
||||||
"options":
|
"options":
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
"trDescription": "Creates a Qt Quick Designer UI form along with a matching QML file for implementation purposes. You can add the form and file to an existing Qt Quick Project.",
|
"trDescription": "Creates a Qt Quick Designer UI form along with a matching QML file for implementation purposes. You can add the form and file to an existing Qt Quick Project.",
|
||||||
"trDisplayName": "QtQuick UI File",
|
"trDisplayName": "QtQuick UI File",
|
||||||
"trDisplayCategory": "Qt",
|
"trDisplayCategory": "Qt",
|
||||||
|
"iconText": "ui.qml",
|
||||||
"featuresRequired": [ "QtSupport.Wizards.FeatureQtQuick.UiFiles" ],
|
"featuresRequired": [ "QtSupport.Wizards.FeatureQtQuick.UiFiles" ],
|
||||||
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmlJSEditor') >= 0}",
|
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmlJSEditor') >= 0}",
|
||||||
|
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
"trDescription": "Creates a C++ header file that you can add to a C++ project.",
|
"trDescription": "Creates a C++ header file that you can add to a C++ project.",
|
||||||
"trDisplayName": "C++ Header File",
|
"trDisplayName": "C++ Header File",
|
||||||
"trDisplayCategory": "C++",
|
"trDisplayCategory": "C++",
|
||||||
|
"iconText": "h",
|
||||||
"enabled": "%{JS: [ %{Plugins} ].indexOf('CppEditor') >= 0}",
|
"enabled": "%{JS: [ %{Plugins} ].indexOf('CppEditor') >= 0}",
|
||||||
|
|
||||||
"options": { "key": "FileName", "value": "%{JS: Cpp.fileName('%{TargetPath}', '%{JS: Util.preferredSuffix('text/x-c++hdr')}')}" },
|
"options": { "key": "FileName", "value": "%{JS: Cpp.fileName('%{TargetPath}', '%{JS: Util.preferredSuffix('text/x-c++hdr')}')}" },
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
"trDescription": "Creates a C++ source file that you can add to a C++ project.",
|
"trDescription": "Creates a C++ source file that you can add to a C++ project.",
|
||||||
"trDisplayName": "C++ Source File",
|
"trDisplayName": "C++ Source File",
|
||||||
"trDisplayCategory": "C++",
|
"trDisplayCategory": "C++",
|
||||||
|
"iconText": "cpp",
|
||||||
"enabled": "%{JS: [ %{Plugins} ].indexOf('CppEditor') >= 0}",
|
"enabled": "%{JS: [ %{Plugins} ].indexOf('CppEditor') >= 0}",
|
||||||
|
|
||||||
"options": { "key": "FileName", "value": "%{JS: Cpp.fileName('%{TargetPath}', '%{JS: Util.preferredSuffix('text/x-c++src')}')}" },
|
"options": { "key": "FileName", "value": "%{JS: Cpp.fileName('%{TargetPath}', '%{JS: Util.preferredSuffix('text/x-c++src')}')}" },
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
"trDescription": "Creates a Qt Designer form that you can add to a Qt Widget Project. This is useful if you already have an existing class for the UI business logic.",
|
"trDescription": "Creates a Qt Designer form that you can add to a Qt Widget Project. This is useful if you already have an existing class for the UI business logic.",
|
||||||
"trDisplayName": "Qt Designer Form",
|
"trDisplayName": "Qt Designer Form",
|
||||||
"trDisplayCategory": "Qt",
|
"trDisplayCategory": "Qt",
|
||||||
|
"iconText": "ui",
|
||||||
"enabled": "%{JS: [ %{Plugins} ].indexOf('Designer') >= 0}",
|
"enabled": "%{JS: [ %{Plugins} ].indexOf('Designer') >= 0}",
|
||||||
|
|
||||||
"options": [
|
"options": [
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
"trDescription": "Creates a fragment shader in the Desktop OpenGL Shading Language (GLSL). Fragment shaders generate the final pixel colors for triangles, points and lines rendered with OpenGL.",
|
"trDescription": "Creates a fragment shader in the Desktop OpenGL Shading Language (GLSL). Fragment shaders generate the final pixel colors for triangles, points and lines rendered with OpenGL.",
|
||||||
"trDisplayName": "Fragment Shader (Desktop OpenGL)",
|
"trDisplayName": "Fragment Shader (Desktop OpenGL)",
|
||||||
"trDisplayCategory": "GLSL",
|
"trDisplayCategory": "GLSL",
|
||||||
|
"iconText": "frag",
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
"enabled": "%{JS: [ %{Plugins} ].indexOf('GLSLEditor') >= 0}",
|
"enabled": "%{JS: [ %{Plugins} ].indexOf('GLSLEditor') >= 0}",
|
||||||
|
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
"trDescription": "Creates a vertex shader in the Desktop OpenGL Shading Language (GLSL). Vertex shaders transform the positions, normals and texture coordinates of triangles, points and lines rendered with OpenGL.",
|
"trDescription": "Creates a vertex shader in the Desktop OpenGL Shading Language (GLSL). Vertex shaders transform the positions, normals and texture coordinates of triangles, points and lines rendered with OpenGL.",
|
||||||
"trDisplayName": "Vertex Shader (Desktop OpenGL)",
|
"trDisplayName": "Vertex Shader (Desktop OpenGL)",
|
||||||
"trDisplayCategory": "GLSL",
|
"trDisplayCategory": "GLSL",
|
||||||
|
"iconText": "vert",
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
"enabled": "%{JS: [ %{Plugins} ].indexOf('GLSLEditor') >= 0}",
|
"enabled": "%{JS: [ %{Plugins} ].indexOf('GLSLEditor') >= 0}",
|
||||||
|
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
"trDescription": "Creates a fragment shader in the OpenGL/ES 2.0 Shading Language (GLSL/ES). Fragment shaders generate the final pixel colors for triangles, points and lines rendered with OpenGL.",
|
"trDescription": "Creates a fragment shader in the OpenGL/ES 2.0 Shading Language (GLSL/ES). Fragment shaders generate the final pixel colors for triangles, points and lines rendered with OpenGL.",
|
||||||
"trDisplayName": "Fragment Shader (OpenGL/ES 2.0)",
|
"trDisplayName": "Fragment Shader (OpenGL/ES 2.0)",
|
||||||
"trDisplayCategory": "GLSL",
|
"trDisplayCategory": "GLSL",
|
||||||
|
"iconText": "fsh",
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
"enabled": "%{JS: [ %{Plugins} ].indexOf('GLSLEditor') >= 0}",
|
"enabled": "%{JS: [ %{Plugins} ].indexOf('GLSLEditor') >= 0}",
|
||||||
|
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
"trDescription": "Creates a vertex shader in the OpenGL/ES 2.0 Shading Language (GLSL/ES). Vertex shaders transform the positions, normals and texture coordinates of triangles, points and lines rendered with OpenGL.",
|
"trDescription": "Creates a vertex shader in the OpenGL/ES 2.0 Shading Language (GLSL/ES). Vertex shaders transform the positions, normals and texture coordinates of triangles, points and lines rendered with OpenGL.",
|
||||||
"trDisplayName": "Vertex Shader (OpenGL/ES 2.0)",
|
"trDisplayName": "Vertex Shader (OpenGL/ES 2.0)",
|
||||||
"trDisplayCategory": "GLSL",
|
"trDisplayCategory": "GLSL",
|
||||||
|
"iconText": "vsh",
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
"enabled": "%{JS: [ %{Plugins} ].indexOf('GLSLEditor') >= 0}",
|
"enabled": "%{JS: [ %{Plugins} ].indexOf('GLSLEditor') >= 0}",
|
||||||
|
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
"trDescription": "Creates a Java file with boilerplate code.",
|
"trDescription": "Creates a Java file with boilerplate code.",
|
||||||
"trDisplayName": "Java File",
|
"trDisplayName": "Java File",
|
||||||
"trDisplayCategory": "Java",
|
"trDisplayCategory": "Java",
|
||||||
|
"iconText": "java",
|
||||||
"enabled": "%{JS: [ %{Plugins} ].indexOf('Android') >= 0}",
|
"enabled": "%{JS: [ %{Plugins} ].indexOf('Android') >= 0}",
|
||||||
|
|
||||||
"options": [ { "key": "ClassName", "value": "%{JS: '%{FileName}'.charAt(0).toUpperCase() + '%{FileName}'.substr(1)}" } ],
|
"options": [ { "key": "ClassName", "value": "%{JS: '%{FileName}'.charAt(0).toUpperCase() + '%{FileName}'.substr(1)}" } ],
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
"trDescription": "Creates a JavaScript file.",
|
"trDescription": "Creates a JavaScript file.",
|
||||||
"trDisplayName": "JS File",
|
"trDisplayName": "JS File",
|
||||||
"trDisplayCategory": "Qt",
|
"trDisplayCategory": "Qt",
|
||||||
|
"iconText": "js",
|
||||||
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmlJSEditor') >= 0}",
|
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmlJSEditor') >= 0}",
|
||||||
|
|
||||||
"pages" :
|
"pages" :
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
"trDescription": "Creates a new empty model with an empty diagram.",
|
"trDescription": "Creates a new empty model with an empty diagram.",
|
||||||
"trDisplayName": "Model",
|
"trDisplayName": "Model",
|
||||||
"trDisplayCategory": "Modeling",
|
"trDisplayCategory": "Modeling",
|
||||||
|
"iconText": "qmodel",
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
"enabled": "%{JS: [ %{Plugins} ].indexOf('ModelEditor') >= 0}",
|
"enabled": "%{JS: [ %{Plugins} ].indexOf('ModelEditor') >= 0}",
|
||||||
|
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
"trDescription": "Creates an empty Python script file using UTF-8 charset.",
|
"trDescription": "Creates an empty Python script file using UTF-8 charset.",
|
||||||
"trDisplayName": "Python File",
|
"trDisplayName": "Python File",
|
||||||
"trDisplayCategory": "Python",
|
"trDisplayCategory": "Python",
|
||||||
|
"iconText": "py",
|
||||||
"enabled": "%{JS: [ %{Plugins} ].indexOf('PythonEditor') >= 0}",
|
"enabled": "%{JS: [ %{Plugins} ].indexOf('PythonEditor') >= 0}",
|
||||||
|
|
||||||
"pages" :
|
"pages" :
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
"trDescription": "Creates a Qt Resource file (.qrc).",
|
"trDescription": "Creates a Qt Resource file (.qrc).",
|
||||||
"trDisplayName": "Qt Resource File",
|
"trDisplayName": "Qt Resource File",
|
||||||
"trDisplayCategory": "Qt",
|
"trDisplayCategory": "Qt",
|
||||||
|
"iconText": "qrc",
|
||||||
"enabled": "%{JS: [ %{Plugins} ].indexOf('ResourceEditor') >= 0}",
|
"enabled": "%{JS: [ %{Plugins} ].indexOf('ResourceEditor') >= 0}",
|
||||||
|
|
||||||
"pages" :
|
"pages" :
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
"trDescription": "Creates a QML file with boilerplate code, starting with \"import QtQuick 2.0\".",
|
"trDescription": "Creates a QML file with boilerplate code, starting with \"import QtQuick 2.0\".",
|
||||||
"trDisplayName": "QML File (Qt Quick 2)",
|
"trDisplayName": "QML File (Qt Quick 2)",
|
||||||
"trDisplayCategory": "Qt",
|
"trDisplayCategory": "Qt",
|
||||||
|
"iconText": "qml",
|
||||||
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmlJSEditor') >= 0}",
|
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmlJSEditor') >= 0}",
|
||||||
|
|
||||||
"pages" :
|
"pages" :
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
"trDescription": "Creates a new empty state chart.",
|
"trDescription": "Creates a new empty state chart.",
|
||||||
"trDisplayName": "State Chart",
|
"trDisplayName": "State Chart",
|
||||||
"trDisplayCategory": "Modeling",
|
"trDisplayCategory": "Modeling",
|
||||||
|
"iconText": "scxml",
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
"enabled": "%{JS: [ %{Plugins} ].indexOf('QtSupport') >= 0}",
|
"enabled": "%{JS: [ %{Plugins} ].indexOf('QtSupport') >= 0}",
|
||||||
|
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
"trDescription": "Creates an empty file.",
|
"trDescription": "Creates an empty file.",
|
||||||
"trDisplayName": "Empty File",
|
"trDisplayName": "Empty File",
|
||||||
"trDisplayCategory": "General",
|
"trDisplayCategory": "General",
|
||||||
|
"iconText": "txt",
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
"enabled": "%{JS: [ %{Plugins} ].indexOf('TextEditor') >= 0}",
|
"enabled": "%{JS: [ %{Plugins} ].indexOf('TextEditor') >= 0}",
|
||||||
|
|
||||||
|
@@ -20,6 +20,12 @@ QT_BREAKPAD_ROOT_PATH = $$(QT_BREAKPAD_ROOT_PATH)
|
|||||||
include($$QT_BREAKPAD_ROOT_PATH/qtbreakpad.pri)
|
include($$QT_BREAKPAD_ROOT_PATH/qtbreakpad.pri)
|
||||||
}
|
}
|
||||||
win32 {
|
win32 {
|
||||||
|
# We need the version in two separate formats for the .rc file
|
||||||
|
# RC_VERSION=4,3,82,0 (quadruple)
|
||||||
|
# RC_VERSION_STRING="4.4.0-beta1" (free text)
|
||||||
|
DEFINES += RC_VERSION=$$replace(QTCREATOR_VERSION, "\\.", ","),0 \
|
||||||
|
RC_VERSION_STRING=\\\"$${QTCREATOR_DISPLAY_VERSION}\\\" \
|
||||||
|
RC_COPYRIGHT='"\\\"2008-$${QTCREATOR_COPYRIGHT_YEAR} The Qt Company Ltd\\\""'
|
||||||
RC_FILE = qtcreator.rc
|
RC_FILE = qtcreator.rc
|
||||||
} else:macx {
|
} else:macx {
|
||||||
LIBS += -framework CoreFoundation
|
LIBS += -framework CoreFoundation
|
||||||
|
@@ -41,7 +41,6 @@ QtcProduct {
|
|||||||
"Info.plist",
|
"Info.plist",
|
||||||
"main.cpp",
|
"main.cpp",
|
||||||
"qtcreator.xcassets",
|
"qtcreator.xcassets",
|
||||||
"qtcreator.rc",
|
|
||||||
"../shared/qtsingleapplication/qtsingleapplication.h",
|
"../shared/qtsingleapplication/qtsingleapplication.h",
|
||||||
"../shared/qtsingleapplication/qtsingleapplication.cpp",
|
"../shared/qtsingleapplication/qtsingleapplication.cpp",
|
||||||
"../shared/qtsingleapplication/qtlocalpeer.h",
|
"../shared/qtsingleapplication/qtlocalpeer.h",
|
||||||
@@ -51,6 +50,16 @@ QtcProduct {
|
|||||||
"../tools/qtcreatorcrashhandler/crashhandlersetup.h"
|
"../tools/qtcreatorcrashhandler/crashhandlersetup.h"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Group {
|
||||||
|
// We need the version in two separate formats for the .rc file
|
||||||
|
// RC_VERSION=4,3,82,0 (quadruple)
|
||||||
|
// RC_VERSION_STRING="4.4.0-beta1" (free text)
|
||||||
|
cpp.defines: outer.concat(["RC_VERSION=" + qtc.qtcreator_version.replace(/\./g, ",") + ",0",
|
||||||
|
"RC_VERSION_STRING=\"" + qtc.qtcreator_display_version + "\"",
|
||||||
|
"RC_COPYRIGHT=\"2008-" + qtc.qtcreator_copyright_year + " The Qt Company Ltd\""])
|
||||||
|
files: "qtcreator.rc"
|
||||||
|
}
|
||||||
|
|
||||||
Group {
|
Group {
|
||||||
name: "qtcreator.sh"
|
name: "qtcreator.sh"
|
||||||
condition: qbs.targetOS.contains("unix") && !qbs.targetOS.contains("macos")
|
condition: qbs.targetOS.contains("unix") && !qbs.targetOS.contains("macos")
|
||||||
|
@@ -42,7 +42,7 @@ namespace Constants {
|
|||||||
const char * const IDE_VERSION_LONG = IDE_VERSION_STR;
|
const char * const IDE_VERSION_LONG = IDE_VERSION_STR;
|
||||||
const char * const IDE_VERSION_DISPLAY = STRINGIFY(IDE_VERSION_DISPLAY_DEF);
|
const char * const IDE_VERSION_DISPLAY = STRINGIFY(IDE_VERSION_DISPLAY_DEF);
|
||||||
const char * const IDE_AUTHOR = \"The Qt Company Ltd\";
|
const char * const IDE_AUTHOR = \"The Qt Company Ltd\";
|
||||||
const char * const IDE_YEAR = \"2017\";
|
const char * const IDE_YEAR = \"$${QTCREATOR_COPYRIGHT_YEAR}\";
|
||||||
|
|
||||||
#ifdef IDE_REVISION
|
#ifdef IDE_REVISION
|
||||||
const char * const IDE_REVISION_STR = STRINGIFY(IDE_REVISION);
|
const char * const IDE_REVISION_STR = STRINGIFY(IDE_REVISION);
|
||||||
|
@@ -42,6 +42,8 @@ Product {
|
|||||||
+ product.moduleProperty("qtc", "ide_version_minor") + "\n");
|
+ product.moduleProperty("qtc", "ide_version_minor") + "\n");
|
||||||
content = content.replace(/(\n#define IDE_VERSION_RELEASE) .+\n/, "$1 "
|
content = content.replace(/(\n#define IDE_VERSION_RELEASE) .+\n/, "$1 "
|
||||||
+ product.moduleProperty("qtc", "ide_version_release") + "\n");
|
+ product.moduleProperty("qtc", "ide_version_release") + "\n");
|
||||||
|
content = content.replace(/(\n#define IDE_COPYRIGHT_YEAR) .+\n/, "$1 "
|
||||||
|
+ product.moduleProperty("qtc", "qtcreator_copyright_year") + "\n");
|
||||||
file = new TextFile(output.filePath, TextFile.WriteOnly);
|
file = new TextFile(output.filePath, TextFile.WriteOnly);
|
||||||
file.truncate();
|
file.truncate();
|
||||||
file.write(content);
|
file.write(content);
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
#include <windows.h>
|
||||||
|
|
||||||
IDI_ICON1 ICON DISCARDABLE "qtcreator.ico"
|
IDI_ICON1 ICON DISCARDABLE "qtcreator.ico"
|
||||||
IDI_ICON2 ICON DISCARDABLE "winicons/c.ico"
|
IDI_ICON2 ICON DISCARDABLE "winicons/c.ico"
|
||||||
IDI_ICON3 ICON DISCARDABLE "winicons/cpp.ico"
|
IDI_ICON3 ICON DISCARDABLE "winicons/cpp.ico"
|
||||||
@@ -6,3 +8,25 @@ IDI_ICON5 ICON DISCARDABLE "winicons/ui.ico"
|
|||||||
IDI_ICON6 ICON DISCARDABLE "winicons/pro.ico"
|
IDI_ICON6 ICON DISCARDABLE "winicons/pro.ico"
|
||||||
IDI_ICON7 ICON DISCARDABLE "winicons/pri.ico"
|
IDI_ICON7 ICON DISCARDABLE "winicons/pri.ico"
|
||||||
IDI_ICON8 ICON DISCARDABLE "winicons/qml.ico"
|
IDI_ICON8 ICON DISCARDABLE "winicons/qml.ico"
|
||||||
|
|
||||||
|
VS_VERSION_INFO VERSIONINFO
|
||||||
|
FILEVERSION RC_VERSION
|
||||||
|
PRODUCTVERSION RC_VERSION
|
||||||
|
{
|
||||||
|
BLOCK "StringFileInfo"
|
||||||
|
{
|
||||||
|
// U.S. English - Windows, Multilingual
|
||||||
|
BLOCK "040904E4"
|
||||||
|
{
|
||||||
|
VALUE "FileDescription", "Qt Creator"
|
||||||
|
VALUE "FileVersion", RC_VERSION_STRING
|
||||||
|
VALUE "ProductName", "Qt Creator"
|
||||||
|
VALUE "ProductVersion", RC_VERSION_STRING
|
||||||
|
VALUE "LegalCopyright", RC_COPYRIGHT
|
||||||
|
}
|
||||||
|
}
|
||||||
|
BLOCK "VarFileInfo"
|
||||||
|
{
|
||||||
|
VALUE "Translation", 0x409, 1252 // 1252 = 0x04E4
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -8,163 +8,164 @@ QT += network
|
|||||||
|
|
||||||
INCLUDEPATH += $$PWD
|
INCLUDEPATH += $$PWD
|
||||||
|
|
||||||
SOURCES += $$PWD/clangcodemodelserverinterface.cpp \
|
SOURCES += \
|
||||||
$$PWD/clangcodemodelserverproxy.cpp \
|
$$PWD/cancelmessage.cpp \
|
||||||
$$PWD/clangcodemodelclientinterface.cpp \
|
|
||||||
$$PWD/cmbendmessage.cpp \
|
|
||||||
$$PWD/cmbalivemessage.cpp \
|
|
||||||
$$PWD/clangcodemodelclientproxy.cpp \
|
|
||||||
$$PWD/writemessageblock.cpp \
|
|
||||||
$$PWD/readmessageblock.cpp \
|
|
||||||
$$PWD/ipcinterface.cpp \
|
|
||||||
$$PWD/connectionserver.cpp \
|
|
||||||
$$PWD/connectionclient.cpp \
|
|
||||||
$$PWD/cmbechomessage.cpp \
|
|
||||||
$$PWD/cmbregistertranslationunitsforeditormessage.cpp \
|
|
||||||
$$PWD/filecontainer.cpp \
|
|
||||||
$$PWD/cmbunregistertranslationunitsforeditormessage.cpp \
|
|
||||||
$$PWD/cmbcompletecodemessage.cpp \
|
|
||||||
$$PWD/cmbcodecompletedmessage.cpp \
|
|
||||||
$$PWD/codecompletion.cpp \
|
|
||||||
$$PWD/cmbregisterprojectsforeditormessage.cpp \
|
|
||||||
$$PWD/cmbunregisterprojectsforeditormessage.cpp \
|
|
||||||
$$PWD/translationunitdoesnotexistmessage.cpp \
|
|
||||||
$$PWD/codecompletionchunk.cpp \
|
|
||||||
$$PWD/projectpartcontainer.cpp \
|
|
||||||
$$PWD/projectpartsdonotexistmessage.cpp \
|
|
||||||
$$PWD/lineprefixer.cpp \
|
|
||||||
$$PWD/clangbackendipcdebugutils.cpp \
|
$$PWD/clangbackendipcdebugutils.cpp \
|
||||||
$$PWD/diagnosticcontainer.cpp \
|
$$PWD/clangcodemodelclientinterface.cpp \
|
||||||
$$PWD/sourcerangecontainer.cpp \
|
$$PWD/clangcodemodelclientproxy.cpp \
|
||||||
$$PWD/sourcelocationcontainer.cpp \
|
|
||||||
$$PWD/fixitcontainer.cpp \
|
|
||||||
$$PWD/requestdocumentannotations.cpp \
|
|
||||||
$$PWD/requestreferencesmessage.cpp \
|
|
||||||
$$PWD/registerunsavedfilesforeditormessage.cpp \
|
|
||||||
$$PWD/unregisterunsavedfilesforeditormessage.cpp \
|
|
||||||
$$PWD/updatetranslationunitsforeditormessage.cpp \
|
|
||||||
$$PWD/updatevisibletranslationunitsmessage.cpp \
|
|
||||||
$$PWD/highlightingmarkcontainer.cpp \
|
|
||||||
$$PWD/refactoringclientinterface.cpp \
|
|
||||||
$$PWD/messageenvelop.cpp \
|
|
||||||
$$PWD/refactoringserverinterface.cpp \
|
|
||||||
$$PWD/refactoringserverproxy.cpp \
|
|
||||||
$$PWD/ipcclientinterface.cpp \
|
|
||||||
$$PWD/ipcserverinterface.cpp \
|
|
||||||
$$PWD/clangcodemodelconnectionclient.cpp \
|
$$PWD/clangcodemodelconnectionclient.cpp \
|
||||||
|
$$PWD/clangcodemodelserverinterface.cpp \
|
||||||
|
$$PWD/clangcodemodelserverproxy.cpp \
|
||||||
|
$$PWD/cmbalivemessage.cpp \
|
||||||
|
$$PWD/cmbcodecompletedmessage.cpp \
|
||||||
|
$$PWD/cmbcompletecodemessage.cpp \
|
||||||
|
$$PWD/cmbechomessage.cpp \
|
||||||
|
$$PWD/cmbendmessage.cpp \
|
||||||
|
$$PWD/cmbregisterprojectsforeditormessage.cpp \
|
||||||
|
$$PWD/cmbregistertranslationunitsforeditormessage.cpp \
|
||||||
|
$$PWD/cmbunregisterprojectsforeditormessage.cpp \
|
||||||
|
$$PWD/cmbunregistertranslationunitsforeditormessage.cpp \
|
||||||
|
$$PWD/codecompletionchunk.cpp \
|
||||||
|
$$PWD/codecompletion.cpp \
|
||||||
|
$$PWD/connectionclient.cpp \
|
||||||
|
$$PWD/connectionserver.cpp \
|
||||||
|
$$PWD/diagnosticcontainer.cpp \
|
||||||
$$PWD/documentannotationschangedmessage.cpp \
|
$$PWD/documentannotationschangedmessage.cpp \
|
||||||
$$PWD/referencesmessage.cpp \
|
|
||||||
$$PWD/refactoringclientproxy.cpp \
|
|
||||||
$$PWD/sourcelocationscontainer.cpp \
|
|
||||||
$$PWD/sourcelocationcontainerv2.cpp \
|
|
||||||
$$PWD/sourcelocationsforrenamingmessage.cpp \
|
|
||||||
$$PWD/requestsourcelocationforrenamingmessage.cpp \
|
|
||||||
$$PWD/filepath.cpp \
|
|
||||||
$$PWD/sourcerangescontainer.cpp \
|
|
||||||
$$PWD/sourcefilepathcontainerbase.cpp \
|
|
||||||
$$PWD/sourcerangecontainerv2.cpp \
|
|
||||||
$$PWD/dynamicastmatcherdiagnosticcontainer.cpp \
|
$$PWD/dynamicastmatcherdiagnosticcontainer.cpp \
|
||||||
$$PWD/dynamicastmatcherdiagnosticcontextcontainer.cpp \
|
$$PWD/dynamicastmatcherdiagnosticcontextcontainer.cpp \
|
||||||
$$PWD/dynamicastmatcherdiagnosticmessagecontainer.cpp \
|
$$PWD/dynamicastmatcherdiagnosticmessagecontainer.cpp \
|
||||||
$$PWD/requestsourcerangesanddiagnosticsforquerymessage.cpp \
|
$$PWD/filecontainer.cpp \
|
||||||
$$PWD/sourcerangesanddiagnosticsforquerymessage.cpp \
|
|
||||||
$$PWD/sourcerangewithtextcontainer.cpp \
|
|
||||||
$$PWD/filecontainerv2.cpp \
|
$$PWD/filecontainerv2.cpp \
|
||||||
$$PWD/cancelmessage.cpp \
|
$$PWD/filepath.cpp \
|
||||||
|
$$PWD/fixitcontainer.cpp \
|
||||||
|
$$PWD/highlightingmarkcontainer.cpp \
|
||||||
|
$$PWD/ipcclientinterface.cpp \
|
||||||
|
$$PWD/ipcinterface.cpp \
|
||||||
|
$$PWD/ipcserverinterface.cpp \
|
||||||
|
$$PWD/lineprefixer.cpp \
|
||||||
|
$$PWD/messageenvelop.cpp \
|
||||||
$$PWD/pchmanagerclientinterface.cpp \
|
$$PWD/pchmanagerclientinterface.cpp \
|
||||||
$$PWD/pchmanagerserverinterface.cpp \
|
|
||||||
$$PWD/projectpartcontainerv2.cpp \
|
|
||||||
$$PWD/updatepchprojectpartsmessage.cpp \
|
|
||||||
$$PWD/pchmanagerserverproxy.cpp \
|
|
||||||
$$PWD/pchmanagerclientproxy.cpp \
|
$$PWD/pchmanagerclientproxy.cpp \
|
||||||
$$PWD/projectpartpch.cpp \
|
$$PWD/pchmanagerserverinterface.cpp \
|
||||||
|
$$PWD/pchmanagerserverproxy.cpp \
|
||||||
$$PWD/precompiledheadersupdatedmessage.cpp \
|
$$PWD/precompiledheadersupdatedmessage.cpp \
|
||||||
|
$$PWD/projectpartcontainer.cpp \
|
||||||
|
$$PWD/projectpartcontainerv2.cpp \
|
||||||
|
$$PWD/projectpartpch.cpp \
|
||||||
|
$$PWD/projectpartsdonotexistmessage.cpp \
|
||||||
|
$$PWD/readmessageblock.cpp \
|
||||||
|
$$PWD/refactoringclientinterface.cpp \
|
||||||
|
$$PWD/refactoringclientproxy.cpp \
|
||||||
|
$$PWD/refactoringserverinterface.cpp \
|
||||||
|
$$PWD/refactoringserverproxy.cpp \
|
||||||
|
$$PWD/referencesmessage.cpp \
|
||||||
|
$$PWD/registerunsavedfilesforeditormessage.cpp \
|
||||||
$$PWD/removepchprojectpartsmessage.cpp \
|
$$PWD/removepchprojectpartsmessage.cpp \
|
||||||
|
$$PWD/requestdocumentannotations.cpp \
|
||||||
|
$$PWD/requestreferencesmessage.cpp \
|
||||||
|
$$PWD/requestsourcelocationforrenamingmessage.cpp \
|
||||||
|
$$PWD/requestsourcerangesanddiagnosticsforquerymessage.cpp \
|
||||||
|
$$PWD/requestsourcerangesforquerymessage.cpp \
|
||||||
|
$$PWD/sourcefilepathcontainerbase.cpp \
|
||||||
|
$$PWD/sourcelocationcontainer.cpp \
|
||||||
|
$$PWD/sourcelocationcontainerv2.cpp \
|
||||||
|
$$PWD/sourcelocationscontainer.cpp \
|
||||||
|
$$PWD/sourcelocationsforrenamingmessage.cpp \
|
||||||
|
$$PWD/sourcerangecontainer.cpp \
|
||||||
|
$$PWD/sourcerangecontainerv2.cpp \
|
||||||
|
$$PWD/sourcerangesanddiagnosticsforquerymessage.cpp \
|
||||||
|
$$PWD/sourcerangescontainer.cpp \
|
||||||
$$PWD/sourcerangesforquerymessage.cpp \
|
$$PWD/sourcerangesforquerymessage.cpp \
|
||||||
$$PWD/requestsourcerangesforquerymessage.cpp
|
$$PWD/sourcerangewithtextcontainer.cpp \
|
||||||
|
$$PWD/translationunitdoesnotexistmessage.cpp \
|
||||||
|
$$PWD/unregisterunsavedfilesforeditormessage.cpp \
|
||||||
|
$$PWD/updatepchprojectpartsmessage.cpp \
|
||||||
|
$$PWD/updatetranslationunitsforeditormessage.cpp \
|
||||||
|
$$PWD/updatevisibletranslationunitsmessage.cpp \
|
||||||
|
$$PWD/writemessageblock.cpp \
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
$$PWD/clangcodemodelserverinterface.h \
|
$$PWD/cancelmessage.h \
|
||||||
$$PWD/clangcodemodelserverproxy.h \
|
|
||||||
$$PWD/clangcodemodelclientinterface.h \
|
|
||||||
$$PWD/cmbendmessage.h \
|
|
||||||
$$PWD/cmbalivemessage.h \
|
|
||||||
$$PWD/clangcodemodelclientproxy.h \
|
|
||||||
$$PWD/writemessageblock.h \
|
|
||||||
$$PWD/readmessageblock.h \
|
|
||||||
$$PWD/ipcinterface.h \
|
|
||||||
$$PWD/connectionserver.h \
|
|
||||||
$$PWD/connectionclient.h \
|
|
||||||
$$PWD/cmbechomessage.h \
|
|
||||||
$$PWD/cmbregistertranslationunitsforeditormessage.h \
|
|
||||||
$$PWD/filecontainer.h \
|
|
||||||
$$PWD/cmbunregistertranslationunitsforeditormessage.h \
|
|
||||||
$$PWD/cmbcompletecodemessage.h \
|
|
||||||
$$PWD/cmbcodecompletedmessage.h \
|
|
||||||
$$PWD/codecompletion.h \
|
|
||||||
$$PWD/cmbregisterprojectsforeditormessage.h \
|
|
||||||
$$PWD/cmbunregisterprojectsforeditormessage.h \
|
|
||||||
$$PWD/translationunitdoesnotexistmessage.h \
|
|
||||||
$$PWD/codecompletionchunk.h \
|
|
||||||
$$PWD/projectpartcontainer.h \
|
|
||||||
$$PWD/projectpartsdonotexistmessage.h \
|
|
||||||
$$PWD/clangbackendipc_global.h \
|
|
||||||
$$PWD/lineprefixer.h \
|
|
||||||
$$PWD/clangbackendipcdebugutils.h \
|
$$PWD/clangbackendipcdebugutils.h \
|
||||||
$$PWD/diagnosticcontainer.h \
|
$$PWD/clangbackendipc_global.h \
|
||||||
$$PWD/sourcerangecontainer.h \
|
$$PWD/clangcodemodelclientinterface.h \
|
||||||
$$PWD/sourcelocationcontainer.h \
|
$$PWD/clangcodemodelclientmessages.h \
|
||||||
$$PWD/fixitcontainer.h \
|
$$PWD/clangcodemodelclientproxy.h \
|
||||||
$$PWD/requestdocumentannotations.h \
|
|
||||||
$$PWD/referencesmessage.h \
|
|
||||||
$$PWD/requestreferencesmessage.h \
|
|
||||||
$$PWD/registerunsavedfilesforeditormessage.h \
|
|
||||||
$$PWD/unregisterunsavedfilesforeditormessage.h \
|
|
||||||
$$PWD/updatetranslationunitsforeditormessage.h \
|
|
||||||
$$PWD/updatevisibletranslationunitsmessage.h \
|
|
||||||
$$PWD/highlightingmarkcontainer.h \
|
|
||||||
$$PWD/messageenvelop.h \
|
|
||||||
$$PWD/ipcclientinterface.h \
|
|
||||||
$$PWD/ipcserverinterface.h \
|
|
||||||
$$PWD/clangcodemodelconnectionclient.h \
|
$$PWD/clangcodemodelconnectionclient.h \
|
||||||
|
$$PWD/clangcodemodelserverinterface.h \
|
||||||
|
$$PWD/clangcodemodelservermessages.h \
|
||||||
|
$$PWD/clangcodemodelserverproxy.h \
|
||||||
|
$$PWD/clangrefactoringclientmessages.h \
|
||||||
|
$$PWD/clangrefactoringmessages.h \
|
||||||
|
$$PWD/clangrefactoringservermessages.h \
|
||||||
|
$$PWD/cmbalivemessage.h \
|
||||||
|
$$PWD/cmbcodecompletedmessage.h \
|
||||||
|
$$PWD/cmbcompletecodemessage.h \
|
||||||
|
$$PWD/cmbechomessage.h \
|
||||||
|
$$PWD/cmbendmessage.h \
|
||||||
|
$$PWD/cmbregisterprojectsforeditormessage.h \
|
||||||
|
$$PWD/cmbregistertranslationunitsforeditormessage.h \
|
||||||
|
$$PWD/cmbunregisterprojectsforeditormessage.h \
|
||||||
|
$$PWD/cmbunregistertranslationunitsforeditormessage.h \
|
||||||
|
$$PWD/codecompletionchunk.h \
|
||||||
|
$$PWD/codecompletion.h \
|
||||||
|
$$PWD/connectionclient.h \
|
||||||
|
$$PWD/connectionserver.h \
|
||||||
|
$$PWD/diagnosticcontainer.h \
|
||||||
$$PWD/documentannotationschangedmessage.h \
|
$$PWD/documentannotationschangedmessage.h \
|
||||||
$$PWD/refactoringclientinterface.h \
|
|
||||||
$$PWD/refactoringserverinterface.h \
|
|
||||||
$$PWD/refactoringserverproxy.h \
|
|
||||||
$$PWD/refactoringclientproxy.h \
|
|
||||||
$$PWD/sourcelocationscontainer.h \
|
|
||||||
$$PWD/sourcelocationcontainerv2.h \
|
|
||||||
$$PWD/sourcelocationsforrenamingmessage.h \
|
|
||||||
$$PWD/requestsourcelocationforrenamingmessage.h \
|
|
||||||
$$PWD/filepath.h \
|
|
||||||
$$PWD/sourcerangescontainer.h \
|
|
||||||
$$PWD/sourcefilepathcontainerbase.h \
|
|
||||||
$$PWD/sourcerangecontainerv2.h \
|
|
||||||
$$PWD/dynamicmatcherdiagnostics.h \
|
|
||||||
$$PWD/dynamicastmatcherdiagnosticcontainer.h \
|
$$PWD/dynamicastmatcherdiagnosticcontainer.h \
|
||||||
$$PWD/dynamicastmatcherdiagnosticcontextcontainer.h \
|
$$PWD/dynamicastmatcherdiagnosticcontextcontainer.h \
|
||||||
$$PWD/dynamicastmatcherdiagnosticmessagecontainer.h \
|
$$PWD/dynamicastmatcherdiagnosticmessagecontainer.h \
|
||||||
$$PWD/requestsourcerangesanddiagnosticsforquerymessage.h \
|
$$PWD/dynamicmatcherdiagnostics.h \
|
||||||
$$PWD/sourcerangesanddiagnosticsforquerymessage.h \
|
$$PWD/filecontainer.h \
|
||||||
$$PWD/sourcerangewithtextcontainer.h \
|
|
||||||
$$PWD/filecontainerv2.h \
|
$$PWD/filecontainerv2.h \
|
||||||
$$PWD/cancelmessage.h \
|
$$PWD/filepath.h \
|
||||||
|
$$PWD/fixitcontainer.h \
|
||||||
|
$$PWD/highlightingmarkcontainer.h \
|
||||||
|
$$PWD/ipcclientinterface.h \
|
||||||
|
$$PWD/ipcinterface.h \
|
||||||
|
$$PWD/ipcserverinterface.h \
|
||||||
|
$$PWD/lineprefixer.h \
|
||||||
|
$$PWD/messageenvelop.h \
|
||||||
$$PWD/pchmanagerclientinterface.h \
|
$$PWD/pchmanagerclientinterface.h \
|
||||||
$$PWD/pchmanagerserverinterface.h \
|
|
||||||
$$PWD/projectpartcontainerv2.h \
|
|
||||||
$$PWD/updatepchprojectpartsmessage.h \
|
|
||||||
$$PWD/pchmanagerserverproxy.h \
|
|
||||||
$$PWD/pchmanagerclientproxy.h \
|
$$PWD/pchmanagerclientproxy.h \
|
||||||
$$PWD/projectpartpch.h \
|
$$PWD/pchmanagerserverinterface.h \
|
||||||
|
$$PWD/pchmanagerserverproxy.h \
|
||||||
$$PWD/precompiledheadersupdatedmessage.h \
|
$$PWD/precompiledheadersupdatedmessage.h \
|
||||||
$$PWD/stringcache.h \
|
$$PWD/projectpartcontainer.h \
|
||||||
|
$$PWD/projectpartcontainerv2.h \
|
||||||
|
$$PWD/projectpartpch.h \
|
||||||
|
$$PWD/projectpartsdonotexistmessage.h \
|
||||||
|
$$PWD/readmessageblock.h \
|
||||||
|
$$PWD/refactoringclientinterface.h \
|
||||||
|
$$PWD/refactoringclientproxy.h \
|
||||||
|
$$PWD/refactoringserverinterface.h \
|
||||||
|
$$PWD/refactoringserverproxy.h \
|
||||||
|
$$PWD/referencesmessage.h \
|
||||||
|
$$PWD/registerunsavedfilesforeditormessage.h \
|
||||||
$$PWD/removepchprojectpartsmessage.h \
|
$$PWD/removepchprojectpartsmessage.h \
|
||||||
$$PWD/clangcodemodelclientmessages.h \
|
$$PWD/requestdocumentannotations.h \
|
||||||
$$PWD/clangcodemodelservermessages.h \
|
$$PWD/requestreferencesmessage.h \
|
||||||
|
$$PWD/requestsourcelocationforrenamingmessage.h \
|
||||||
|
$$PWD/requestsourcerangesanddiagnosticsforquerymessage.h \
|
||||||
|
$$PWD/requestsourcerangesforquerymessage.h \
|
||||||
|
$$PWD/sourcefilepathcontainerbase.h \
|
||||||
|
$$PWD/sourcelocationcontainer.h \
|
||||||
|
$$PWD/sourcelocationcontainerv2.h \
|
||||||
|
$$PWD/sourcelocationscontainer.h \
|
||||||
|
$$PWD/sourcelocationsforrenamingmessage.h \
|
||||||
|
$$PWD/sourcerangecontainer.h \
|
||||||
|
$$PWD/sourcerangecontainerv2.h \
|
||||||
|
$$PWD/sourcerangesanddiagnosticsforquerymessage.h \
|
||||||
|
$$PWD/sourcerangescontainer.h \
|
||||||
$$PWD/sourcerangesforquerymessage.h \
|
$$PWD/sourcerangesforquerymessage.h \
|
||||||
$$PWD/clangrefactoringmessages.h \
|
$$PWD/sourcerangewithtextcontainer.h \
|
||||||
$$PWD/clangrefactoringclientmessages.h \
|
$$PWD/stringcache.h \
|
||||||
$$PWD/clangrefactoringservermessages.h \
|
$$PWD/translationunitdoesnotexistmessage.h \
|
||||||
$$PWD/requestsourcerangesforquerymessage.h
|
$$PWD/unregisterunsavedfilesforeditormessage.h \
|
||||||
|
$$PWD/updatepchprojectpartsmessage.h \
|
||||||
|
$$PWD/updatetranslationunitsforeditormessage.h \
|
||||||
|
$$PWD/updatevisibletranslationunitsmessage.h \
|
||||||
|
$$PWD/writemessageblock.h \
|
||||||
|
|
||||||
contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
|
contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
|
||||||
|
@@ -55,7 +55,7 @@ public:
|
|||||||
return m_contextType;
|
return m_contextType;
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::SmallString contextTypeText() const;
|
CMBIPC_EXPORT Utils::SmallString contextTypeText() const;
|
||||||
|
|
||||||
const Utils::SmallStringVector &arguments() const
|
const Utils::SmallStringVector &arguments() const
|
||||||
{
|
{
|
||||||
|
@@ -33,8 +33,8 @@ namespace ClangBackEnd {
|
|||||||
QDebug operator<<(QDebug debug, const DynamicASTMatcherDiagnosticMessageContainer &container)
|
QDebug operator<<(QDebug debug, const DynamicASTMatcherDiagnosticMessageContainer &container)
|
||||||
{
|
{
|
||||||
debug.nospace() << "DynamicASTMatcherDiagnosticMessageContainer("
|
debug.nospace() << "DynamicASTMatcherDiagnosticMessageContainer("
|
||||||
<< container.sourceRange() << ", "
|
|
||||||
<< container.errorTypeText() << ", "
|
<< container.errorTypeText() << ", "
|
||||||
|
<< container.sourceRange() << ", "
|
||||||
<< container.arguments()
|
<< container.arguments()
|
||||||
<< ")";
|
<< ")";
|
||||||
|
|
||||||
|
@@ -55,7 +55,7 @@ public:
|
|||||||
return m_errorType;
|
return m_errorType;
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::SmallString errorTypeText() const;
|
CMBIPC_EXPORT Utils::SmallString errorTypeText() const;
|
||||||
|
|
||||||
const Utils::SmallStringVector &arguments() const
|
const Utils::SmallStringVector &arguments() const
|
||||||
{
|
{
|
||||||
|
@@ -34,6 +34,8 @@
|
|||||||
#include <QChar>
|
#include <QChar>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
|
#include <utils/algorithm.h>
|
||||||
|
|
||||||
using namespace CPlusPlus;
|
using namespace CPlusPlus;
|
||||||
|
|
||||||
enum { MAX_NUM_LINES = 20 };
|
enum { MAX_NUM_LINES = 20 };
|
||||||
@@ -135,16 +137,215 @@ static const Token tokenAtPosition(const Tokens &tokens, const unsigned pos)
|
|||||||
return Token();
|
return Token();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int tokenIndexBeforePosition(const Tokens &tokens, unsigned pos)
|
||||||
|
{
|
||||||
|
for (int i = tokens.size() - 1; i >= 0; --i) {
|
||||||
|
if (tokens[i].utf16charsBegin() < pos)
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool isCursorAtEndOfLineButMaybeBeforeComment(const Tokens &tokens, int pos)
|
||||||
|
{
|
||||||
|
int index = tokenIndexBeforePosition(tokens, uint(pos));
|
||||||
|
if (index == -1 || index >= tokens.size())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
do {
|
||||||
|
++index;
|
||||||
|
} while (index < tokens.size() && tokens[index].isComment());
|
||||||
|
|
||||||
|
return index >= tokens.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 10.6.1 Attribute syntax and semantics
|
||||||
|
// This does not handle alignas() since it is not needed for the namespace case.
|
||||||
|
static int skipAttributeSpecifierSequence(const Tokens &tokens, int index)
|
||||||
|
{
|
||||||
|
// [[ attribute-using-prefixopt attribute-list ]]
|
||||||
|
if (index >= 1 && tokens[index].is(T_RBRACKET) && tokens[index - 1].is(T_RBRACKET)) {
|
||||||
|
// Skip everything within [[ ]]
|
||||||
|
for (int i = index - 2; i >= 0; --i) {
|
||||||
|
if (i >= 1 && tokens[i].is(T_LBRACKET) && tokens[i - 1].is(T_LBRACKET))
|
||||||
|
return i - 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int skipNamespaceName(const Tokens &tokens, int index)
|
||||||
|
{
|
||||||
|
if (index >= tokens.size())
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (!tokens[index].is(T_IDENTIFIER))
|
||||||
|
return index;
|
||||||
|
|
||||||
|
// Accept
|
||||||
|
// SomeName
|
||||||
|
// Some::Nested::Name
|
||||||
|
bool expectIdentifier = false;
|
||||||
|
for (int i = index - 1; i >= 0; --i) {
|
||||||
|
if (expectIdentifier) {
|
||||||
|
if (tokens[i].is(T_IDENTIFIER))
|
||||||
|
expectIdentifier = false;
|
||||||
|
else
|
||||||
|
return -1;
|
||||||
|
} else if (tokens[i].is(T_COLON_COLON)) {
|
||||||
|
expectIdentifier = true;
|
||||||
|
} else {
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 10.3.1 Namespace definition
|
||||||
|
static bool isAfterNamespaceDefinition(const Tokens &tokens, int position)
|
||||||
|
{
|
||||||
|
int index = tokenIndexBeforePosition(tokens, uint(position));
|
||||||
|
if (index == -1)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Handle optional name
|
||||||
|
index = skipNamespaceName(tokens, index);
|
||||||
|
if (index == -1)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Handle optional attribute specifier sequence
|
||||||
|
index = skipAttributeSpecifierSequence(tokens, index);
|
||||||
|
if (index == -1)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return index >= 0 && tokens[index].is(T_NAMESPACE);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int isEmptyOrWhitespace(const QString &text)
|
||||||
|
{
|
||||||
|
return Utils::allOf(text, [](const QChar &c) {return c.isSpace(); });
|
||||||
|
}
|
||||||
|
|
||||||
|
static QTextBlock previousNonEmptyBlock(const QTextBlock ¤tBlock)
|
||||||
|
{
|
||||||
|
QTextBlock block = currentBlock.previous();
|
||||||
|
forever {
|
||||||
|
if (!block.isValid() || !isEmptyOrWhitespace(block.text()))
|
||||||
|
return block;
|
||||||
|
block = block.previous();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static QTextBlock nextNonEmptyBlock(const QTextBlock ¤tBlock)
|
||||||
|
{
|
||||||
|
QTextBlock block = currentBlock.next();
|
||||||
|
forever {
|
||||||
|
if (!block.isValid() || !isEmptyOrWhitespace(block.text()))
|
||||||
|
return block;
|
||||||
|
block = block.next();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool allowAutoClosingBraceAtEmptyLine(
|
||||||
|
const QTextBlock &block,
|
||||||
|
MatchingText::IsNextBlockDeeperIndented isNextDeeperIndented)
|
||||||
|
{
|
||||||
|
QTextBlock previousBlock = previousNonEmptyBlock(block);
|
||||||
|
if (!previousBlock.isValid())
|
||||||
|
return false; // Nothing before
|
||||||
|
|
||||||
|
QTextBlock nextBlock = nextNonEmptyBlock(block);
|
||||||
|
if (!nextBlock.isValid())
|
||||||
|
return true; // Nothing behind
|
||||||
|
|
||||||
|
if (isNextDeeperIndented && isNextDeeperIndented(previousBlock))
|
||||||
|
return false; // Before indented
|
||||||
|
|
||||||
|
const QString trimmedText = previousBlock.text().trimmed();
|
||||||
|
return !trimmedText.endsWith(';')
|
||||||
|
&& !trimmedText.endsWith('{')
|
||||||
|
&& !trimmedText.endsWith('}');
|
||||||
|
}
|
||||||
|
|
||||||
|
static Tokens getTokens(const QTextCursor &cursor, int &prevState)
|
||||||
|
{
|
||||||
|
LanguageFeatures features;
|
||||||
|
features.qtEnabled = false;
|
||||||
|
features.qtKeywordsEnabled = false;
|
||||||
|
features.qtMocRunEnabled = false;
|
||||||
|
features.cxx11Enabled = true;
|
||||||
|
features.cxxEnabled = true;
|
||||||
|
features.c99Enabled = true;
|
||||||
|
features.objCEnabled = true;
|
||||||
|
|
||||||
|
SimpleLexer tokenize;
|
||||||
|
tokenize.setLanguageFeatures(features);
|
||||||
|
|
||||||
|
prevState = BackwardsScanner::previousBlockState(cursor.block()) & 0xFF;
|
||||||
|
return tokenize(cursor.block().text(), prevState);
|
||||||
|
}
|
||||||
|
|
||||||
|
static QChar firstNonSpace(const QTextCursor &cursor)
|
||||||
|
{
|
||||||
|
int position = cursor.position();
|
||||||
|
QChar ch = cursor.document()->characterAt(position);
|
||||||
|
while (ch.isSpace())
|
||||||
|
ch = cursor.document()->characterAt(++position);
|
||||||
|
|
||||||
|
return ch;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool allowAutoClosingBraceByLookahead(const QTextCursor &cursor)
|
||||||
|
{
|
||||||
|
const QChar lookAhead = firstNonSpace(cursor);
|
||||||
|
if (lookAhead.isNull())
|
||||||
|
return true;
|
||||||
|
|
||||||
|
switch (lookAhead.unicode()) {
|
||||||
|
case ';': case ',':
|
||||||
|
case ')': case '}': case ']':
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool allowAutoClosingBrace(const QTextCursor &cursor,
|
||||||
|
MatchingText::IsNextBlockDeeperIndented isNextIndented)
|
||||||
|
{
|
||||||
|
if (MatchingText::isInCommentHelper(cursor))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
const QTextBlock block = cursor.block();
|
||||||
|
if (isEmptyOrWhitespace(block.text()))
|
||||||
|
return allowAutoClosingBraceAtEmptyLine(cursor.block(), isNextIndented);
|
||||||
|
|
||||||
|
int prevState;
|
||||||
|
const Tokens tokens = getTokens(cursor, prevState);
|
||||||
|
if (isAfterNamespaceDefinition(tokens, cursor.positionInBlock()))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (isCursorAtEndOfLineButMaybeBeforeComment(tokens, cursor.positionInBlock()))
|
||||||
|
return !(isNextIndented && isNextIndented(block));
|
||||||
|
|
||||||
|
return allowAutoClosingBraceByLookahead(cursor);
|
||||||
|
}
|
||||||
|
|
||||||
bool MatchingText::contextAllowsAutoParentheses(const QTextCursor &cursor,
|
bool MatchingText::contextAllowsAutoParentheses(const QTextCursor &cursor,
|
||||||
const QString &textToInsert)
|
const QString &textToInsert,
|
||||||
|
IsNextBlockDeeperIndented isNextIndented)
|
||||||
{
|
{
|
||||||
QChar ch;
|
QChar ch;
|
||||||
|
|
||||||
if (!textToInsert.isEmpty())
|
if (!textToInsert.isEmpty())
|
||||||
ch = textToInsert.at(0);
|
ch = textToInsert.at(0);
|
||||||
|
|
||||||
if (ch == QLatin1Char('{') && cursor.block().text().trimmed().isEmpty())
|
if (ch == QLatin1Char('{'))
|
||||||
return false; // User just might want to wrap up some lines.
|
return allowAutoClosingBrace(cursor, isNextIndented);
|
||||||
|
|
||||||
if (!shouldInsertMatchingText(cursor) && ch != QLatin1Char('\'') && ch != QLatin1Char('"'))
|
if (!shouldInsertMatchingText(cursor) && ch != QLatin1Char('\'') && ch != QLatin1Char('"'))
|
||||||
return false;
|
return false;
|
||||||
@@ -198,24 +399,6 @@ bool MatchingText::shouldInsertMatchingText(QChar lookAhead)
|
|||||||
} // switch
|
} // switch
|
||||||
}
|
}
|
||||||
|
|
||||||
static Tokens getTokens(const QTextCursor &cursor, int &prevState)
|
|
||||||
{
|
|
||||||
LanguageFeatures features;
|
|
||||||
features.qtEnabled = false;
|
|
||||||
features.qtKeywordsEnabled = false;
|
|
||||||
features.qtMocRunEnabled = false;
|
|
||||||
features.cxx11Enabled = true;
|
|
||||||
features.cxxEnabled = true;
|
|
||||||
features.c99Enabled = true;
|
|
||||||
features.objCEnabled = true;
|
|
||||||
|
|
||||||
SimpleLexer tokenize;
|
|
||||||
tokenize.setLanguageFeatures(features);
|
|
||||||
|
|
||||||
prevState = BackwardsScanner::previousBlockState(cursor.block()) & 0xFF;
|
|
||||||
return tokenize(cursor.block().text(), prevState);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool MatchingText::isInCommentHelper(const QTextCursor &cursor, Token *retToken)
|
bool MatchingText::isInCommentHelper(const QTextCursor &cursor, Token *retToken)
|
||||||
{
|
{
|
||||||
int prevState = 0;
|
int prevState = 0;
|
||||||
|
@@ -30,7 +30,10 @@
|
|||||||
#include <cplusplus/Token.h>
|
#include <cplusplus/Token.h>
|
||||||
#include <cplusplus/CPlusPlusForwardDeclarations.h>
|
#include <cplusplus/CPlusPlusForwardDeclarations.h>
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
QT_FORWARD_DECLARE_CLASS(QTextCursor)
|
QT_FORWARD_DECLARE_CLASS(QTextCursor)
|
||||||
|
QT_FORWARD_DECLARE_CLASS(QTextBlock)
|
||||||
QT_FORWARD_DECLARE_CLASS(QChar)
|
QT_FORWARD_DECLARE_CLASS(QChar)
|
||||||
|
|
||||||
namespace CPlusPlus {
|
namespace CPlusPlus {
|
||||||
@@ -38,8 +41,11 @@ namespace CPlusPlus {
|
|||||||
class CPLUSPLUS_EXPORT MatchingText
|
class CPLUSPLUS_EXPORT MatchingText
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
using IsNextBlockDeeperIndented = std::function<bool(const QTextBlock &textBlock)>;
|
||||||
static bool contextAllowsAutoParentheses(const QTextCursor &cursor,
|
static bool contextAllowsAutoParentheses(const QTextCursor &cursor,
|
||||||
const QString &textToInsert);
|
const QString &textToInsert,
|
||||||
|
IsNextBlockDeeperIndented isNextIndented
|
||||||
|
= IsNextBlockDeeperIndented());
|
||||||
static bool contextAllowsAutoQuotes(const QTextCursor &cursor,
|
static bool contextAllowsAutoQuotes(const QTextCursor &cursor,
|
||||||
const QString &textToInsert);
|
const QString &textToInsert);
|
||||||
static bool contextAllowsElectricCharacters(const QTextCursor &cursor);
|
static bool contextAllowsElectricCharacters(const QTextCursor &cursor);
|
||||||
|
@@ -31,6 +31,7 @@
|
|||||||
#include "pluginmanager.h"
|
#include "pluginmanager.h"
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
@@ -630,12 +631,9 @@ static inline QString msgInvalidFormat(const char *key, const QString &content)
|
|||||||
.arg(QLatin1String(key), content);
|
.arg(QLatin1String(key), content);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool readMultiLineString(const QJsonValue &value, QString *out)
|
bool PluginSpec::readMultiLineString(const QJsonValue &value, QString *out)
|
||||||
{
|
{
|
||||||
if (!out) {
|
QTC_ASSERT(out, return false);
|
||||||
qCWarning(pluginLog) << Q_FUNC_INFO << "missing output parameter";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (value.isString()) {
|
if (value.isString()) {
|
||||||
*out = value.toString();
|
*out = value.toString();
|
||||||
} else if (value.isArray()) {
|
} else if (value.isArray()) {
|
||||||
@@ -737,7 +735,7 @@ bool PluginSpecPrivate::readMetaData(const QJsonObject &pluginMetaData)
|
|||||||
copyright = value.toString();
|
copyright = value.toString();
|
||||||
|
|
||||||
value = metaData.value(QLatin1String(DESCRIPTION));
|
value = metaData.value(QLatin1String(DESCRIPTION));
|
||||||
if (!value.isUndefined() && !readMultiLineString(value, &description))
|
if (!value.isUndefined() && !PluginSpec::readMultiLineString(value, &description))
|
||||||
return reportError(msgValueIsNotAString(DESCRIPTION));
|
return reportError(msgValueIsNotAString(DESCRIPTION));
|
||||||
|
|
||||||
value = metaData.value(QLatin1String(URL));
|
value = metaData.value(QLatin1String(URL));
|
||||||
@@ -751,7 +749,7 @@ bool PluginSpecPrivate::readMetaData(const QJsonObject &pluginMetaData)
|
|||||||
category = value.toString();
|
category = value.toString();
|
||||||
|
|
||||||
value = metaData.value(QLatin1String(LICENSE));
|
value = metaData.value(QLatin1String(LICENSE));
|
||||||
if (!value.isUndefined() && !readMultiLineString(value, &license))
|
if (!value.isUndefined() && !PluginSpec::readMultiLineString(value, &license))
|
||||||
return reportError(msgValueIsNotAMultilineString(LICENSE));
|
return reportError(msgValueIsNotAMultilineString(LICENSE));
|
||||||
|
|
||||||
value = metaData.value(QLatin1String(PLATFORM));
|
value = metaData.value(QLatin1String(PLATFORM));
|
||||||
|
@@ -131,6 +131,8 @@ public:
|
|||||||
bool hasError() const;
|
bool hasError() const;
|
||||||
QString errorString() const;
|
QString errorString() const;
|
||||||
|
|
||||||
|
static bool readMultiLineString(const QJsonValue &value, QString *out);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PluginSpec();
|
PluginSpec();
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 214 B After Width: | Height: | Size: 214 B |
Before Width: | Height: | Size: 255 B After Width: | Height: | Size: 258 B |
@@ -17,14 +17,14 @@
|
|||||||
\"Url\" : \"http://necessitas.kde.org\",
|
\"Url\" : \"http://necessitas.kde.org\",
|
||||||
$$dependencyList,
|
$$dependencyList,
|
||||||
|
|
||||||
\"Mimetypes\" : \"
|
\"Mimetypes\" : [
|
||||||
<?xml version=\'1.0\'?>
|
\"<?xml version=\'1.0\'?>\",
|
||||||
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
|
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
|
||||||
<mime-type type=\'application/vnd.google.android.android_manifest\'>
|
\" <mime-type type=\'application/vnd.google.android.android_manifest\'>\",
|
||||||
<comment>Android manifest file</comment>
|
\" <comment>Android manifest file</comment>\",
|
||||||
<sub-class-of type=\'application/xml\'/>
|
\" <sub-class-of type=\'application/xml\'/>\",
|
||||||
<glob pattern=\'AndroidManifest.xml\'/>
|
\" <glob pattern=\'AndroidManifest.xml\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
</mime-info>
|
\"</mime-info>\"
|
||||||
\"
|
]
|
||||||
}
|
}
|
||||||
|
@@ -347,7 +347,9 @@ void AndroidConfig::updateAvailableSdkPlatforms() const
|
|||||||
|
|
||||||
m_availableSdkPlatforms.clear();
|
m_availableSdkPlatforms.clear();
|
||||||
AndroidSdkManager sdkManager(*this);
|
AndroidSdkManager sdkManager(*this);
|
||||||
m_availableSdkPlatforms = sdkManager.availableSdkPlatforms();
|
bool success = false;
|
||||||
|
m_availableSdkPlatforms = sdkManager.availableSdkPlatforms(&success);
|
||||||
|
if (success)
|
||||||
m_availableSdkPlatformsUpToDate = true;
|
m_availableSdkPlatformsUpToDate = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -358,7 +360,7 @@ QStringList AndroidConfig::apiLevelNamesFor(const QList<SdkPlatform> &platforms)
|
|||||||
|
|
||||||
QString AndroidConfig::apiLevelNameFor(const SdkPlatform &platform)
|
QString AndroidConfig::apiLevelNameFor(const SdkPlatform &platform)
|
||||||
{
|
{
|
||||||
return QLatin1String("android-") + QString::number(platform.apiLevel);
|
return platform.apiLevel > 0 ? QString("android-%1").arg(platform.apiLevel) : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<SdkPlatform> AndroidConfig::sdkTargets(int minApiLevel) const
|
QList<SdkPlatform> AndroidConfig::sdkTargets(int minApiLevel) const
|
||||||
|
@@ -50,6 +50,8 @@ const char installLocationKey[] = "Installed Location:";
|
|||||||
const char apiLevelPropertyKey[] = "AndroidVersion.ApiLevel";
|
const char apiLevelPropertyKey[] = "AndroidVersion.ApiLevel";
|
||||||
const char abiPropertyKey[] = "SystemImage.Abi";
|
const char abiPropertyKey[] = "SystemImage.Abi";
|
||||||
|
|
||||||
|
const int sdkManagerCmdTimeoutS = 60;
|
||||||
|
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -72,11 +74,14 @@ static bool valueForKey(QString key, const QString &line, QString *value = nullp
|
|||||||
\c true if the command is successfully executed. Output is copied into \a output. The function
|
\c true if the command is successfully executed. Output is copied into \a output. The function
|
||||||
blocks the calling thread.
|
blocks the calling thread.
|
||||||
*/
|
*/
|
||||||
static bool sdkManagerCommand(const AndroidConfig config, const QStringList &args, QString *output)
|
static bool sdkManagerCommand(const AndroidConfig config, const QStringList &args, QString *output,
|
||||||
|
int timeout = sdkManagerCmdTimeoutS)
|
||||||
{
|
{
|
||||||
QString sdkManagerToolPath = config.sdkManagerToolPath().toString();
|
QString sdkManagerToolPath = config.sdkManagerToolPath().toString();
|
||||||
SynchronousProcess proc;
|
SynchronousProcess proc;
|
||||||
SynchronousProcessResponse response = proc.runBlocking(sdkManagerToolPath, args);
|
proc.setTimeoutS(timeout);
|
||||||
|
proc.setTimeOutMessageBoxEnabled(true);
|
||||||
|
SynchronousProcessResponse response = proc.run(sdkManagerToolPath, args);
|
||||||
if (response.result == SynchronousProcessResponse::Finished) {
|
if (response.result == SynchronousProcessResponse::Finished) {
|
||||||
if (output)
|
if (output)
|
||||||
*output = response.allOutput();
|
*output = response.allOutput();
|
||||||
@@ -132,10 +137,6 @@ AndroidSdkManager::AndroidSdkManager(const AndroidConfig &config):
|
|||||||
m_config(config),
|
m_config(config),
|
||||||
m_parser(new SdkManagerOutputParser)
|
m_parser(new SdkManagerOutputParser)
|
||||||
{
|
{
|
||||||
QString packageListing;
|
|
||||||
if (sdkManagerCommand(config, QStringList({"--list", "--verbose"}), &packageListing)) {
|
|
||||||
m_parser->parsePackageListing(packageListing);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AndroidSdkManager::~AndroidSdkManager()
|
AndroidSdkManager::~AndroidSdkManager()
|
||||||
@@ -143,13 +144,20 @@ AndroidSdkManager::~AndroidSdkManager()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SdkPlatformList AndroidSdkManager::availableSdkPlatforms()
|
SdkPlatformList AndroidSdkManager::availableSdkPlatforms(bool *ok)
|
||||||
{
|
{
|
||||||
|
bool success = false;
|
||||||
if (m_config.sdkToolsVersion() < sdkManagerIntroVersion) {
|
if (m_config.sdkToolsVersion() < sdkManagerIntroVersion) {
|
||||||
AndroidToolManager toolManager(m_config);
|
AndroidToolManager toolManager(m_config);
|
||||||
return toolManager.availableSdkPlatforms();
|
return toolManager.availableSdkPlatforms(ok);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString packageListing;
|
||||||
|
if (sdkManagerCommand(m_config, QStringList({"--list", "--verbose"}), &packageListing))
|
||||||
|
m_parser->parsePackageListing(packageListing);
|
||||||
|
|
||||||
|
if (ok)
|
||||||
|
*ok = success;
|
||||||
return m_parser->m_installedPlatforms;
|
return m_parser->m_installedPlatforms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -40,7 +40,7 @@ public:
|
|||||||
AndroidSdkManager(const AndroidConfig &config);
|
AndroidSdkManager(const AndroidConfig &config);
|
||||||
~AndroidSdkManager();
|
~AndroidSdkManager();
|
||||||
|
|
||||||
SdkPlatformList availableSdkPlatforms();
|
SdkPlatformList availableSdkPlatforms(bool *ok = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const AndroidConfig &m_config;
|
const AndroidConfig &m_config;
|
||||||
|
@@ -97,16 +97,22 @@ AndroidToolManager::~AndroidToolManager()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SdkPlatformList AndroidToolManager::availableSdkPlatforms() const
|
SdkPlatformList AndroidToolManager::availableSdkPlatforms(bool *ok) const
|
||||||
{
|
{
|
||||||
|
bool success = false;
|
||||||
SdkPlatformList list;
|
SdkPlatformList list;
|
||||||
QString targetListing;
|
QString targetListing;
|
||||||
if (androidToolCommand(m_config.androidToolPath(), QStringList({"list", "target"}),
|
if (androidToolCommand(m_config.androidToolPath(), QStringList({"list", "target"}),
|
||||||
androidToolEnvironment(), &targetListing)) {
|
androidToolEnvironment(), &targetListing)) {
|
||||||
m_parser->parseTargetListing(targetListing, m_config.sdkLocation(), &list);
|
m_parser->parseTargetListing(targetListing, m_config.sdkLocation(), &list);
|
||||||
|
success = true;
|
||||||
} else {
|
} else {
|
||||||
qCDebug(androidToolLog) << "Android tool target listing failed";
|
qCDebug(androidToolLog) << "Android tool target listing failed";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ok)
|
||||||
|
*ok = success;
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -48,7 +48,7 @@ public:
|
|||||||
AndroidToolManager(const AndroidConfig &config);
|
AndroidToolManager(const AndroidConfig &config);
|
||||||
~AndroidToolManager();
|
~AndroidToolManager();
|
||||||
|
|
||||||
SdkPlatformList availableSdkPlatforms() const;
|
SdkPlatformList availableSdkPlatforms(bool *ok = nullptr) const;
|
||||||
void launchAvdManager() const;
|
void launchAvdManager() const;
|
||||||
|
|
||||||
QFuture<AndroidConfig::CreateAvdInfo> createAvd(AndroidConfig::CreateAvdInfo info) const;
|
QFuture<AndroidConfig::CreateAvdInfo> createAvd(AndroidConfig::CreateAvdInfo info) const;
|
||||||
|
@@ -68,6 +68,14 @@ const Utils::Icon RESULT_MESSAGEDEBUG({
|
|||||||
const Utils::Icon RESULT_MESSAGEWARN({
|
const Utils::Icon RESULT_MESSAGEWARN({
|
||||||
{":/utils/images/filledcircle.png", Utils::Theme::OutputPanes_TestWarnTextColor}},
|
{":/utils/images/filledcircle.png", Utils::Theme::OutputPanes_TestWarnTextColor}},
|
||||||
Utils::Icon::Tint);
|
Utils::Icon::Tint);
|
||||||
|
const Utils::Icon RESULT_MESSAGEPASSWARN({
|
||||||
|
{":/utils/images/filledcircle.png", Utils::Theme::OutputPanes_TestPassTextColor},
|
||||||
|
{":/utils/images/iconoverlay_warning.png", Utils::Theme::OutputPanes_TestWarnTextColor}},
|
||||||
|
Utils::Icon::Tint | Utils::Icon::PunchEdges);
|
||||||
|
const Utils::Icon RESULT_MESSAGEFAILWARN({
|
||||||
|
{":/utils/images/filledcircle.png", Utils::Theme::OutputPanes_TestFailTextColor},
|
||||||
|
{":/utils/images/iconoverlay_warning.png", Utils::Theme::OutputPanes_TestWarnTextColor}},
|
||||||
|
Utils::Icon::Tint | Utils::Icon::PunchEdges);
|
||||||
const Utils::Icon RESULT_MESSAGEFATAL({
|
const Utils::Icon RESULT_MESSAGEFATAL({
|
||||||
{":/utils/images/filledcircle.png", Utils::Theme::OutputPanes_TestFatalTextColor}},
|
{":/utils/images/filledcircle.png", Utils::Theme::OutputPanes_TestFatalTextColor}},
|
||||||
Utils::Icon::Tint);
|
Utils::Icon::Tint);
|
||||||
|
@@ -41,6 +41,7 @@ static QString constructSourceFilePath(const QString &path, const QString &fileP
|
|||||||
GTestOutputReader::GTestOutputReader(const QFutureInterface<TestResultPtr> &futureInterface,
|
GTestOutputReader::GTestOutputReader(const QFutureInterface<TestResultPtr> &futureInterface,
|
||||||
QProcess *testApplication, const QString &buildDirectory)
|
QProcess *testApplication, const QString &buildDirectory)
|
||||||
: TestOutputReader(futureInterface, testApplication, buildDirectory)
|
: TestOutputReader(futureInterface, testApplication, buildDirectory)
|
||||||
|
, m_executable(testApplication ? testApplication->program() : QString())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,7 +76,7 @@ void GTestOutputReader::processOutput(const QByteArray &outputLine)
|
|||||||
m_futureInterface.reportResult(testResult);
|
m_futureInterface.reportResult(testResult);
|
||||||
m_description.clear();
|
m_description.clear();
|
||||||
} else if (disabledTests.exactMatch(line)) {
|
} else if (disabledTests.exactMatch(line)) {
|
||||||
TestResultPtr testResult = TestResultPtr(new GTestResult());
|
TestResultPtr testResult = TestResultPtr(new GTestResult);
|
||||||
testResult->setResult(Result::MessageDisabledTests);
|
testResult->setResult(Result::MessageDisabledTests);
|
||||||
int disabled = disabledTests.cap(1).toInt();
|
int disabled = disabledTests.cap(1).toInt();
|
||||||
testResult->setDescription(tr("You have %n disabled test(s).", 0, disabled));
|
testResult->setDescription(tr("You have %n disabled test(s).", 0, disabled));
|
||||||
@@ -106,7 +107,7 @@ void GTestOutputReader::processOutput(const QByteArray &outputLine)
|
|||||||
m_futureInterface.reportResult(testResult);
|
m_futureInterface.reportResult(testResult);
|
||||||
} else if (newTestSetStarts.exactMatch(line)) {
|
} else if (newTestSetStarts.exactMatch(line)) {
|
||||||
m_currentTestSet = newTestSetStarts.cap(1);
|
m_currentTestSet = newTestSetStarts.cap(1);
|
||||||
TestResultPtr testResult = TestResultPtr(new GTestResult());
|
TestResultPtr testResult = TestResultPtr(new GTestResult);
|
||||||
testResult->setResult(Result::MessageCurrentTest);
|
testResult->setResult(Result::MessageCurrentTest);
|
||||||
testResult->setDescription(tr("Entering test set %1").arg(m_currentTestSet));
|
testResult->setDescription(tr("Entering test set %1").arg(m_currentTestSet));
|
||||||
m_futureInterface.reportResult(testResult);
|
m_futureInterface.reportResult(testResult);
|
||||||
@@ -156,7 +157,7 @@ void GTestOutputReader::processOutput(const QByteArray &outputLine)
|
|||||||
|
|
||||||
GTestResult *GTestOutputReader::createDefaultResult() const
|
GTestResult *GTestOutputReader::createDefaultResult() const
|
||||||
{
|
{
|
||||||
GTestResult *result = new GTestResult(m_currentTestName);
|
GTestResult *result = new GTestResult(m_executable, m_currentTestName);
|
||||||
result->setTestSetName(m_currentTestSet);
|
result->setTestSetName(m_currentTestSet);
|
||||||
result->setIteration(m_iteration);
|
result->setIteration(m_iteration);
|
||||||
return result;
|
return result;
|
||||||
|
@@ -47,6 +47,7 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
GTestResult *createDefaultResult() const;
|
GTestResult *createDefaultResult() const;
|
||||||
|
QString m_executable;
|
||||||
QString m_currentTestName;
|
QString m_currentTestName;
|
||||||
QString m_currentTestSet;
|
QString m_currentTestSet;
|
||||||
QString m_description;
|
QString m_description;
|
||||||
|
@@ -33,6 +33,11 @@ GTestResult::GTestResult(const QString &name)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GTestResult::GTestResult(const QString &executable, const QString &name)
|
||||||
|
: TestResult(executable, name)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
const QString GTestResult::outputString(bool selected) const
|
const QString GTestResult::outputString(bool selected) const
|
||||||
{
|
{
|
||||||
const QString &desc = description();
|
const QString &desc = description();
|
||||||
|
@@ -34,6 +34,7 @@ class GTestResult : public TestResult
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit GTestResult(const QString &name = QString());
|
explicit GTestResult(const QString &name = QString());
|
||||||
|
GTestResult(const QString &executable, const QString &name);
|
||||||
const QString outputString(bool selected) const override;
|
const QString outputString(bool selected) const override;
|
||||||
|
|
||||||
void setTestSetName(const QString &testSetName) { m_testSetName = testSetName; }
|
void setTestSetName(const QString &testSetName) { m_testSetName = testSetName; }
|
||||||
|
@@ -132,6 +132,7 @@ QtTestOutputReader::QtTestOutputReader(const QFutureInterface<TestResultPtr> &fu
|
|||||||
QProcess *testApplication, const QString &buildDirectory,
|
QProcess *testApplication, const QString &buildDirectory,
|
||||||
OutputMode mode)
|
OutputMode mode)
|
||||||
: TestOutputReader(futureInterface, testApplication, buildDirectory)
|
: TestOutputReader(futureInterface, testApplication, buildDirectory)
|
||||||
|
, m_executable(testApplication ? testApplication->program() : QString())
|
||||||
, m_mode(mode)
|
, m_mode(mode)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -419,7 +420,7 @@ void QtTestOutputReader::processSummaryFinishOutput()
|
|||||||
|
|
||||||
QtTestResult *QtTestOutputReader::createDefaultResult() const
|
QtTestResult *QtTestOutputReader::createDefaultResult() const
|
||||||
{
|
{
|
||||||
QtTestResult *result = new QtTestResult(m_className);
|
QtTestResult *result = new QtTestResult(m_executable, m_className);
|
||||||
result->setFunctionName(m_testCase);
|
result->setFunctionName(m_testCase);
|
||||||
result->setDataTag(m_dataTag);
|
result->setDataTag(m_dataTag);
|
||||||
return result;
|
return result;
|
||||||
|
@@ -78,6 +78,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
CDATAMode m_cdataMode = None;
|
CDATAMode m_cdataMode = None;
|
||||||
|
QString m_executable;
|
||||||
QString m_className;
|
QString m_className;
|
||||||
QString m_testCase;
|
QString m_testCase;
|
||||||
QString m_formerTestCase;
|
QString m_formerTestCase;
|
||||||
|
@@ -35,6 +35,11 @@ QtTestResult::QtTestResult(const QString &className)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QtTestResult::QtTestResult(const QString &executable, const QString &className)
|
||||||
|
: TestResult(executable, className)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
const QString QtTestResult::outputString(bool selected) const
|
const QString QtTestResult::outputString(bool selected) const
|
||||||
{
|
{
|
||||||
const QString &desc = description();
|
const QString &desc = description();
|
||||||
@@ -101,14 +106,14 @@ bool QtTestResult::isIntermediateFor(const TestResult *other) const
|
|||||||
QTC_ASSERT(other, return false);
|
QTC_ASSERT(other, return false);
|
||||||
const QtTestResult *qtOther = static_cast<const QtTestResult *>(other);
|
const QtTestResult *qtOther = static_cast<const QtTestResult *>(other);
|
||||||
return m_dataTag == qtOther->m_dataTag && m_function == qtOther->m_function
|
return m_dataTag == qtOther->m_dataTag && m_function == qtOther->m_function
|
||||||
&& name() == qtOther->name();
|
&& name() == qtOther->name() && executable() == qtOther->executable();
|
||||||
}
|
}
|
||||||
|
|
||||||
TestResult *QtTestResult::createIntermediateResultFor(const TestResult *other)
|
TestResult *QtTestResult::createIntermediateResultFor(const TestResult *other)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(other, return nullptr);
|
QTC_ASSERT(other, return nullptr);
|
||||||
const QtTestResult *qtOther = static_cast<const QtTestResult *>(other);
|
const QtTestResult *qtOther = static_cast<const QtTestResult *>(other);
|
||||||
QtTestResult *intermediate = new QtTestResult(qtOther->name());
|
QtTestResult *intermediate = new QtTestResult(qtOther->executable(), qtOther->name());
|
||||||
intermediate->m_function = qtOther->m_function;
|
intermediate->m_function = qtOther->m_function;
|
||||||
intermediate->m_dataTag = qtOther->m_dataTag;
|
intermediate->m_dataTag = qtOther->m_dataTag;
|
||||||
// intermediates will be needed only for data tags
|
// intermediates will be needed only for data tags
|
||||||
|
@@ -34,6 +34,7 @@ class QtTestResult : public TestResult
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit QtTestResult(const QString &className = QString());
|
explicit QtTestResult(const QString &className = QString());
|
||||||
|
QtTestResult(const QString &executable, const QString &className);
|
||||||
const QString outputString(bool selected) const override;
|
const QString outputString(bool selected) const override;
|
||||||
|
|
||||||
void setFunctionName(const QString &functionName) { m_function = functionName; }
|
void setFunctionName(const QString &functionName) { m_function = functionName; }
|
||||||
|
@@ -47,6 +47,12 @@ TestResult::TestResult(const QString &name)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TestResult::TestResult(const QString &executable, const QString &name)
|
||||||
|
: m_executable(executable)
|
||||||
|
, m_name(name)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
const QString TestResult::outputString(bool selected) const
|
const QString TestResult::outputString(bool selected) const
|
||||||
{
|
{
|
||||||
return selected ? m_description : m_description.split('\n').first();
|
return selected ? m_description : m_description.split('\n').first();
|
||||||
@@ -97,9 +103,11 @@ QString TestResult::resultToString(const Result::Type type)
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case Result::Pass:
|
case Result::Pass:
|
||||||
case Result::MessageTestCaseSuccess:
|
case Result::MessageTestCaseSuccess:
|
||||||
|
case Result::MessageTestCaseSuccessWarn:
|
||||||
return QString("PASS");
|
return QString("PASS");
|
||||||
case Result::Fail:
|
case Result::Fail:
|
||||||
case Result::MessageTestCaseFail:
|
case Result::MessageTestCaseFail:
|
||||||
|
case Result::MessageTestCaseFailWarn:
|
||||||
return QString("FAIL");
|
return QString("FAIL");
|
||||||
case Result::ExpectedFail:
|
case Result::ExpectedFail:
|
||||||
return QString("XFAIL");
|
return QString("XFAIL");
|
||||||
@@ -114,7 +122,6 @@ QString TestResult::resultToString(const Result::Type type)
|
|||||||
case Result::MessageInfo:
|
case Result::MessageInfo:
|
||||||
return QString("INFO");
|
return QString("INFO");
|
||||||
case Result::MessageWarn:
|
case Result::MessageWarn:
|
||||||
case Result::MessageTestCaseWarn:
|
|
||||||
return QString("WARN");
|
return QString("WARN");
|
||||||
case Result::MessageFatal:
|
case Result::MessageFatal:
|
||||||
return QString("FATAL");
|
return QString("FATAL");
|
||||||
@@ -166,26 +173,28 @@ QColor TestResult::colorForType(const Result::Type type)
|
|||||||
bool TestResult::isMessageCaseStart(const Result::Type type)
|
bool TestResult::isMessageCaseStart(const Result::Type type)
|
||||||
{
|
{
|
||||||
return type == Result::MessageTestCaseStart || type == Result::MessageTestCaseSuccess
|
return type == Result::MessageTestCaseStart || type == Result::MessageTestCaseSuccess
|
||||||
|| type == Result::MessageTestCaseFail || type == Result::MessageTestCaseWarn
|
|| type == Result::MessageTestCaseFail || type == Result::MessageTestCaseSuccessWarn
|
||||||
|| type == Result::MessageIntermediate;
|
|| type == Result::MessageTestCaseFailWarn || type == Result::MessageIntermediate;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TestResult::isDirectParentOf(const TestResult *other, bool * /*needsIntermediate*/) const
|
bool TestResult::isDirectParentOf(const TestResult *other, bool * /*needsIntermediate*/) const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(other, return false);
|
QTC_ASSERT(other, return false);
|
||||||
return m_name == other->m_name;
|
return !m_executable.isEmpty() && m_executable == other->m_executable
|
||||||
|
&& m_name == other->m_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TestResult::isIntermediateFor(const TestResult *other) const
|
bool TestResult::isIntermediateFor(const TestResult *other) const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(other, return false);
|
QTC_ASSERT(other, return false);
|
||||||
return m_name == other->m_name;
|
return !m_executable.isEmpty() && m_executable == other->m_executable
|
||||||
|
&& m_name == other->m_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
TestResult *TestResult::createIntermediateResultFor(const TestResult *other)
|
TestResult *TestResult::createIntermediateResultFor(const TestResult *other)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(other, return nullptr);
|
QTC_ASSERT(other, return nullptr);
|
||||||
TestResult *intermediate = new TestResult(other->m_name);
|
TestResult *intermediate = new TestResult(other->m_executable, other->m_name);
|
||||||
return intermediate;
|
return intermediate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -55,8 +55,9 @@ enum Type {
|
|||||||
MessageDisabledTests,
|
MessageDisabledTests,
|
||||||
MessageTestCaseStart,
|
MessageTestCaseStart,
|
||||||
MessageTestCaseSuccess,
|
MessageTestCaseSuccess,
|
||||||
MessageTestCaseWarn,
|
MessageTestCaseSuccessWarn,
|
||||||
MessageTestCaseFail,
|
MessageTestCaseFail,
|
||||||
|
MessageTestCaseFailWarn,
|
||||||
MessageTestCaseEnd,
|
MessageTestCaseEnd,
|
||||||
MessageIntermediate,
|
MessageIntermediate,
|
||||||
MessageCurrentTest, INTERNAL_MESSAGES_END = MessageCurrentTest,
|
MessageCurrentTest, INTERNAL_MESSAGES_END = MessageCurrentTest,
|
||||||
@@ -69,12 +70,14 @@ enum Type {
|
|||||||
class TestResult
|
class TestResult
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit TestResult();
|
TestResult();
|
||||||
explicit TestResult(const QString &name);
|
explicit TestResult(const QString &name);
|
||||||
|
TestResult(const QString &executable, const QString &name);
|
||||||
virtual ~TestResult() {}
|
virtual ~TestResult() {}
|
||||||
|
|
||||||
virtual const QString outputString(bool selected) const;
|
virtual const QString outputString(bool selected) const;
|
||||||
|
|
||||||
|
QString executable() const { return m_executable; }
|
||||||
QString name() const { return m_name; }
|
QString name() const { return m_name; }
|
||||||
Result::Type result() const { return m_result; }
|
Result::Type result() const { return m_result; }
|
||||||
QString description() const { return m_description; }
|
QString description() const { return m_description; }
|
||||||
@@ -97,6 +100,7 @@ public:
|
|||||||
virtual TestResult *createIntermediateResultFor(const TestResult *other);
|
virtual TestResult *createIntermediateResultFor(const TestResult *other);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QString m_executable;
|
||||||
QString m_name;
|
QString m_name;
|
||||||
Result::Type m_result = Result::Invalid;
|
Result::Type m_result = Result::Invalid;
|
||||||
QString m_description;
|
QString m_description;
|
||||||
|
@@ -41,8 +41,8 @@ const static int outputLimit = 100000;
|
|||||||
|
|
||||||
static bool isSummaryItem(Result::Type type)
|
static bool isSummaryItem(Result::Type type)
|
||||||
{
|
{
|
||||||
return type == Result::MessageTestCaseSuccess || type == Result::MessageTestCaseFail
|
return type == Result::MessageTestCaseSuccess || type == Result::MessageTestCaseSuccessWarn
|
||||||
|| type == Result::MessageTestCaseWarn;
|
|| type == Result::MessageTestCaseFail || type == Result::MessageTestCaseFailWarn;
|
||||||
}
|
}
|
||||||
|
|
||||||
TestResultDelegate::TestResultDelegate(QObject *parent)
|
TestResultDelegate::TestResultDelegate(QObject *parent)
|
||||||
|
@@ -61,6 +61,8 @@ static QIcon testResultIcon(Result::Type result) {
|
|||||||
Icons::RESULT_MESSAGEWARN.icon(),
|
Icons::RESULT_MESSAGEWARN.icon(),
|
||||||
Icons::RESULT_MESSAGEFATAL.icon(),
|
Icons::RESULT_MESSAGEFATAL.icon(),
|
||||||
Icons::RESULT_MESSAGEFATAL.icon(), // System gets same handling as Fatal for now
|
Icons::RESULT_MESSAGEFATAL.icon(), // System gets same handling as Fatal for now
|
||||||
|
Icons::RESULT_MESSAGEPASSWARN.icon(),
|
||||||
|
Icons::RESULT_MESSAGEFAILWARN.icon(),
|
||||||
}; // provide an icon for unknown??
|
}; // provide an icon for unknown??
|
||||||
|
|
||||||
if (result < 0 || result >= Result::MessageInternal) {
|
if (result < 0 || result >= Result::MessageInternal) {
|
||||||
@@ -69,8 +71,10 @@ static QIcon testResultIcon(Result::Type result) {
|
|||||||
return icons[Result::Pass];
|
return icons[Result::Pass];
|
||||||
case Result::MessageTestCaseFail:
|
case Result::MessageTestCaseFail:
|
||||||
return icons[Result::Fail];
|
return icons[Result::Fail];
|
||||||
case Result::MessageTestCaseWarn:
|
case Result::MessageTestCaseSuccessWarn:
|
||||||
return icons[Result::MessageWarn];
|
return icons[13];
|
||||||
|
case Result::MessageTestCaseFailWarn:
|
||||||
|
return icons[14];
|
||||||
default:
|
default:
|
||||||
return QIcon();
|
return QIcon();
|
||||||
}
|
}
|
||||||
@@ -103,6 +107,7 @@ void TestResultItem::updateResult()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
Result::Type newResult = Result::MessageTestCaseSuccess;
|
Result::Type newResult = Result::MessageTestCaseSuccess;
|
||||||
|
bool withWarning = false;
|
||||||
for (Utils::TreeItem *child : *this) {
|
for (Utils::TreeItem *child : *this) {
|
||||||
const TestResult *current = static_cast<TestResultItem *>(child)->testResult();
|
const TestResult *current = static_cast<TestResultItem *>(child)->testResult();
|
||||||
if (current) {
|
if (current) {
|
||||||
@@ -111,21 +116,28 @@ void TestResultItem::updateResult()
|
|||||||
case Result::MessageFatal:
|
case Result::MessageFatal:
|
||||||
case Result::UnexpectedPass:
|
case Result::UnexpectedPass:
|
||||||
case Result::MessageTestCaseFail:
|
case Result::MessageTestCaseFail:
|
||||||
m_testResult->setResult(Result::MessageTestCaseFail);
|
newResult = Result::MessageTestCaseFail;
|
||||||
return;
|
break;
|
||||||
case Result::ExpectedFail:
|
case Result::ExpectedFail:
|
||||||
case Result::MessageWarn:
|
case Result::MessageWarn:
|
||||||
case Result::Skip:
|
case Result::Skip:
|
||||||
case Result::BlacklistedFail:
|
case Result::BlacklistedFail:
|
||||||
case Result::BlacklistedPass:
|
case Result::BlacklistedPass:
|
||||||
case Result::MessageTestCaseWarn:
|
case Result::MessageTestCaseSuccessWarn:
|
||||||
newResult = Result::MessageTestCaseWarn;
|
case Result::MessageTestCaseFailWarn:
|
||||||
|
withWarning = true;
|
||||||
break;
|
break;
|
||||||
default: {}
|
default: {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (withWarning) {
|
||||||
|
m_testResult->setResult(newResult == Result::MessageTestCaseSuccess
|
||||||
|
? Result::MessageTestCaseSuccessWarn
|
||||||
|
: Result::MessageTestCaseFailWarn);
|
||||||
|
} else {
|
||||||
m_testResult->setResult(newResult);
|
m_testResult->setResult(newResult);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestResultItem::updateIntermediateChildren()
|
void TestResultItem::updateIntermediateChildren()
|
||||||
@@ -295,11 +307,13 @@ TestResultItem *TestResultModel::findParentItemFor(const TestResultItem *item,
|
|||||||
TestResultItem *root = startItem ? const_cast<TestResultItem *>(startItem) : nullptr;
|
TestResultItem *root = startItem ? const_cast<TestResultItem *>(startItem) : nullptr;
|
||||||
const TestResult *result = item->testResult();
|
const TestResult *result = item->testResult();
|
||||||
const QString &name = result->name();
|
const QString &name = result->name();
|
||||||
|
const QString &executable = result->executable();
|
||||||
|
|
||||||
if (root == nullptr && !name.isEmpty()) {
|
if (root == nullptr && !name.isEmpty()) {
|
||||||
for (int row = rootItem()->childCount() - 1; row >= 0; --row) {
|
for (int row = rootItem()->childCount() - 1; row >= 0; --row) {
|
||||||
TestResultItem *tmp = static_cast<TestResultItem *>(rootItem()->childAt(row));
|
TestResultItem *tmp = static_cast<TestResultItem *>(rootItem()->childAt(row));
|
||||||
if (tmp->testResult()->name() == name) {
|
auto tmpTestResult = tmp->testResult();
|
||||||
|
if (tmpTestResult->executable() == executable && tmpTestResult->name() == name) {
|
||||||
root = tmp;
|
root = tmp;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -344,8 +358,9 @@ void TestResultFilterModel::enableAllResultTypes()
|
|||||||
<< Result::MessageFatal << Result::Invalid << Result::BlacklistedPass
|
<< Result::MessageFatal << Result::Invalid << Result::BlacklistedPass
|
||||||
<< Result::BlacklistedFail << Result::Benchmark << Result::MessageIntermediate
|
<< Result::BlacklistedFail << Result::Benchmark << Result::MessageIntermediate
|
||||||
<< Result::MessageCurrentTest << Result::MessageTestCaseStart
|
<< Result::MessageCurrentTest << Result::MessageTestCaseStart
|
||||||
<< Result::MessageTestCaseSuccess << Result::MessageTestCaseWarn
|
<< Result::MessageTestCaseSuccess << Result::MessageTestCaseSuccessWarn
|
||||||
<< Result::MessageTestCaseFail << Result::MessageTestCaseEnd
|
<< Result::MessageTestCaseFail << Result::MessageTestCaseFailWarn
|
||||||
|
<< Result::MessageTestCaseEnd
|
||||||
<< Result::MessageInfo << Result::MessageSystem;
|
<< Result::MessageInfo << Result::MessageSystem;
|
||||||
invalidateFilter();
|
invalidateFilter();
|
||||||
}
|
}
|
||||||
@@ -393,7 +408,8 @@ bool TestResultFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &s
|
|||||||
case Result::MessageTestCaseSuccess:
|
case Result::MessageTestCaseSuccess:
|
||||||
return m_enabled.contains(Result::Pass);
|
return m_enabled.contains(Result::Pass);
|
||||||
case Result::MessageTestCaseFail:
|
case Result::MessageTestCaseFail:
|
||||||
case Result::MessageTestCaseWarn:
|
case Result::MessageTestCaseSuccessWarn:
|
||||||
|
case Result::MessageTestCaseFailWarn:
|
||||||
return acceptTestCaseResult(index);
|
return acceptTestCaseResult(index);
|
||||||
default:
|
default:
|
||||||
return m_enabled.contains(resultType);
|
return m_enabled.contains(resultType);
|
||||||
@@ -407,7 +423,8 @@ bool TestResultFilterModel::acceptTestCaseResult(const QModelIndex &srcIndex) co
|
|||||||
Result::Type type = m_sourceModel->testResult(child)->result();
|
Result::Type type = m_sourceModel->testResult(child)->result();
|
||||||
if (type == Result::MessageTestCaseSuccess)
|
if (type == Result::MessageTestCaseSuccess)
|
||||||
type = Result::Pass;
|
type = Result::Pass;
|
||||||
if (type == Result::MessageTestCaseFail || type == Result::MessageTestCaseWarn) {
|
if (type == Result::MessageTestCaseFail || type == Result::MessageTestCaseFailWarn
|
||||||
|
|| type == Result::MessageTestCaseSuccessWarn) {
|
||||||
if (acceptTestCaseResult(child))
|
if (acceptTestCaseResult(child))
|
||||||
return true;
|
return true;
|
||||||
} else if (m_enabled.contains(type)) {
|
} else if (m_enabled.contains(type)) {
|
||||||
|
@@ -43,9 +43,9 @@ QtcPlugin {
|
|||||||
"clangassistproposalmodel.h",
|
"clangassistproposalmodel.h",
|
||||||
"clangbackendipcintegration.cpp",
|
"clangbackendipcintegration.cpp",
|
||||||
"clangbackendipcintegration.h",
|
"clangbackendipcintegration.h",
|
||||||
"clangcodemodel.qrc",
|
|
||||||
"clangcodemodelplugin.cpp",
|
"clangcodemodelplugin.cpp",
|
||||||
"clangcodemodelplugin.h",
|
"clangcodemodelplugin.h",
|
||||||
|
"clangcodemodel.qrc",
|
||||||
"clangcompletionassistinterface.cpp",
|
"clangcompletionassistinterface.cpp",
|
||||||
"clangcompletionassistinterface.h",
|
"clangcompletionassistinterface.h",
|
||||||
"clangcompletionassistprocessor.cpp",
|
"clangcompletionassistprocessor.cpp",
|
||||||
|
@@ -72,6 +72,18 @@ bool ClangQueryHighlighter::hasDiagnostics() const
|
|||||||
return m_marker.hasMessagesOrContexts();
|
return m_marker.hasMessagesOrContexts();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ClangBackEnd::DynamicASTMatcherDiagnosticMessageContainers
|
||||||
|
ClangQueryHighlighter::messagesForLineAndColumn(uint line, uint column) const
|
||||||
|
{
|
||||||
|
return m_marker.messagesForLineAndColumn(line, column);
|
||||||
|
}
|
||||||
|
|
||||||
|
ClangBackEnd::DynamicASTMatcherDiagnosticContextContainers
|
||||||
|
ClangQueryHighlighter::contextsForLineAndColumn(uint line, uint column) const
|
||||||
|
{
|
||||||
|
return m_marker.contextsForLineAndColumn(line, column);
|
||||||
|
}
|
||||||
|
|
||||||
void ClangQueryHighlighter::highlightBlock(const QString &text)
|
void ClangQueryHighlighter::highlightBlock(const QString &text)
|
||||||
{
|
{
|
||||||
int currentLineNumber = currentBlock().blockNumber() + 1;
|
int currentLineNumber = currentBlock().blockNumber() + 1;
|
||||||
|
@@ -44,6 +44,12 @@ public:
|
|||||||
|
|
||||||
bool hasDiagnostics() const;
|
bool hasDiagnostics() const;
|
||||||
|
|
||||||
|
ClangBackEnd::DynamicASTMatcherDiagnosticMessageContainers
|
||||||
|
messagesForLineAndColumn(uint line, uint column) const;
|
||||||
|
|
||||||
|
ClangBackEnd::DynamicASTMatcherDiagnosticContextContainers
|
||||||
|
contextsForLineAndColumn(uint line, uint column) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void highlightBlock(const QString &text) override;
|
void highlightBlock(const QString &text) override;
|
||||||
|
|
||||||
|
@@ -250,6 +250,85 @@ public:
|
|||||||
return !m_messages.empty() || !m_contexts.empty();
|
return !m_messages.empty() || !m_contexts.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
bool isAfterStartColumn(const SourceRange &sourceRange, uint line, uint column)
|
||||||
|
{
|
||||||
|
return sourceRange.start().line() == line && sourceRange.start().column() <= column;
|
||||||
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
bool isBeforeEndColumn(const SourceRange &sourceRange, uint line, uint column)
|
||||||
|
{
|
||||||
|
return sourceRange.end().line() == line && sourceRange.end().column() >= column;
|
||||||
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
bool isInBetweenLine(const SourceRange &sourceRange, uint line)
|
||||||
|
{
|
||||||
|
return sourceRange.start().line() < line && sourceRange.end().line() > line;
|
||||||
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
bool isSingleLine(const SourceRange &sourceRange)
|
||||||
|
{
|
||||||
|
return sourceRange.start().line() == sourceRange.end().line();
|
||||||
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
bool isInsideMultiLine(const SourceRange &sourceRange, uint line, uint column)
|
||||||
|
{
|
||||||
|
return !isSingleLine(sourceRange)
|
||||||
|
&& (isAfterStartColumn(sourceRange, line, column)
|
||||||
|
|| isInBetweenLine(sourceRange, line)
|
||||||
|
|| isBeforeEndColumn(sourceRange, line, column));
|
||||||
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
bool isInsideSingleLine(const SourceRange &sourceRange, uint line, uint column)
|
||||||
|
{
|
||||||
|
return isSingleLine(sourceRange)
|
||||||
|
&& isAfterStartColumn(sourceRange, line, column)
|
||||||
|
&& isBeforeEndColumn(sourceRange, line, column);
|
||||||
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
bool isInsideRange(const SourceRange &sourceRange, uint line, uint column)
|
||||||
|
{
|
||||||
|
return isInsideSingleLine(sourceRange, line, column)
|
||||||
|
|| isInsideMultiLine(sourceRange, line, column);
|
||||||
|
}
|
||||||
|
|
||||||
|
Messages messagesForLineAndColumn(uint line, uint column) const
|
||||||
|
{
|
||||||
|
Messages messages;
|
||||||
|
|
||||||
|
auto underPosition = [=] (const Message &message) {
|
||||||
|
return ClangQueryHighlightMarker::isInsideRange(message.sourceRange(), line, column);
|
||||||
|
};
|
||||||
|
|
||||||
|
std::copy_if(m_messages.begin(),
|
||||||
|
m_messages.end(),
|
||||||
|
std::back_inserter(messages),
|
||||||
|
underPosition);
|
||||||
|
|
||||||
|
return messages;
|
||||||
|
}
|
||||||
|
|
||||||
|
Contexts contextsForLineAndColumn(uint line, uint column) const
|
||||||
|
{
|
||||||
|
Contexts contexts;
|
||||||
|
|
||||||
|
auto underPosition = [=] (const Context &context) {
|
||||||
|
return ClangQueryHighlightMarker::isInsideRange(context.sourceRange(), line, column);
|
||||||
|
};
|
||||||
|
|
||||||
|
std::copy_if(m_contexts.begin(),
|
||||||
|
m_contexts.end(),
|
||||||
|
std::back_inserter(contexts),
|
||||||
|
underPosition);
|
||||||
|
|
||||||
|
return contexts;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Contexts m_contexts;
|
Contexts m_contexts;
|
||||||
|
60
src/plugins/clangrefactoring/clangqueryhoverhandler.cpp
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2017 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 3 as published by the Free Software
|
||||||
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "clangqueryhoverhandler.h"
|
||||||
|
|
||||||
|
#include "clangqueryhighlighter.h"
|
||||||
|
|
||||||
|
#include <dynamicastmatcherdiagnosticmessagecontainer.h>
|
||||||
|
|
||||||
|
#include <texteditor/texteditor.h>
|
||||||
|
|
||||||
|
namespace ClangRefactoring {
|
||||||
|
|
||||||
|
ClangQueryHoverHandler::ClangQueryHoverHandler(ClangQueryHighlighter *highligher)
|
||||||
|
: m_highligher(highligher)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void ClangQueryHoverHandler::identifyMatch(TextEditor::TextEditorWidget *editorWidget, int position)
|
||||||
|
{
|
||||||
|
using Messages = ClangBackEnd::DynamicASTMatcherDiagnosticMessageContainers;
|
||||||
|
using Contexts = ClangBackEnd::DynamicASTMatcherDiagnosticContextContainers;
|
||||||
|
|
||||||
|
QTextCursor textCursor = editorWidget->textCursor();
|
||||||
|
textCursor.setPosition(position);
|
||||||
|
int line = textCursor.blockNumber() + 1;
|
||||||
|
int column = textCursor.columnNumber() + 1;
|
||||||
|
|
||||||
|
Messages messages = m_highligher->messagesForLineAndColumn(uint(line), uint(column));
|
||||||
|
Contexts contexts = m_highligher->contextsForLineAndColumn(uint(line), uint(column));
|
||||||
|
|
||||||
|
if (!messages.empty())
|
||||||
|
setToolTip(QString("%1: %2").arg(messages[0].errorTypeText()).arg(messages[0].arguments().join(", ")));
|
||||||
|
else if (!contexts.empty())
|
||||||
|
setToolTip(QString("%1: %2").arg(contexts[0].contextTypeText()).arg(contexts[0].arguments().join(", ")));
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace ClangRefactoring
|
46
src/plugins/clangrefactoring/clangqueryhoverhandler.h
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2017 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 3 as published by the Free Software
|
||||||
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <texteditor/basehoverhandler.h>
|
||||||
|
|
||||||
|
namespace ClangRefactoring {
|
||||||
|
|
||||||
|
class ClangQueryHighlighter;
|
||||||
|
|
||||||
|
class ClangQueryHoverHandler : public TextEditor::BaseHoverHandler
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ClangQueryHoverHandler(ClangQueryHighlighter *highligher);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void identifyMatch(TextEditor::TextEditorWidget *editorWidget, int position) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
ClangQueryHighlighter *m_highligher;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace ClangRefactoring
|
@@ -85,7 +85,7 @@ void ClangQueryProjectsFindFilter::requestSourceRangesAndDiagnostics(const QStri
|
|||||||
ClangBackEnd::RequestSourceRangesAndDiagnosticsForQueryMessage message(queryText,
|
ClangBackEnd::RequestSourceRangesAndDiagnosticsForQueryMessage message(queryText,
|
||||||
{ClangBackEnd::FilePath(filePath),
|
{ClangBackEnd::FilePath(filePath),
|
||||||
exampleContent,
|
exampleContent,
|
||||||
{"cc", toNative(filePath)}});
|
{"cc", "-std=c++1z", toNative(filePath)}});
|
||||||
|
|
||||||
m_server.requestSourceRangesAndDiagnosticsForQueryMessage(std::move(message));
|
m_server.requestSourceRangesAndDiagnosticsForQueryMessage(std::move(message));
|
||||||
}
|
}
|
||||||
|
@@ -26,19 +26,24 @@
|
|||||||
#include "clangquerytexteditorwidget.h"
|
#include "clangquerytexteditorwidget.h"
|
||||||
|
|
||||||
#include "clangqueryhighlighter.h"
|
#include "clangqueryhighlighter.h"
|
||||||
|
#include "clangqueryhoverhandler.h"
|
||||||
|
|
||||||
#include <texteditor/textdocument.h>
|
#include <texteditor/textdocument.h>
|
||||||
|
|
||||||
namespace ClangRefactoring {
|
namespace ClangRefactoring {
|
||||||
|
|
||||||
ClangQueryTextEditorWidget::ClangQueryTextEditorWidget(QWidget *parent)
|
ClangQueryTextEditorWidget::ClangQueryTextEditorWidget(QWidget *parent)
|
||||||
: BaseClangQueryTextEditorWidget(parent)
|
: BaseClangQueryTextEditorWidget(parent),
|
||||||
|
m_syntaxHighlighter(new ClangQueryHighlighter),
|
||||||
|
m_hoverHandler(std::make_unique<ClangQueryHoverHandler>(m_syntaxHighlighter))
|
||||||
{
|
{
|
||||||
m_syntaxHighlighter = new ClangQueryHighlighter;
|
|
||||||
|
|
||||||
textDocument()->setSyntaxHighlighter(m_syntaxHighlighter);
|
textDocument()->setSyntaxHighlighter(m_syntaxHighlighter);
|
||||||
|
|
||||||
|
addHoverHandler(m_hoverHandler.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ClangQueryTextEditorWidget::~ClangQueryTextEditorWidget() = default;
|
||||||
|
|
||||||
ClangQueryHighlighter *ClangQueryTextEditorWidget::syntaxHighlighter() const
|
ClangQueryHighlighter *ClangQueryTextEditorWidget::syntaxHighlighter() const
|
||||||
{
|
{
|
||||||
return m_syntaxHighlighter;
|
return m_syntaxHighlighter;
|
||||||
|
@@ -27,9 +27,12 @@
|
|||||||
|
|
||||||
#include "baseclangquerytexteditorwidget.h"
|
#include "baseclangquerytexteditorwidget.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
namespace ClangRefactoring {
|
namespace ClangRefactoring {
|
||||||
|
|
||||||
class ClangQueryHighlighter;
|
class ClangQueryHighlighter;
|
||||||
|
class ClangQueryHoverHandler;
|
||||||
|
|
||||||
class ClangQueryTextEditorWidget : public BaseClangQueryTextEditorWidget
|
class ClangQueryTextEditorWidget : public BaseClangQueryTextEditorWidget
|
||||||
{
|
{
|
||||||
@@ -37,11 +40,13 @@ class ClangQueryTextEditorWidget : public BaseClangQueryTextEditorWidget
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
ClangQueryTextEditorWidget(QWidget *parent);
|
ClangQueryTextEditorWidget(QWidget *parent);
|
||||||
|
~ClangQueryTextEditorWidget();
|
||||||
|
|
||||||
ClangQueryHighlighter *syntaxHighlighter() const;
|
ClangQueryHighlighter *syntaxHighlighter() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ClangQueryHighlighter *m_syntaxHighlighter;
|
ClangQueryHighlighter *m_syntaxHighlighter;
|
||||||
|
std::unique_ptr<ClangQueryHoverHandler> m_hoverHandler;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ClangRefactoring
|
} // namespace ClangRefactoring
|
||||||
|
@@ -14,7 +14,8 @@ HEADERS += \
|
|||||||
clangqueryprojectsfindfilterwidget.h \
|
clangqueryprojectsfindfilterwidget.h \
|
||||||
clangqueryexampletexteditorwidget.h \
|
clangqueryexampletexteditorwidget.h \
|
||||||
clangquerytexteditorwidget.h \
|
clangquerytexteditorwidget.h \
|
||||||
baseclangquerytexteditorwidget.h
|
baseclangquerytexteditorwidget.h \
|
||||||
|
clangqueryhoverhandler.h
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
clangrefactoringplugin.cpp \
|
clangrefactoringplugin.cpp \
|
||||||
@@ -24,7 +25,8 @@ SOURCES += \
|
|||||||
clangqueryprojectsfindfilterwidget.cpp \
|
clangqueryprojectsfindfilterwidget.cpp \
|
||||||
clangqueryexampletexteditorwidget.cpp \
|
clangqueryexampletexteditorwidget.cpp \
|
||||||
clangquerytexteditorwidget.cpp \
|
clangquerytexteditorwidget.cpp \
|
||||||
baseclangquerytexteditorwidget.cpp
|
baseclangquerytexteditorwidget.cpp \
|
||||||
|
clangqueryhoverhandler.cpp
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
clangqueryprojectsfindfilter.ui
|
clangqueryprojectsfindfilter.ui
|
||||||
|
@@ -19,13 +19,13 @@
|
|||||||
\"Url\" : \"http://www.qt.io\",
|
\"Url\" : \"http://www.qt.io\",
|
||||||
$$dependencyList,
|
$$dependencyList,
|
||||||
|
|
||||||
\"Mimetypes\" : \"
|
\"Mimetypes\" : [
|
||||||
<?xml version=\'1.0\'?>
|
\"<?xml version=\'1.0\'?>\",
|
||||||
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
|
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
|
||||||
<mime-type type=\'application/vnd.audc.text.clearcase.submit\'>
|
\" <mime-type type=\'application/vnd.audc.text.clearcase.submit\'>\",
|
||||||
<comment>ClearCase submit template</comment>
|
\" <comment>ClearCase submit template</comment>\",
|
||||||
<sub-class-of type=\'text/plain\'/>
|
\" <sub-class-of type=\'text/plain\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
</mime-info>
|
\"</mime-info>\"
|
||||||
\"
|
]
|
||||||
}
|
}
|
||||||
|
@@ -17,19 +17,19 @@
|
|||||||
\"Url\" : \"http://www.qt.io\",
|
\"Url\" : \"http://www.qt.io\",
|
||||||
$$dependencyList,
|
$$dependencyList,
|
||||||
|
|
||||||
\"Mimetypes\" : \"
|
\"Mimetypes\" : [
|
||||||
<?xml version=\'1.0\'?>
|
\"<?xml version=\'1.0\'?>\",
|
||||||
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
|
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
|
||||||
<mime-type type=\'text/x-cmake\'>
|
\" <mime-type type=\'text/x-cmake\'>\",
|
||||||
<sub-class-of type=\'text/plain\'/>
|
\" <sub-class-of type=\'text/plain\'/>\",
|
||||||
<comment>CMake Project file</comment>
|
\" <comment>CMake Project file</comment>\",
|
||||||
<glob pattern=\'*.cmake\'/>
|
\" <glob pattern=\'*.cmake\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
<mime-type type=\'text/x-cmake-project\'>
|
\" <mime-type type=\'text/x-cmake-project\'>\",
|
||||||
<sub-class-of type=\'text/x-cmake\'/>
|
\" <sub-class-of type=\'text/x-cmake\'/>\",
|
||||||
<comment>CMake Project file</comment>
|
\" <comment>CMake Project file</comment>\",
|
||||||
<glob pattern=\'CMakeLists.txt\'/>
|
\" <glob pattern=\'CMakeLists.txt\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
</mime-info>
|
\"</mime-info>\"
|
||||||
\"
|
]
|
||||||
}
|
}
|
||||||
|
@@ -61,6 +61,9 @@ private slots:
|
|||||||
|
|
||||||
void testCMakeProjectImporterToolChain_data();
|
void testCMakeProjectImporterToolChain_data();
|
||||||
void testCMakeProjectImporterToolChain();
|
void testCMakeProjectImporterToolChain();
|
||||||
|
|
||||||
|
void testServerModeReaderProgress_data();
|
||||||
|
void testServerModeReaderProgress();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -417,8 +417,7 @@ void ServerModeReader::handleProgress(int min, int cur, int max, const QString &
|
|||||||
|
|
||||||
if (!m_future)
|
if (!m_future)
|
||||||
return;
|
return;
|
||||||
int progress = m_progressStepMinimum
|
const int progress = calculateProgress(m_progressStepMinimum, min, cur, max, m_progressStepMaximum);
|
||||||
+ (((max - min) / (cur - min)) * (m_progressStepMaximum - m_progressStepMinimum));
|
|
||||||
m_future->setProgressValue(progress);
|
m_future->setProgressValue(progress);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -430,6 +429,14 @@ void ServerModeReader::handleSignal(const QString &signal, const QVariantMap &da
|
|||||||
emit dirty();
|
emit dirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ServerModeReader::calculateProgress(const int minRange, const int min, const int cur, const int max, const int maxRange)
|
||||||
|
{
|
||||||
|
if (minRange == maxRange || min == max)
|
||||||
|
return minRange;
|
||||||
|
const int clampedCur = std::min(std::max(cur, min), max);
|
||||||
|
return minRange + ((clampedCur - min) / (max - min)) * (maxRange - minRange);
|
||||||
|
}
|
||||||
|
|
||||||
void ServerModeReader::extractCodeModelData(const QVariantMap &data)
|
void ServerModeReader::extractCodeModelData(const QVariantMap &data)
|
||||||
{
|
{
|
||||||
const QVariantList configs = data.value("configurations").toList();
|
const QVariantList configs = data.value("configurations").toList();
|
||||||
@@ -880,3 +887,59 @@ void ServerModeReader::addHeaderNodes(ProjectNode *root, const QList<FileNode *>
|
|||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace CMakeProjectManager
|
} // namespace CMakeProjectManager
|
||||||
|
|
||||||
|
#if defined(WITH_TESTS)
|
||||||
|
|
||||||
|
#include "cmakeprojectplugin.h"
|
||||||
|
#include <QTest>
|
||||||
|
|
||||||
|
namespace CMakeProjectManager {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
|
void CMakeProjectPlugin::testServerModeReaderProgress_data()
|
||||||
|
{
|
||||||
|
QTest::addColumn<int>("minRange");
|
||||||
|
QTest::addColumn<int>("min");
|
||||||
|
QTest::addColumn<int>("cur");
|
||||||
|
QTest::addColumn<int>("max");
|
||||||
|
QTest::addColumn<int>("maxRange");
|
||||||
|
QTest::addColumn<int>("expected");
|
||||||
|
|
||||||
|
QTest::newRow("empty range") << 100 << 10 << 11 << 20 << 100 << 100;
|
||||||
|
QTest::newRow("one range (low)") << 0 << 10 << 11 << 20 << 1 << 0;
|
||||||
|
QTest::newRow("one range (high)") << 20 << 10 << 19 << 20 << 20 << 20;
|
||||||
|
QTest::newRow("large range") << 30 << 10 << 11 << 20 << 100000 << 30;
|
||||||
|
|
||||||
|
QTest::newRow("empty progress") << -5 << 10 << 10 << 10 << 99995 << -5;
|
||||||
|
QTest::newRow("one progress (low)") << 42 << 10 << 10 << 11 << 100042 << 42;
|
||||||
|
QTest::newRow("one progress (high)") << 0 << 10 << 11 << 11 << 100000 << 100000;
|
||||||
|
QTest::newRow("large progress") << 0 << 10 << 10 << 11 << 100000 << 0;
|
||||||
|
|
||||||
|
QTest::newRow("cur too low") << 0 << 10 << 9 << 100 << 100000 << 0;
|
||||||
|
QTest::newRow("cur too high") << 0 << 10 << 101 << 100 << 100000 << 100000;
|
||||||
|
QTest::newRow("cur much too low") << 0 << 10 << -1000 << 100 << 100000 << 0;
|
||||||
|
QTest::newRow("cur much too high") << 0 << 10 << 1110000 << 100 << 100000 << 100000;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CMakeProjectPlugin::testServerModeReaderProgress()
|
||||||
|
{
|
||||||
|
QFETCH(int, minRange);
|
||||||
|
QFETCH(int, min);
|
||||||
|
QFETCH(int, cur);
|
||||||
|
QFETCH(int, max);
|
||||||
|
QFETCH(int, maxRange);
|
||||||
|
QFETCH(int, expected);
|
||||||
|
|
||||||
|
ServerModeReader reader;
|
||||||
|
const int r = reader.calculateProgress(minRange, min, cur, max, maxRange);
|
||||||
|
|
||||||
|
QCOMPARE(r, expected);
|
||||||
|
|
||||||
|
QVERIFY(r <= maxRange);
|
||||||
|
QVERIFY(r >= minRange);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Internal
|
||||||
|
} // namespace CMakeProjectManager
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@@ -69,6 +69,10 @@ private:
|
|||||||
void handleProgress(int min, int cur, int max, const QString &inReplyTo);
|
void handleProgress(int min, int cur, int max, const QString &inReplyTo);
|
||||||
void handleSignal(const QString &signal, const QVariantMap &data);
|
void handleSignal(const QString &signal, const QVariantMap &data);
|
||||||
|
|
||||||
|
int calculateProgress(const int minRange, const int min,
|
||||||
|
const int cur,
|
||||||
|
const int max, const int maxRange);
|
||||||
|
|
||||||
struct Target;
|
struct Target;
|
||||||
struct Project;
|
struct Project;
|
||||||
|
|
||||||
@@ -175,6 +179,10 @@ private:
|
|||||||
QList<FileGroup *> m_fileGroups;
|
QList<FileGroup *> m_fileGroups;
|
||||||
|
|
||||||
CMakeParser m_parser;
|
CMakeParser m_parser;
|
||||||
|
|
||||||
|
#if defined(WITH_TESTS)
|
||||||
|
friend class CMakeProjectPlugin;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -131,8 +131,9 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
|||||||
continue;
|
continue;
|
||||||
const QJsonObject metaData = plugin->metaData();
|
const QJsonObject metaData = plugin->metaData();
|
||||||
const QJsonValue mimetypes = metaData.value("Mimetypes");
|
const QJsonValue mimetypes = metaData.value("Mimetypes");
|
||||||
if (mimetypes.isString())
|
QString mimetypeString;
|
||||||
Utils::addMimeTypes(plugin->name() + ".mimetypes", mimetypes.toString().trimmed().toUtf8());
|
if (ExtensionSystem::PluginSpec::readMultiLineString(mimetypes, &mimetypeString))
|
||||||
|
Utils::addMimeTypes(plugin->name() + ".mimetypes", mimetypeString.trimmed().toUtf8());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ThemeEntry::availableThemes().isEmpty()) {
|
if (ThemeEntry::availableThemes().isEmpty()) {
|
||||||
|
@@ -369,6 +369,28 @@ IWizardFactory *NewDialog::currentWizardFactory() const
|
|||||||
return factoryOfItem(m_model->itemFromIndex(index));
|
return factoryOfItem(m_model->itemFromIndex(index));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static QIcon iconWithText(const QIcon &icon, const QString &text)
|
||||||
|
{
|
||||||
|
if (text.isEmpty())
|
||||||
|
return icon;
|
||||||
|
QIcon iconWithText;
|
||||||
|
for (const QSize &pixmapSize : icon.availableSizes()) {
|
||||||
|
QPixmap pixmap = icon.pixmap(pixmapSize);
|
||||||
|
const int fontSize = pixmap.height() / 4;
|
||||||
|
const int margin = pixmap.height() / 8;
|
||||||
|
QFont font;
|
||||||
|
font.setPixelSize(fontSize);
|
||||||
|
font.setStretch(85);
|
||||||
|
QPainter p(&pixmap);
|
||||||
|
p.setFont(font);
|
||||||
|
QTextOption textOption(Qt::AlignHCenter | Qt::AlignBottom);
|
||||||
|
textOption.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
|
||||||
|
p.drawText(pixmap.rect().adjusted(margin, margin, -margin, -margin), text, textOption);
|
||||||
|
iconWithText.addPixmap(pixmap);
|
||||||
|
}
|
||||||
|
return iconWithText;
|
||||||
|
}
|
||||||
|
|
||||||
void NewDialog::addItem(QStandardItem *topLevelCategoryItem, IWizardFactory *factory)
|
void NewDialog::addItem(QStandardItem *topLevelCategoryItem, IWizardFactory *factory)
|
||||||
{
|
{
|
||||||
const QString categoryName = factory->category();
|
const QString categoryName = factory->category();
|
||||||
@@ -394,7 +416,7 @@ void NewDialog::addItem(QStandardItem *topLevelCategoryItem, IWizardFactory *fac
|
|||||||
wizardIcon = m_dummyIcon;
|
wizardIcon = m_dummyIcon;
|
||||||
else
|
else
|
||||||
wizardIcon = factory->icon();
|
wizardIcon = factory->icon();
|
||||||
wizardItem->setIcon(wizardIcon);
|
wizardItem->setIcon(iconWithText(wizardIcon, factory->iconText()));
|
||||||
wizardItem->setData(QVariant::fromValue(WizardFactoryContainer(factory, 0)), Qt::UserRole);
|
wizardItem->setData(QVariant::fromValue(WizardFactoryContainer(factory, 0)), Qt::UserRole);
|
||||||
wizardItem->setFlags(Qt::ItemIsEnabled|Qt::ItemIsSelectable);
|
wizardItem->setFlags(Qt::ItemIsEnabled|Qt::ItemIsSelectable);
|
||||||
categoryItem->appendRow(wizardItem);
|
categoryItem->appendRow(wizardItem);
|
||||||
|
@@ -264,12 +264,12 @@ void FindToolWindow::setCurrentFilter(int index)
|
|||||||
|
|
||||||
void FindToolWindow::acceptAndGetParameters(QString *term, IFindFilter **filter)
|
void FindToolWindow::acceptAndGetParameters(QString *term, IFindFilter **filter)
|
||||||
{
|
{
|
||||||
if (filter)
|
QTC_ASSERT(filter, return);
|
||||||
*filter = 0;
|
*filter = 0;
|
||||||
Find::updateFindCompletion(m_ui.searchTerm->text());
|
Find::updateFindCompletion(m_ui.searchTerm->text());
|
||||||
int index = m_ui.filterList->currentIndex();
|
int index = m_ui.filterList->currentIndex();
|
||||||
QString searchTerm = m_ui.searchTerm->text();
|
QString searchTerm = m_ui.searchTerm->text();
|
||||||
if (filter && index >= 0)
|
if (index >= 0)
|
||||||
*filter = m_filters.at(index);
|
*filter = m_filters.at(index);
|
||||||
if (term)
|
if (term)
|
||||||
*term = searchTerm;
|
*term = searchTerm;
|
||||||
|
@@ -60,6 +60,7 @@ public:
|
|||||||
Id id() const { return m_id; }
|
Id id() const { return m_id; }
|
||||||
WizardKind kind() const { return m_supportedProjectTypes.isEmpty() ? FileWizard : ProjectWizard; }
|
WizardKind kind() const { return m_supportedProjectTypes.isEmpty() ? FileWizard : ProjectWizard; }
|
||||||
QIcon icon() const { return m_icon; }
|
QIcon icon() const { return m_icon; }
|
||||||
|
QString iconText() const { return m_iconText; }
|
||||||
QString description() const { return m_description; }
|
QString description() const { return m_description; }
|
||||||
QString displayName() const { return m_displayName; }
|
QString displayName() const { return m_displayName; }
|
||||||
QString category() const { return m_category; }
|
QString category() const { return m_category; }
|
||||||
@@ -72,6 +73,7 @@ public:
|
|||||||
void setId(const Id id) { m_id = id; }
|
void setId(const Id id) { m_id = id; }
|
||||||
void setSupportedProjectTypes(const QSet<Id> &projectTypes) { m_supportedProjectTypes = projectTypes; }
|
void setSupportedProjectTypes(const QSet<Id> &projectTypes) { m_supportedProjectTypes = projectTypes; }
|
||||||
void setIcon(const QIcon &icon) { m_icon = icon; }
|
void setIcon(const QIcon &icon) { m_icon = icon; }
|
||||||
|
void setIconText(const QString &iconText) { m_iconText = iconText; }
|
||||||
void setDescription(const QString &description) { m_description = description; }
|
void setDescription(const QString &description) { m_description = description; }
|
||||||
void setDisplayName(const QString &displayName) { m_displayName = displayName; }
|
void setDisplayName(const QString &displayName) { m_displayName = displayName; }
|
||||||
void setCategory(const QString &category) { m_category = category; }
|
void setCategory(const QString &category) { m_category = category; }
|
||||||
@@ -123,6 +125,7 @@ private:
|
|||||||
|
|
||||||
QAction *m_action = 0;
|
QAction *m_action = 0;
|
||||||
QIcon m_icon;
|
QIcon m_icon;
|
||||||
|
QString m_iconText;
|
||||||
QString m_description;
|
QString m_description;
|
||||||
QString m_displayName;
|
QString m_displayName;
|
||||||
QString m_category;
|
QString m_category;
|
||||||
|
@@ -27,6 +27,9 @@
|
|||||||
|
|
||||||
#include <cplusplus/MatchingText.h>
|
#include <cplusplus/MatchingText.h>
|
||||||
|
|
||||||
|
#include <texteditor/tabsettings.h>
|
||||||
|
|
||||||
|
#include <QTextBlock>
|
||||||
#include <QTextCursor>
|
#include <QTextCursor>
|
||||||
|
|
||||||
using namespace CppEditor;
|
using namespace CppEditor;
|
||||||
@@ -35,7 +38,9 @@ using namespace Internal;
|
|||||||
bool CppAutoCompleter::contextAllowsAutoBrackets(const QTextCursor &cursor,
|
bool CppAutoCompleter::contextAllowsAutoBrackets(const QTextCursor &cursor,
|
||||||
const QString &textToInsert) const
|
const QString &textToInsert) const
|
||||||
{
|
{
|
||||||
return CPlusPlus::MatchingText::contextAllowsAutoParentheses(cursor, textToInsert);
|
const CPlusPlus::MatchingText::IsNextBlockDeeperIndented isIndented
|
||||||
|
= [this](const QTextBlock &b) { return isNextBlockIndented(b); };
|
||||||
|
return CPlusPlus::MatchingText::contextAllowsAutoParentheses(cursor, textToInsert, isIndented);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CppAutoCompleter::contextAllowsAutoQuotes(const QTextCursor &cursor,
|
bool CppAutoCompleter::contextAllowsAutoQuotes(const QTextCursor &cursor,
|
||||||
|
@@ -70,7 +70,9 @@ CppLocalRenaming::CppLocalRenaming(TextEditor::TextEditorWidget *editorWidget)
|
|||||||
void CppLocalRenaming::updateSelectionsForVariableUnderCursor(
|
void CppLocalRenaming::updateSelectionsForVariableUnderCursor(
|
||||||
const QList<QTextEdit::ExtraSelection> &selections)
|
const QList<QTextEdit::ExtraSelection> &selections)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(!isActive(), return);
|
if (isActive())
|
||||||
|
return;
|
||||||
|
|
||||||
m_selections = selections;
|
m_selections = selections;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -94,6 +94,7 @@ void CppUseSelectionsUpdater::update(CallType callType)
|
|||||||
|
|
||||||
m_runnerWatcher->setFuture(cppEditorDocument->cursorInfo(params));
|
m_runnerWatcher->setFuture(cppEditorDocument->cursorInfo(params));
|
||||||
} else { // synchronous case
|
} else { // synchronous case
|
||||||
|
const int startRevision = cppEditorDocument->document()->revision();
|
||||||
QFuture<CursorInfo> future = cppEditorDocument->cursorInfo(params);
|
QFuture<CursorInfo> future = cppEditorDocument->cursorInfo(params);
|
||||||
|
|
||||||
// QFuture::waitForFinished seems to block completely, not even
|
// QFuture::waitForFinished seems to block completely, not even
|
||||||
@@ -102,6 +103,7 @@ void CppUseSelectionsUpdater::update(CallType callType)
|
|||||||
if (future.isCanceled())
|
if (future.isCanceled())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
QTC_ASSERT(startRevision == cppEditorDocument->document()->revision(), return);
|
||||||
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
|
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -18,101 +18,101 @@
|
|||||||
\"Url\" : \"http://www.qt.io\",
|
\"Url\" : \"http://www.qt.io\",
|
||||||
$$dependencyList,
|
$$dependencyList,
|
||||||
|
|
||||||
\"Mimetypes\" : \"
|
\"Mimetypes\" : [
|
||||||
<?xml version=\'1.0\' encoding=\'UTF-8\'?>
|
\"<?xml version=\'1.0\' encoding=\'UTF-8\'?>\",
|
||||||
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
|
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
|
||||||
<mime-type type=\'text/x-csrc\'>
|
\" <mime-type type=\'text/x-csrc\'>\",
|
||||||
<comment>C source code</comment>
|
\" <comment>C source code</comment>\",
|
||||||
<sub-class-of type=\'text/plain\'/>
|
\" <sub-class-of type=\'text/plain\'/>\",
|
||||||
<alias type=\'text/x-c\'/>
|
\" <alias type=\'text/x-c\'/>\",
|
||||||
<glob pattern=\'*.c\' case-sensitive=\'true\' weight=\'70\'/>
|
\" <glob pattern=\'*.c\' case-sensitive=\'true\' weight=\'70\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
|
|
||||||
<mime-type type=\'text/vnd.nvidia.cuda.csrc\'>
|
\" <mime-type type=\'text/vnd.nvidia.cuda.csrc\'>\",
|
||||||
<sub-class-of type=\'text/x-csrc\'/>
|
\" <sub-class-of type=\'text/x-csrc\'/>\",
|
||||||
<comment>NVIDIA CUDA C source code</comment>
|
\" <comment>NVIDIA CUDA C source code</comment>\",
|
||||||
<glob pattern=\'*.cu\'/>
|
\" <glob pattern=\'*.cu\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
|
|
||||||
<mime-type type=\'text/x-chdr\'>
|
\" <mime-type type=\'text/x-chdr\'>\",
|
||||||
<comment>C header</comment>
|
\" <comment>C header</comment>\",
|
||||||
<sub-class-of type=\'text/x-csrc\'/>
|
\" <sub-class-of type=\'text/x-csrc\'/>\",
|
||||||
<!-- reduce weight from freedesktop to avoid conflict with text/x-c++hdr -->
|
\" <!-- reduce weight from freedesktop to avoid conflict with text/x-c++hdr -->\",
|
||||||
<glob pattern=\'*.h\' weight=\'30\'/>
|
\" <glob pattern=\'*.h\' weight=\'30\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
|
|
||||||
<!-- Those are used to find matching headers by the CppTools plugin,
|
\" <!-- Those are used to find matching headers by the CppTools plugin,\",
|
||||||
so, they should match -->
|
\" so, they should match -->\",
|
||||||
<mime-type type=\'text/x-c++hdr\'>
|
\" <mime-type type=\'text/x-c++hdr\'>\",
|
||||||
<sub-class-of type=\'text/x-chdr\'/>
|
\" <sub-class-of type=\'text/x-chdr\'/>\",
|
||||||
<comment>C++ header</comment>
|
\" <comment>C++ header</comment>\",
|
||||||
<glob pattern=\'*.hh\' weight=\'70\'/>
|
\" <glob pattern=\'*.hh\' weight=\'70\'/>\",
|
||||||
<glob pattern=\'*.hxx\' weight=\'70\'/>
|
\" <glob pattern=\'*.hxx\' weight=\'70\'/>\",
|
||||||
<glob pattern=\'*.h++\' weight=\'70\'/>
|
\" <glob pattern=\'*.h++\' weight=\'70\'/>\",
|
||||||
<glob pattern=\'*.hpp\' weight=\'70\'/>
|
\" <glob pattern=\'*.hpp\' weight=\'70\'/>\",
|
||||||
<glob pattern=\'*.hp\' weight=\'70\'/>
|
\" <glob pattern=\'*.hp\' weight=\'70\'/>\",
|
||||||
<!-- Additions to freedesktop: -->
|
\" <!-- Additions to freedesktop: -->\",
|
||||||
<glob pattern=\'*.h\' weight=\'70\'/>
|
\" <glob pattern=\'*.h\' weight=\'70\'/>\",
|
||||||
<glob pattern=\'*.H\' weight=\'70\'/>
|
\" <glob pattern=\'*.H\' weight=\'70\'/>\",
|
||||||
<!-- Find include guards of header files without extension, for
|
\" <!-- Find include guards of header files without extension, for\",
|
||||||
example, STL ones like <string>. Those can have a big initial
|
\" example, STL ones like <string>. Those can have a big initial\",
|
||||||
comment exceeding 1000 chars, though. -->
|
\" comment exceeding 1000 chars, though. -->\",
|
||||||
<magic priority=\'50\'>
|
\" <magic priority=\'50\'>\",
|
||||||
<match value=\'#ifndef \' type=\'string\' offset=\'0:2000\'/>
|
\" <match value=\'#ifndef \' type=\'string\' offset=\'0:2000\'/>\",
|
||||||
<match value=\'#if \' type=\'string\' offset=\'0:2000\'/>
|
\" <match value=\'#if \' type=\'string\' offset=\'0:2000\'/>\",
|
||||||
<match value=\'#include \' type=\'string\' offset=\'0:2000\'/>
|
\" <match value=\'#include \' type=\'string\' offset=\'0:2000\'/>\",
|
||||||
</magic>
|
\" </magic>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
|
|
||||||
<mime-type type=\'text/x-c++src\'>
|
\" <mime-type type=\'text/x-c++src\'>\",
|
||||||
<comment>C++ source code</comment>
|
\" <comment>C++ source code</comment>\",
|
||||||
<sub-class-of type=\'text/x-csrc\'/>
|
\" <sub-class-of type=\'text/x-csrc\'/>\",
|
||||||
<glob pattern=\'*.cpp\' weight=\'70\'/>
|
\" <glob pattern=\'*.cpp\' weight=\'70\'/>\",
|
||||||
<glob pattern=\'*.cxx\' weight=\'70\'/>
|
\" <glob pattern=\'*.cxx\' weight=\'70\'/>\",
|
||||||
<glob pattern=\'*.cc\' weight=\'70\'/>
|
\" <glob pattern=\'*.cc\' weight=\'70\'/>\",
|
||||||
<glob pattern=\'*.C\' case-sensitive=\'true\' weight=\'70\'/>
|
\" <glob pattern=\'*.C\' case-sensitive=\'true\' weight=\'70\'/>\",
|
||||||
<glob pattern=\'*.c++\' weight=\'70\'/>
|
\" <glob pattern=\'*.c++\' weight=\'70\'/>\",
|
||||||
<!-- Additions to freedesktop: -->
|
\" <!-- Additions to freedesktop: -->\",
|
||||||
<glob pattern=\'*.cp\' weight=\'70\'/>
|
\" <glob pattern=\'*.cp\' weight=\'70\'/>\",
|
||||||
<glob pattern=\'*.inl\' weight=\'70\'/>
|
\" <glob pattern=\'*.inl\' weight=\'70\'/>\",
|
||||||
<glob pattern=\'*.tcc\' weight=\'70\'/>
|
\" <glob pattern=\'*.tcc\' weight=\'70\'/>\",
|
||||||
<glob pattern=\'*.tpp\' weight=\'70\'/>
|
\" <glob pattern=\'*.tpp\' weight=\'70\'/>\",
|
||||||
<glob pattern=\'*.t++\' weight=\'70\'/>
|
\" <glob pattern=\'*.t++\' weight=\'70\'/>\",
|
||||||
<glob pattern=\'*.txx\' weight=\'70\'/>
|
\" <glob pattern=\'*.txx\' weight=\'70\'/>\",
|
||||||
<magic priority=\'30\'>
|
\" <magic priority=\'30\'>\",
|
||||||
<match value=\'-*- C++ -*-\' type=\'string\' offset=\'0:30\'/>
|
\" <match value=\'-*- C++ -*-\' type=\'string\' offset=\'0:30\'/>\",
|
||||||
</magic>
|
\" </magic>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
|
|
||||||
<mime-type type=\'text/x-qdoc\'>
|
\" <mime-type type=\'text/x-qdoc\'>\",
|
||||||
<comment>Qt documentation file</comment>
|
\" <comment>Qt documentation file</comment>\",
|
||||||
<sub-class-of type=\'text/plain\'/>
|
\" <sub-class-of type=\'text/plain\'/>\",
|
||||||
<glob pattern=\'*.qdoc\' weight=\'70\'/>
|
\" <glob pattern=\'*.qdoc\' weight=\'70\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
|
|
||||||
<mime-type type=\'text/x-moc\'>
|
\" <mime-type type=\'text/x-moc\'>\",
|
||||||
<comment>Qt MOC file</comment>
|
\" <comment>Qt MOC file</comment>\",
|
||||||
<!-- Fix to freedesktop: moc is C++ source -->
|
\" <!-- Fix to freedesktop: moc is C++ source -->\",
|
||||||
<sub-class-of type=\'text/x-c++src\'/>
|
\" <sub-class-of type=\'text/x-c++src\'/>\",
|
||||||
<glob pattern=\'*.moc\' weight=\'70\'/>
|
\" <glob pattern=\'*.moc\' weight=\'70\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
|
|
||||||
<mime-type type=\'text/x-objc++src\'>
|
\" <mime-type type=\'text/x-objc++src\'>\",
|
||||||
<comment>Objective-C++ source code</comment>
|
\" <comment>Objective-C++ source code</comment>\",
|
||||||
<sub-class-of type=\'text/x-c++src\'/>
|
\" <sub-class-of type=\'text/x-c++src\'/>\",
|
||||||
<sub-class-of type=\'text/x-objcsrc\'/>
|
\" <sub-class-of type=\'text/x-objcsrc\'/>\",
|
||||||
<glob pattern=\'*.mm\' weight=\'70\'/>
|
\" <glob pattern=\'*.mm\' weight=\'70\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
|
|
||||||
<mime-type type=\'text/x-objcsrc\'>
|
\" <mime-type type=\'text/x-objcsrc\'>\",
|
||||||
<comment>Objective-C source code</comment>
|
\" <comment>Objective-C source code</comment>\",
|
||||||
<sub-class-of type=\'text/x-csrc\'/>
|
\" <sub-class-of type=\'text/x-csrc\'/>\",
|
||||||
<glob pattern=\'*.m\' weight=\'70\'/>
|
\" <glob pattern=\'*.m\' weight=\'70\'/>\",
|
||||||
<magic priority=\'30\'>
|
\" <magic priority=\'30\'>\",
|
||||||
<match value=\'#import\' type=\'string\' offset=\'0\'/>
|
\" <match value=\'#import\' type=\'string\' offset=\'0\'/>\",
|
||||||
</magic>
|
\" </magic>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
|
|
||||||
</mime-info>
|
\"</mime-info>\"
|
||||||
\"
|
]
|
||||||
}
|
}
|
||||||
|
@@ -83,6 +83,7 @@ static void addConfigForAlmostEveryWarning(ClangDiagnosticConfigsModel &model)
|
|||||||
QStringLiteral("-Wno-gnu-zero-variadic-macro-arguments"),
|
QStringLiteral("-Wno-gnu-zero-variadic-macro-arguments"),
|
||||||
QStringLiteral("-Wno-documentation"),
|
QStringLiteral("-Wno-documentation"),
|
||||||
QStringLiteral("-Wno-shadow"),
|
QStringLiteral("-Wno-shadow"),
|
||||||
|
QStringLiteral("-Wno-switch-enum"),
|
||||||
QStringLiteral("-Wno-missing-prototypes"), // Not optimal for C projects.
|
QStringLiteral("-Wno-missing-prototypes"), // Not optimal for C projects.
|
||||||
QStringLiteral("-Wno-used-but-marked-unused"), // e.g. QTest::qWait
|
QStringLiteral("-Wno-used-but-marked-unused"), // e.g. QTest::qWait
|
||||||
} + commonWarnings());
|
} + commonWarnings());
|
||||||
|
@@ -17,13 +17,13 @@
|
|||||||
\"Url\" : \"http://www.qt.io\",
|
\"Url\" : \"http://www.qt.io\",
|
||||||
$$dependencyList,
|
$$dependencyList,
|
||||||
|
|
||||||
\"Mimetypes\" : \"
|
\"Mimetypes\" : [
|
||||||
<?xml version=\'1.0\'?>
|
\"<?xml version=\'1.0\'?>\",
|
||||||
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
|
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
|
||||||
<mime-type type=\'text/vnd.qtcreator.cvs.submit\'>
|
\" <mime-type type=\'text/vnd.qtcreator.cvs.submit\'>\",
|
||||||
<comment>CVS submit template</comment>
|
\" <comment>CVS submit template</comment>\",
|
||||||
<sub-class-of type=\'text/plain\'/>
|
\" <sub-class-of type=\'text/plain\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
</mime-info>
|
\"</mime-info>\"
|
||||||
\"
|
]
|
||||||
}
|
}
|
||||||
|
@@ -41,20 +41,20 @@
|
|||||||
],
|
],
|
||||||
$$dependencyList,
|
$$dependencyList,
|
||||||
|
|
||||||
\"Mimetypes\" : \"
|
\"Mimetypes\" : [
|
||||||
<?xml version=\'1.0\'?>
|
\"<?xml version=\'1.0\'?>\",
|
||||||
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
|
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
|
||||||
<mime-type type=\'text/x-asm\'>
|
\" <mime-type type=\'text/x-asm\'>\",
|
||||||
<sub-class-of type=\'text/plain\'/>
|
\" <sub-class-of type=\'text/plain\'/>\",
|
||||||
<comment>Assembler</comment>
|
\" <comment>Assembler</comment>\",
|
||||||
<glob pattern=\'*.asm\'/>
|
\" <glob pattern=\'*.asm\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
<!-- Catch-all for assemblers -->
|
\" <!-- Catch-all for assemblers -->\",
|
||||||
<mime-type type=\'text/x-qtcreator-generic-asm\'>
|
\" <mime-type type=\'text/x-qtcreator-generic-asm\'>\",
|
||||||
<sub-class-of type=\'text/x-asm\'/>
|
\" <sub-class-of type=\'text/x-asm\'/>\",
|
||||||
<comment>Qt Creator Generic Assembler</comment>
|
\" <comment>Qt Creator Generic Assembler</comment>\",
|
||||||
<glob pattern=\'*.asm\'/>
|
\" <glob pattern=\'*.asm\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
</mime-info>
|
\"</mime-info>\"
|
||||||
\"
|
]
|
||||||
}
|
}
|
||||||
|
@@ -87,6 +87,7 @@ bool FormEditorPlugin::initialize(const QStringList &arguments, QString *error)
|
|||||||
wizard->setCategory(QLatin1String(Core::Constants::WIZARD_CATEGORY_QT));
|
wizard->setCategory(QLatin1String(Core::Constants::WIZARD_CATEGORY_QT));
|
||||||
wizard->setDisplayCategory(QCoreApplication::translate("Core", Core::Constants::WIZARD_TR_CATEGORY_QT));
|
wizard->setDisplayCategory(QCoreApplication::translate("Core", Core::Constants::WIZARD_TR_CATEGORY_QT));
|
||||||
wizard->setDisplayName(tr("Qt Designer Form Class"));
|
wizard->setDisplayName(tr("Qt Designer Form Class"));
|
||||||
|
wizard->setIconText("ui/h");
|
||||||
wizard->setId("C.FormClass");
|
wizard->setId("C.FormClass");
|
||||||
wizard->setDescription(tr("Creates a Qt Designer form along with a matching class (C++ header and source file) "
|
wizard->setDescription(tr("Creates a Qt Designer form along with a matching class (C++ header and source file) "
|
||||||
"for implementation purposes. You can add the form and class to an existing Qt Widget Project."));
|
"for implementation purposes. You can add the form and class to an existing Qt Widget Project."));
|
||||||
|
@@ -17,34 +17,34 @@
|
|||||||
\"Url\" : \"http://www.qt.io\",
|
\"Url\" : \"http://www.qt.io\",
|
||||||
$$dependencyList,
|
$$dependencyList,
|
||||||
|
|
||||||
\"Mimetypes\" : \"
|
\"Mimetypes\" : [
|
||||||
<?xml version=\'1.0\'?>
|
\"<?xml version=\'1.0\'?>\",
|
||||||
|
|
||||||
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
|
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
|
||||||
<mime-type type=\'text/x-generic-project\'>
|
\" <mime-type type=\'text/x-generic-project\'>\",
|
||||||
<sub-class-of type=\'text/plain\'/>
|
\" <sub-class-of type=\'text/plain\'/>\",
|
||||||
<comment>Generic Qt Creator Project file</comment>
|
\" <comment>Generic Qt Creator Project file</comment>\",
|
||||||
<glob pattern=\'*.creator\'/>
|
\" <glob pattern=\'*.creator\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
|
|
||||||
<mime-type type=\'application/vnd.qtcreator.generic.files\'>
|
\" <mime-type type=\'application/vnd.qtcreator.generic.files\'>\",
|
||||||
<sub-class-of type=\'text/plain\'/>
|
\" <sub-class-of type=\'text/plain\'/>\",
|
||||||
<comment>Generic Project Files</comment>
|
\" <comment>Generic Project Files</comment>\",
|
||||||
<glob pattern=\'*.files\'/>
|
\" <glob pattern=\'*.files\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
|
|
||||||
<mime-type type=\'application/vnd.qtcreator.generic.includes\'>
|
\" <mime-type type=\'application/vnd.qtcreator.generic.includes\'>\",
|
||||||
<sub-class-of type=\'text/plain\'/>
|
\" <sub-class-of type=\'text/plain\'/>\",
|
||||||
<comment>Generic Project Include Paths</comment>
|
\" <comment>Generic Project Include Paths</comment>\",
|
||||||
<glob pattern=\'*.includes\'/>
|
\" <glob pattern=\'*.includes\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
|
|
||||||
<mime-type type=\'application/vnd.qtcreator.generic.config\'>
|
\" <mime-type type=\'application/vnd.qtcreator.generic.config\'>\",
|
||||||
<sub-class-of type=\'text/plain\'/>
|
\" <sub-class-of type=\'text/plain\'/>\",
|
||||||
<comment>Generic Project Configuration File</comment>
|
\" <comment>Generic Project Configuration File</comment>\",
|
||||||
<glob pattern=\'*.config\'/>
|
\" <glob pattern=\'*.config\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
|
|
||||||
</mime-info>
|
\"</mime-info>\"
|
||||||
\"
|
]
|
||||||
}
|
}
|
||||||
|
@@ -17,20 +17,20 @@
|
|||||||
\"Url\" : \"http://www.qt.io\",
|
\"Url\" : \"http://www.qt.io\",
|
||||||
$$dependencyList,
|
$$dependencyList,
|
||||||
|
|
||||||
\"Mimetypes\" : \"
|
\"Mimetypes\" : [
|
||||||
<?xml version=\'1.0\'?>
|
\"<?xml version=\'1.0\'?>\",
|
||||||
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
|
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
|
||||||
<mime-type type=\'text/vnd.qtcreator.git.commit\'>
|
\" <mime-type type=\'text/vnd.qtcreator.git.commit\'>\",
|
||||||
<sub-class-of type=\'text/plain\'/>
|
\" <sub-class-of type=\'text/plain\'/>\",
|
||||||
<comment>Git Commit File</comment>
|
\" <comment>Git Commit File</comment>\",
|
||||||
<glob pattern=\'COMMIT_MSG\'/>
|
\" <glob pattern=\'COMMIT_MSG\'/>\",
|
||||||
<glob pattern=\'COMMIT_EDITMSG\'/>
|
\" <glob pattern=\'COMMIT_EDITMSG\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
<mime-type type=\'text/vnd.qtcreator.git.rebase\'>
|
\" <mime-type type=\'text/vnd.qtcreator.git.rebase\'>\",
|
||||||
<sub-class-of type=\'text/plain\'/>
|
\" <sub-class-of type=\'text/plain\'/>\",
|
||||||
<comment>Git Commit File</comment>
|
\" <comment>Git Commit File</comment>\",
|
||||||
<glob pattern=\'git-rebase-todo\'/>
|
\" <glob pattern=\'git-rebase-todo\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
</mime-info>
|
\"</mime-info>\"
|
||||||
\"
|
]
|
||||||
}
|
}
|
||||||
|
@@ -141,11 +141,12 @@ public:
|
|||||||
|
|
||||||
void exec()
|
void exec()
|
||||||
{
|
{
|
||||||
QStringList arguments;
|
GitClient *client = GitPlugin::client();
|
||||||
arguments << "-c" << "color.grep.match=bold red"
|
QStringList arguments = {
|
||||||
<< "grep" << "-zn"
|
"-c", "color.grep.match=bold red",
|
||||||
<< "--no-full-name"
|
"-c", "color.grep=always",
|
||||||
<< "--color=always";
|
"grep", "-zn", "--no-full-name"
|
||||||
|
};
|
||||||
if (!(m_parameters.flags & FindCaseSensitively))
|
if (!(m_parameters.flags & FindCaseSensitively))
|
||||||
arguments << "-i";
|
arguments << "-i";
|
||||||
if (m_parameters.flags & FindWholeWords)
|
if (m_parameters.flags & FindWholeWords)
|
||||||
@@ -154,6 +155,8 @@ public:
|
|||||||
arguments << "-P";
|
arguments << "-P";
|
||||||
else
|
else
|
||||||
arguments << "-F";
|
arguments << "-F";
|
||||||
|
if (client->gitVersion() >= 0x021300)
|
||||||
|
arguments << "--recurse-submodules";
|
||||||
arguments << "-e" << m_parameters.text;
|
arguments << "-e" << m_parameters.text;
|
||||||
GitGrepParameters params = m_parameters.searchEngineParameters.value<GitGrepParameters>();
|
GitGrepParameters params = m_parameters.searchEngineParameters.value<GitGrepParameters>();
|
||||||
if (!params.ref.isEmpty()) {
|
if (!params.ref.isEmpty()) {
|
||||||
@@ -168,7 +171,7 @@ public:
|
|||||||
return QString(":!" + filter);
|
return QString(":!" + filter);
|
||||||
});
|
});
|
||||||
arguments << "--" << filterArgs << exclusionArgs;
|
arguments << "--" << filterArgs << exclusionArgs;
|
||||||
QScopedPointer<VcsCommand> command(GitPlugin::client()->createCommand(m_directory));
|
QScopedPointer<VcsCommand> command(client->createCommand(m_directory));
|
||||||
command->addFlags(VcsCommand::SilentOutput | VcsCommand::SuppressFailMessage);
|
command->addFlags(VcsCommand::SilentOutput | VcsCommand::SuppressFailMessage);
|
||||||
command->setProgressiveOutput(true);
|
command->setProgressiveOutput(true);
|
||||||
QFutureWatcher<FileSearchResultList> watcher;
|
QFutureWatcher<FileSearchResultList> watcher;
|
||||||
@@ -176,7 +179,7 @@ public:
|
|||||||
connect(&watcher, &QFutureWatcher<FileSearchResultList>::canceled,
|
connect(&watcher, &QFutureWatcher<FileSearchResultList>::canceled,
|
||||||
command.data(), &VcsCommand::cancel);
|
command.data(), &VcsCommand::cancel);
|
||||||
connect(command.data(), &VcsCommand::stdOutText, this, &GitGrepRunner::read);
|
connect(command.data(), &VcsCommand::stdOutText, this, &GitGrepRunner::read);
|
||||||
SynchronousProcessResponse resp = command->runCommand(GitPlugin::client()->vcsBinary(), arguments, 0);
|
SynchronousProcessResponse resp = command->runCommand(client->vcsBinary(), arguments, 0);
|
||||||
switch (resp.result) {
|
switch (resp.result) {
|
||||||
case SynchronousProcessResponse::TerminatedAbnormally:
|
case SynchronousProcessResponse::TerminatedAbnormally:
|
||||||
case SynchronousProcessResponse::StartFailed:
|
case SynchronousProcessResponse::StartFailed:
|
||||||
|
@@ -17,48 +17,48 @@
|
|||||||
\"Url\" : \"http://www.qt.io\",
|
\"Url\" : \"http://www.qt.io\",
|
||||||
$$dependencyList,
|
$$dependencyList,
|
||||||
|
|
||||||
\"Mimetypes\" : \"
|
\"Mimetypes\" : [
|
||||||
<?xml version=\'1.0\'?>
|
\"<?xml version=\'1.0\'?>\",
|
||||||
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
|
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
|
||||||
|
|
||||||
<mime-type type=\'application/x-glsl\'>
|
\" <mime-type type=\'application/x-glsl\'>\",
|
||||||
<alias type=\'text/x-glsl\'/>
|
\" <alias type=\'text/x-glsl\'/>\",
|
||||||
<sub-class-of type=\'text/plain\'/>
|
\" <sub-class-of type=\'text/plain\'/>\",
|
||||||
<comment>GLSL Shader file</comment>
|
\" <comment>GLSL Shader file</comment>\",
|
||||||
<glob pattern=\'*.glsl\'/>
|
\" <glob pattern=\'*.glsl\'/>\",
|
||||||
<glob pattern=\'*.shader\'/>
|
\" <glob pattern=\'*.shader\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
|
|
||||||
<mime-type type=\'text/x-glsl-frag\'>
|
\" <mime-type type=\'text/x-glsl-frag\'>\",
|
||||||
<sub-class-of type=\'text/x-glsl\'/>
|
\" <sub-class-of type=\'text/x-glsl\'/>\",
|
||||||
<comment>GLSL Fragment Shader file</comment>
|
\" <comment>GLSL Fragment Shader file</comment>\",
|
||||||
<glob pattern=\'*.frag\'/>
|
\" <glob pattern=\'*.frag\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
|
|
||||||
<mime-type type=\'text/x-glsl-es-frag\'>
|
\" <mime-type type=\'text/x-glsl-es-frag\'>\",
|
||||||
<sub-class-of type=\'text/x-glsl\'/>
|
\" <sub-class-of type=\'text/x-glsl\'/>\",
|
||||||
<comment>GLSL/ES Fragment Shader file</comment>
|
\" <comment>GLSL/ES Fragment Shader file</comment>\",
|
||||||
<glob pattern=\'*.fsh\'/>
|
\" <glob pattern=\'*.fsh\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
|
|
||||||
<mime-type type=\'text/x-glsl-vert\'>
|
\" <mime-type type=\'text/x-glsl-vert\'>\",
|
||||||
<sub-class-of type=\'text/x-glsl\'/>
|
\" <sub-class-of type=\'text/x-glsl\'/>\",
|
||||||
<comment>GLSL Vertex Shader file</comment>
|
\" <comment>GLSL Vertex Shader file</comment>\",
|
||||||
<glob pattern=\'*.vert\'/>
|
\" <glob pattern=\'*.vert\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
|
|
||||||
<mime-type type=\'text/x-glsl-es-vert\'>
|
\" <mime-type type=\'text/x-glsl-es-vert\'>\",
|
||||||
<sub-class-of type=\'text/x-glsl\'/>
|
\" <sub-class-of type=\'text/x-glsl\'/>\",
|
||||||
<comment>GLSL/ES Vertex Shader file</comment>
|
\" <comment>GLSL/ES Vertex Shader file</comment>\",
|
||||||
<glob pattern=\'*.vsh\'/>
|
\" <glob pattern=\'*.vsh\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
|
|
||||||
<mime-type type=\'text/x-glsl-es-geometry\'>
|
\" <mime-type type=\'text/x-glsl-es-geometry\'>\",
|
||||||
<sub-class-of type=\'text/x-glsl\'/>
|
\" <sub-class-of type=\'text/x-glsl\'/>\",
|
||||||
<comment>GLSL/ES Geometry Shader file</comment>
|
\" <comment>GLSL/ES Geometry Shader file</comment>\",
|
||||||
<glob pattern=\'*.gsh\'/>
|
\" <glob pattern=\'*.gsh\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
|
|
||||||
</mime-info>
|
\"</mime-info>\"
|
||||||
\"
|
]
|
||||||
}
|
}
|
||||||
|
@@ -17,15 +17,15 @@
|
|||||||
\"Url\" : \"http://www.qt.io\",
|
\"Url\" : \"http://www.qt.io\",
|
||||||
$$dependencyList,
|
$$dependencyList,
|
||||||
|
|
||||||
\"Mimetypes\" : \"
|
\"Mimetypes\" : [
|
||||||
<?xml version=\'1.0\'?>
|
\"<?xml version=\'1.0\'?>\",
|
||||||
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
|
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
|
||||||
|
|
||||||
<mime-type type=\'image/webp\'>
|
\" <mime-type type=\'image/webp\'>\",
|
||||||
<comment>WebP Image file</comment>
|
\" <comment>WebP Image file</comment>\",
|
||||||
<glob pattern=\'*.webp\'/>
|
\" <glob pattern=\'*.webp\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
|
|
||||||
</mime-info>
|
\"</mime-info>\"
|
||||||
\"
|
]
|
||||||
}
|
}
|
||||||
|
@@ -18,14 +18,14 @@
|
|||||||
\"Experimental\" : true,
|
\"Experimental\" : true,
|
||||||
$$dependencyList,
|
$$dependencyList,
|
||||||
|
|
||||||
\"Mimetypes\" : \"
|
\"Mimetypes\" : [
|
||||||
<?xml version=\'1.0\' encoding=\'UTF-8\'?>
|
\"<?xml version=\'1.0\' encoding=\'UTF-8\'?>\",
|
||||||
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
|
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
|
||||||
<mime-type type=\'text/vnd.qtcreator.model\'>
|
\" <mime-type type=\'text/vnd.qtcreator.model\'>\",
|
||||||
<sub-class-of type=\'text/xml\'/>
|
\" <sub-class-of type=\'text/xml\'/>\",
|
||||||
<comment>Qt Creator Model File</comment>
|
\" <comment>Qt Creator Model File</comment>\",
|
||||||
<glob pattern=\'*.qmodel\'/>
|
\" <glob pattern=\'*.qmodel\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
</mime-info>
|
\"</mime-info>\"
|
||||||
\"
|
]
|
||||||
}
|
}
|
||||||
|
@@ -18,27 +18,27 @@
|
|||||||
\"Experimental\" : true,
|
\"Experimental\" : true,
|
||||||
$$dependencyList,
|
$$dependencyList,
|
||||||
|
|
||||||
\"Mimetypes\" : \"
|
\"Mimetypes\" : [
|
||||||
<?xml version=\'1.0\'?>
|
\"<?xml version=\'1.0\'?>\",
|
||||||
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
|
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
|
||||||
|
|
||||||
<mime-type type=\'text/x-nim-project\'>
|
\" <mime-type type=\'text/x-nim-project\'>\",
|
||||||
<sub-class-of type=\'text/plain\'/>
|
\" <sub-class-of type=\'text/plain\'/>\",
|
||||||
<comment>Nim project file</comment>
|
\" <comment>Nim project file</comment>\",
|
||||||
<glob pattern=\'*.nimproject\'/>
|
\" <glob pattern=\'*.nimproject\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
|
|
||||||
<mime-type type=\'text/x-nim\'>
|
\" <mime-type type=\'text/x-nim\'>\",
|
||||||
<sub-class-of type=\'text/plain\'/>
|
\" <sub-class-of type=\'text/plain\'/>\",
|
||||||
<comment>Nim source file </comment>
|
\" <comment>Nim source file </comment>\",
|
||||||
<glob pattern=\'*.nim\'/>
|
\" <glob pattern=\'*.nim\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
|
|
||||||
<mime-type type=\'text/x-nim-script\'>
|
\" <mime-type type=\'text/x-nim-script\'>\",
|
||||||
<sub-class-of type=\'text/plain\'/>
|
\" <sub-class-of type=\'text/plain\'/>\",
|
||||||
<comment>Nim script file </comment>
|
\" <comment>Nim script file </comment>\",
|
||||||
<glob pattern=\'*.nims\'/>
|
\" <glob pattern=\'*.nims\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
</mime-info>
|
\"</mime-info>\"
|
||||||
\"
|
]
|
||||||
}
|
}
|
||||||
|
@@ -17,16 +17,16 @@
|
|||||||
\"Url\" : \"http://www.qt.io\",
|
\"Url\" : \"http://www.qt.io\",
|
||||||
$$dependencyList,
|
$$dependencyList,
|
||||||
|
|
||||||
\"Mimetypes\" : \"
|
\"Mimetypes\" : [
|
||||||
<?xml version=\'1.0\'?>
|
\"<?xml version=\'1.0\'?>\",
|
||||||
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
|
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
|
||||||
<mime-type type=\'text/vnd.qtcreator.p4.submit\'>
|
\" <mime-type type=\'text/vnd.qtcreator.p4.submit\'>\",
|
||||||
<comment>Perforce submit template</comment>
|
\" <comment>Perforce submit template</comment>\",
|
||||||
<sub-class-of type=\'text/plain\'/>
|
\" <sub-class-of type=\'text/plain\'/>\",
|
||||||
<magic priority=\'50\'>
|
\" <magic priority=\'50\'>\",
|
||||||
<match value=\'# A Perforce Change Specification.\' type=\'string\' offset=\'0\'/>
|
\" <match value=\'# A Perforce Change Specification.\' type=\'string\' offset=\'0\'/>\",
|
||||||
</magic>
|
\" </magic>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
</mime-info>
|
\"</mime-info>\"
|
||||||
\"
|
]
|
||||||
}
|
}
|
||||||
|
@@ -434,7 +434,7 @@ static Utils::FileName findLocalCompiler(const Utils::FileName &compilerPath,
|
|||||||
&& !pathEntry.contains("distcc");
|
&& !pathEntry.contains("distcc");
|
||||||
});
|
});
|
||||||
|
|
||||||
QTC_ASSERT(path != FileName(), return compilerPath);
|
QTC_ASSERT(!path.isEmpty(), return compilerPath);
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -70,6 +70,7 @@ static const char CATEGORY_KEY[] = "category";
|
|||||||
static const char CATEGORY_NAME_KEY[] = "trDisplayCategory";
|
static const char CATEGORY_NAME_KEY[] = "trDisplayCategory";
|
||||||
static const char DISPLAY_NAME_KEY[] = "trDisplayName";
|
static const char DISPLAY_NAME_KEY[] = "trDisplayName";
|
||||||
static const char ICON_KEY[] = "icon";
|
static const char ICON_KEY[] = "icon";
|
||||||
|
static const char ICON_TEXT_KEY[] = "iconText";
|
||||||
static const char IMAGE_KEY[] = "image";
|
static const char IMAGE_KEY[] = "image";
|
||||||
static const char DESCRIPTION_KEY[] = "trDescription";
|
static const char DESCRIPTION_KEY[] = "trDescription";
|
||||||
static const char REQUIRED_FEATURES_KEY[] = "featuresRequired";
|
static const char REQUIRED_FEATURES_KEY[] = "featuresRequired";
|
||||||
@@ -559,6 +560,10 @@ bool JsonWizardFactory::initialize(const QVariantMap &data, const QDir &baseDir,
|
|||||||
setIcon(QIcon(strVal));
|
setIcon(QIcon(strVal));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
strVal = data.value(QLatin1String(ICON_TEXT_KEY)).toString();
|
||||||
|
if (!strVal.isEmpty())
|
||||||
|
setIconText(strVal);
|
||||||
|
|
||||||
strVal = data.value(QLatin1String(IMAGE_KEY)).toString();
|
strVal = data.value(QLatin1String(IMAGE_KEY)).toString();
|
||||||
if (!strVal.isEmpty()) {
|
if (!strVal.isEmpty()) {
|
||||||
strVal = baseDir.absoluteFilePath(strVal);
|
strVal = baseDir.absoluteFilePath(strVal);
|
||||||
|
@@ -17,19 +17,19 @@
|
|||||||
\"Url\" : \"http://www.qt.io\",
|
\"Url\" : \"http://www.qt.io\",
|
||||||
$$dependencyList,
|
$$dependencyList,
|
||||||
|
|
||||||
\"Mimetypes\" : \"
|
\"Mimetypes\" : [
|
||||||
<?xml version=\'1.0\'?>
|
\"<?xml version=\'1.0\'?>\",
|
||||||
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
|
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
|
||||||
<mime-type type=\'text/x-python-gui\'>
|
\" <mime-type type=\'text/x-python-gui\'>\",
|
||||||
<sub-class-of type=\'text/x-python\'/>
|
\" <sub-class-of type=\'text/x-python\'/>\",
|
||||||
<comment>Python source file without console</comment>
|
\" <comment>Python source file without console</comment>\",
|
||||||
<glob pattern=\'*.pyw\'/>
|
\" <glob pattern=\'*.pyw\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
<mime-type type=\'text/x-python-project\'>
|
\" <mime-type type=\'text/x-python-project\'>\",
|
||||||
<sub-class-of type=\'text/x-python\'/>
|
\" <sub-class-of type=\'text/x-python\'/>\",
|
||||||
<comment>Qt Creator Python project file</comment>
|
\" <comment>Qt Creator Python project file</comment>\",
|
||||||
<glob pattern=\'*.pyqtc\'/>
|
\" <glob pattern=\'*.pyqtc\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
</mime-info>
|
\"</mime-info>\"
|
||||||
\"
|
]
|
||||||
}
|
}
|
||||||
|
@@ -158,6 +158,13 @@ bool QmakeAndroidBuildApkStep::init(QList<const BuildStep *> &earlierSteps)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString buildTargetSdk = AndroidManager::buildTargetSDK(target());
|
||||||
|
if (buildTargetSdk.isEmpty()) {
|
||||||
|
emit addOutput(tr("Android build SDK not defined. Check Android settings."),
|
||||||
|
OutputFormat::Stderr);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
QStringList arguments;
|
QStringList arguments;
|
||||||
arguments << QLatin1String("--input")
|
arguments << QLatin1String("--input")
|
||||||
<< inputFile
|
<< inputFile
|
||||||
|
@@ -17,39 +17,39 @@
|
|||||||
\"Url\" : \"http://www.qt.io\",
|
\"Url\" : \"http://www.qt.io\",
|
||||||
$$dependencyList,
|
$$dependencyList,
|
||||||
|
|
||||||
\"Mimetypes\" : \"
|
\"Mimetypes\" : [
|
||||||
<?xml version=\'1.0\'?>
|
\"<?xml version=\'1.0\'?>\",
|
||||||
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
|
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
|
||||||
<mime-type type=\'application/vnd.qt.qmakeprofile\'>
|
\" <mime-type type=\'application/vnd.qt.qmakeprofile\'>\",
|
||||||
<sub-class-of type=\'text/plain\'/>
|
\" <sub-class-of type=\'text/plain\'/>\",
|
||||||
<comment>Qt Project file</comment>
|
\" <comment>Qt Project file</comment>\",
|
||||||
<glob pattern=\'*.pro\'/>
|
\" <glob pattern=\'*.pro\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
<mime-type type=\'application/vnd.qt.qmakeproincludefile\'>
|
\" <mime-type type=\'application/vnd.qt.qmakeproincludefile\'>\",
|
||||||
<sub-class-of type=\'text/plain\'/>
|
\" <sub-class-of type=\'text/plain\'/>\",
|
||||||
<comment>Qt Project include file</comment>
|
\" <comment>Qt Project include file</comment>\",
|
||||||
<glob pattern=\'*.pri\'/>
|
\" <glob pattern=\'*.pri\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
<mime-type type=\'application/vnd.qt.qmakeprofeaturefile\'>
|
\" <mime-type type=\'application/vnd.qt.qmakeprofeaturefile\'>\",
|
||||||
<sub-class-of type=\'text/plain\'/>
|
\" <sub-class-of type=\'text/plain\'/>\",
|
||||||
<comment>Qt Project feature file</comment>
|
\" <comment>Qt Project feature file</comment>\",
|
||||||
<glob pattern=\'*.prf\'/>
|
\" <glob pattern=\'*.prf\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
<mime-type type=\'application/vnd.qt.qmakeproconfigurationfile\'>
|
\" <mime-type type=\'application/vnd.qt.qmakeproconfigurationfile\'>\",
|
||||||
<sub-class-of type=\'text/plain\'/>
|
\" <sub-class-of type=\'text/plain\'/>\",
|
||||||
<comment>Qt Project configuration file</comment>
|
\" <comment>Qt Project configuration file</comment>\",
|
||||||
<glob pattern=\'.qmake.conf\'/>
|
\" <glob pattern=\'.qmake.conf\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
<mime-type type=\'application/vnd.qt.qmakeprocachefile\'>
|
\" <mime-type type=\'application/vnd.qt.qmakeprocachefile\'>\",
|
||||||
<sub-class-of type=\'text/plain\'/>
|
\" <sub-class-of type=\'text/plain\'/>\",
|
||||||
<comment>Qt Project cache file</comment>
|
\" <comment>Qt Project cache file</comment>\",
|
||||||
<glob pattern=\'.qmake.cache\'/>
|
\" <glob pattern=\'.qmake.cache\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
<mime-type type=\'application/vnd.qt.qmakeprostashfile\'>
|
\" <mime-type type=\'application/vnd.qt.qmakeprostashfile\'>\",
|
||||||
<sub-class-of type=\'text/plain\'/>
|
\" <sub-class-of type=\'text/plain\'/>\",
|
||||||
<comment>Qt Project stash file</comment>
|
\" <comment>Qt Project stash file</comment>\",
|
||||||
<glob pattern=\'.qmake.stash\'/>
|
\" <glob pattern=\'.qmake.stash\'/>\",
|
||||||
</mime-type>
|
\" </mime-type>\",
|
||||||
</mime-info>
|
\"</mime-info>\"
|
||||||
\"
|
]
|
||||||
}
|
}
|
||||||
|
@@ -124,23 +124,26 @@ void MoveTool::mouseMoveEvent(const QList<QGraphicsItem*> &itemList,
|
|||||||
void MoveTool::hoverMoveEvent(const QList<QGraphicsItem*> &itemList,
|
void MoveTool::hoverMoveEvent(const QList<QGraphicsItem*> &itemList,
|
||||||
QGraphicsSceneMouseEvent * event)
|
QGraphicsSceneMouseEvent * event)
|
||||||
{
|
{
|
||||||
if (itemList.isEmpty()) {
|
|
||||||
view()->changeToSelectionTool();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ResizeHandleItem* resizeHandle = ResizeHandleItem::fromGraphicsItem(itemList.first());
|
ResizeHandleItem* resizeHandle = ResizeHandleItem::fromGraphicsItem(itemList.first());
|
||||||
if (resizeHandle) {
|
if (resizeHandle) {
|
||||||
view()->changeToResizeTool();
|
view()->changeToResizeTool();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (view()->hasSingleSelectedModelNode() && selectedItemCursorInMovableArea(event->scenePos()))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (itemList.isEmpty()) {
|
||||||
|
view()->changeToSelectionTool();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!topSelectedItemIsMovable(itemList)) {
|
if (!topSelectedItemIsMovable(itemList)) {
|
||||||
view()->changeToSelectionTool();
|
view()->changeToSelectionTool();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (view()->hasSingleSelectedModelNode() && !selectedItemCursorInMovableArea(event->scenePos())) {
|
if (view()->hasSingleSelectedModelNode()) {
|
||||||
view()->changeToSelectionTool();
|
view()->changeToSelectionTool();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|