aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>2014-08-05 14:24:23 +0200
committerOswald Buddenhagen <oswald.buddenhagen@digia.com>2014-08-05 14:24:23 +0200
commitf3a61e8bf7f5b8275c000a0cac70b561422d2230 (patch)
tree0cf0631a5b53fdab930f8a7936aff9c9c1c0952f
parent59b34b6b539c78384ea3fc4fd018fe063b4ede53 (diff)
parentb2ac3fd90ccfc21cf4c5bce353d8e08208961eeb (diff)
Merge remote-tracking branch 'origin/3.2'
Conflicts: qtcreator.pri qtcreator.qbs src/plugins/android/androidglobal.h Change-Id: I3367bf2ea47c088989175dddeed2210294346f4c
-rw-r--r--.gitignore1
-rw-r--r--dist/changes-3.2.011
-rw-r--r--doc/images/creator-qbs-build-app.pngbin0 -> 65026 bytes
-rw-r--r--doc/images/creator-qbs-build-clean.pngbin0 -> 30178 bytes
-rw-r--r--doc/images/qtcreator-android-deploy-configurations.pngbin58932 -> 61808 bytes
-rw-r--r--doc/images/qtcreator-android-manifest-editor.pngbin54010 -> 69470 bytes
-rw-r--r--doc/images/qtcreator-fakevim-options.pngbin27599 -> 108110 bytes
-rw-r--r--doc/images/qtcreator-kit-selector.pngbin24369 -> 39125 bytes
-rw-r--r--doc/src/analyze/creator-analyze.qdoc6
-rw-r--r--doc/src/analyze/creator-valgrind.qdoc8
-rw-r--r--doc/src/android/androiddev.qdoc2
-rw-r--r--doc/src/android/deploying-android.qdoc7
-rw-r--r--doc/src/debugger/creator-debugger.qdoc12
-rw-r--r--doc/src/editors/creator-coding-edit-mode.qdoc8
-rw-r--r--doc/src/howto/creator-cli.qdoc33
-rw-r--r--doc/src/howto/creator-external-tools.qdoc5
-rw-r--r--doc/src/howto/creator-vcs.qdoc35
-rw-r--r--doc/src/linux-mobile/creator-projects-running-generic-linux.qdocinc6
-rw-r--r--doc/src/projects/creator-projects-building.qdoc13
-rw-r--r--doc/src/projects/creator-projects-qbs.qdoc86
-rw-r--r--doc/src/projects/creator-projects-running-desktop.qdocinc11
-rw-r--r--doc/src/projects/creator-projects-running.qdoc22
-rw-r--r--doc/src/projects/creator-projects-settings-build.qdoc6
-rw-r--r--doc/src/qtquick/qtquick-app-development.qdoc12
-rw-r--r--doc/src/qtquick/qtquick-components.qdoc13
-rw-r--r--doc/src/qtquick/qtquick-creating.qdoc12
-rw-r--r--doc/src/qtquick/qtquick-designer.qdoc6
-rw-r--r--doc/src/qtquick/qtquick-screens.qdoc16
-rw-r--r--doc/src/widgets/qtdesigner-overview.qdoc13
-rw-r--r--doc/src/winrt/creator-winrt.qdoc4
-rw-r--r--qbs/imports/QtcProduct.qbs1
-rw-r--r--qbs/modules/pluginspec/pluginspec.qbs4
-rw-r--r--qtcreator.pro2
-rw-r--r--qtcreator.qbs1
-rwxr-xr-xscripts/deployqtHelper_mac.sh1
-rw-r--r--share/qtcreator/debugger/gdbbridge.py12
-rw-r--r--share/qtcreator/qml/qmlpuppet/commands/valueschangedcommand.cpp26
-rw-r--r--share/qtcreator/qml/qmlpuppet/container/container.pri27
-rw-r--r--share/qtcreator/qml/qmlpuppet/container/imagecontainer.cpp69
-rw-r--r--share/qtcreator/qml/qmlpuppet/container/sharedmemory.h96
-rw-r--r--share/qtcreator/qml/qmlpuppet/container/sharedmemory_qt.cpp117
-rw-r--r--share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp500
-rw-r--r--share/qtcreator/qml/qmlpuppet/mockfiles/Window.qml5
-rw-r--r--share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp39
-rw-r--r--share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.h2
-rw-r--r--share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp4
-rw-r--r--share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppet.pri5
-rw-r--r--share/qtcreator/qml/qmlpuppet/qmlpuppet.qrc1
-rw-r--r--share/qtcreator/qml/qmlpuppet/qmlpuppet/qmlpuppet.pri4
-rw-r--r--share/qtcreator/qmldesigner/common/DesignerScrollViewStyle.qml1
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorButton.qml2
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorEditor.qml27
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/CustomSpinBoxStyle.qml1
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/GradientLine.qml7
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/LineEdit.qml12
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ScrollView.qml4
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/SpinBox.qml1
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml1
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/PathViewSpecifics.qml16
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RectangleSpecifics.qml2
-rw-r--r--src/app/app_version_header.qbs2
-rw-r--r--src/libs/3rdparty/cplusplus/AST.cpp42
-rw-r--r--src/libs/3rdparty/cplusplus/AST.h62
-rw-r--r--src/libs/3rdparty/cplusplus/ASTClone.cpp24
-rw-r--r--src/libs/3rdparty/cplusplus/ASTMatch0.cpp16
-rw-r--r--src/libs/3rdparty/cplusplus/ASTMatcher.cpp25
-rw-r--r--src/libs/3rdparty/cplusplus/ASTMatcher.h5
-rw-r--r--src/libs/3rdparty/cplusplus/ASTPatternBuilder.h31
-rw-r--r--src/libs/3rdparty/cplusplus/ASTVisit.cpp12
-rw-r--r--src/libs/3rdparty/cplusplus/ASTVisitor.h10
-rw-r--r--src/libs/3rdparty/cplusplus/ASTfwd.h6
-rw-r--r--src/libs/3rdparty/cplusplus/Bind.cpp18
-rw-r--r--src/libs/3rdparty/cplusplus/Bind.h7
-rw-r--r--src/libs/3rdparty/cplusplus/Parser.cpp249
-rw-r--r--src/libs/3rdparty/cplusplus/Parser.h12
-rw-r--r--src/libs/cplusplus/FastPreprocessor.cpp5
-rw-r--r--src/libs/cplusplus/FastPreprocessor.h3
-rw-r--r--src/libs/cplusplus/FindUsages.cpp8
-rw-r--r--src/libs/cplusplus/FindUsages.h6
-rw-r--r--src/libs/cplusplus/PreprocessorClient.h5
-rw-r--r--src/libs/qmljs/qmljsmodelmanagerinterface.cpp4
-rw-r--r--src/libs/qmljs/qmljsplugindumper.cpp19
-rw-r--r--src/plugins/analyzerbase/analyzermanager.cpp3
-rw-r--r--src/plugins/analyzerbase/analyzermanager.h4
-rw-r--r--src/plugins/android/androidglobal.h2
-rw-r--r--src/plugins/android/androidmanifesteditorwidget.cpp1
-rw-r--r--src/plugins/android/androidsettingswidget.cpp88
-rw-r--r--src/plugins/android/androidsettingswidget.h5
-rw-r--r--src/plugins/android/androidsettingswidget.ui421
-rw-r--r--src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h2
-rw-r--r--src/plugins/baremetal/baremetalruncontrolfactory.cpp8
-rw-r--r--src/plugins/cmakeprojectmanager/cmakeproject.cpp2
-rw-r--r--src/plugins/coreplugin/coreplugin.qbs2
-rw-r--r--src/plugins/coreplugin/find/findtoolbar.cpp8
-rw-r--r--src/plugins/coreplugin/find/findtoolbar.h2
-rw-r--r--src/plugins/cppeditor/cppquickfix_test.cpp44
-rw-r--r--src/plugins/cppeditor/cppquickfixes.cpp2
-rw-r--r--src/plugins/cpptools/cpplocatorfilter_test.cpp23
-rw-r--r--src/plugins/cpptools/cppmodelmanager_test.cpp31
-rw-r--r--src/plugins/cpptools/cppsnapshotupdater.cpp3
-rw-r--r--src/plugins/cpptools/cppsourceprocessor.cpp13
-rw-r--r--src/plugins/cpptools/cppsourceprocessor.h5
-rw-r--r--src/plugins/cpptools/cpptoolsplugin.cpp23
-rw-r--r--src/plugins/cpptools/cpptoolsplugin.h2
-rw-r--r--src/plugins/cpptools/searchsymbols.cpp70
-rw-r--r--src/plugins/cpptools/searchsymbols.h12
-rw-r--r--src/plugins/debugger/commonoptionspage.cpp6
-rw-r--r--src/plugins/debugger/commonoptionspage.h2
-rw-r--r--src/plugins/debugger/debuggeritem.cpp27
-rw-r--r--src/plugins/debugger/debuggeritem.h2
-rw-r--r--src/plugins/debugger/debuggerkitinformation.cpp2
-rw-r--r--src/plugins/debugger/debuggerruncontrolfactory.h4
-rw-r--r--src/plugins/debugger/debuggerrunner.cpp10
-rw-r--r--src/plugins/debugger/disassembleragent.cpp22
-rw-r--r--src/plugins/debugger/disassembleragent.h1
-rw-r--r--src/plugins/debugger/loadcoredialog.cpp2
-rw-r--r--src/plugins/diffeditor/diffeditorplugin.cpp490
-rw-r--r--src/plugins/diffeditor/diffutils.cpp17
-rw-r--r--src/plugins/diffeditor/sidebysidediffeditorwidget.cpp6
-rw-r--r--src/plugins/genericprojectmanager/genericproject.cpp49
-rw-r--r--src/plugins/genericprojectmanager/genericproject.h2
-rw-r--r--src/plugins/git/branchdialog.cpp16
-rw-r--r--src/plugins/git/gitclient.cpp4
-rw-r--r--src/plugins/git/gitsubmiteditor.cpp9
-rw-r--r--src/plugins/help/helpwidget.cpp9
-rw-r--r--src/plugins/help/helpwidget.h1
-rw-r--r--src/plugins/projectexplorer/abi.cpp94
-rw-r--r--src/plugins/projectexplorer/abi.h7
-rw-r--r--src/plugins/projectexplorer/kitchooser.cpp10
-rw-r--r--src/plugins/projectexplorer/localapplicationruncontrol.cpp4
-rw-r--r--src/plugins/projectexplorer/projectexplorer.cpp41
-rw-r--r--src/plugins/projectexplorer/projectexplorer.h1
-rw-r--r--src/plugins/projectexplorer/projectexplorersettingspage.ui2
-rw-r--r--src/plugins/projectexplorer/runconfiguration.cpp6
-rw-r--r--src/plugins/projectexplorer/runconfiguration.h6
-rw-r--r--src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp18
-rw-r--r--src/plugins/qbsprojectmanager/qbsbuildstep.cpp2
-rw-r--r--src/plugins/qbsprojectmanager/qbsconstants.h2
-rw-r--r--src/plugins/qbsprojectmanager/qbsnodes.cpp65
-rw-r--r--src/plugins/qbsprojectmanager/qbsnodes.h12
-rw-r--r--src/plugins/qbsprojectmanager/qbsproject.cpp20
-rw-r--r--src/plugins/qbsprojectmanager/qbsproject.h1
-rw-r--r--src/plugins/qmldesigner/components/formeditor/dragtool.cpp9
-rw-r--r--src/plugins/qmldesigner/components/formeditor/formeditorview.cpp2
-rw-r--r--src/plugins/qmldesigner/components/formeditor/selectiontool.cpp1
-rw-r--r--src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp9
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/gradientmodel.cpp10
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/gradientmodel.h2
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp5
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.h8
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp3
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.cpp5
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.h2
-rw-r--r--src/plugins/qmldesigner/components/stateseditor/stateseditor.qrc6
-rw-r--r--src/plugins/qmldesigner/componentsplugin/Controls/ButtonSpecifics.qml2
-rw-r--r--src/plugins/qmldesigner/componentsplugin/Controls/ComboBoxSpecifics.qml15
-rw-r--r--src/plugins/qmldesigner/componentsplugin/addtabdesigneraction.cpp3
-rw-r--r--src/plugins/qmldesigner/componentsplugin/components.metainfo30
-rw-r--r--src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp57
-rw-r--r--src/plugins/qmldesigner/designercore/instances/puppetcreator.h1
-rw-r--r--src/plugins/qmldesigner/designercore/model/modelnode.cpp24
-rw-r--r--src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp8
-rw-r--r--src/plugins/qmldesigner/documentmanager.cpp47
-rw-r--r--src/plugins/qmldesigner/qmldesignerplugin.pro2
-rw-r--r--src/plugins/qmldesigner/qtquickplugin/quick.metainfo25
-rw-r--r--src/plugins/qmldesigner/shortcutmanager.cpp14
-rw-r--r--src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp11
-rw-r--r--src/plugins/qtsupport/customexecutableconfigurationwidget.cpp51
-rw-r--r--src/plugins/qtsupport/customexecutableconfigurationwidget.h8
-rw-r--r--src/plugins/qtsupport/customexecutablerunconfiguration.cpp82
-rw-r--r--src/plugins/qtsupport/customexecutablerunconfiguration.h5
-rw-r--r--src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp7
-rw-r--r--src/plugins/remotelinux/remotelinuxcustomrunconfiguration.h2
-rw-r--r--src/plugins/remotelinux/remotelinuxdebugsupport.cpp7
-rw-r--r--src/plugins/valgrind/callgrindtool.cpp18
-rw-r--r--src/plugins/valgrind/memchecktool.cpp4
-rw-r--r--src/plugins/vcsbase/commonsettingspage.ui2
-rw-r--r--src/plugins/vcsbase/nicknamedialog.cpp1
-rw-r--r--src/plugins/vcsbase/submiteditorwidget.cpp5
-rw-r--r--src/plugins/vcsbase/submiteditorwidget.h1
-rw-r--r--src/plugins/winrt/winrt.qbs1
-rw-r--r--src/plugins/winrt/winrt_dependencies.pri1
-rw-r--r--src/plugins/winrt/winrtconstants.h5
-rw-r--r--src/plugins/winrt/winrtrunconfiguration.cpp7
-rw-r--r--src/plugins/winrt/winrtrunconfiguration.h2
-rw-r--r--src/plugins/winrt/winrtruncontrol.cpp1
-rw-r--r--src/plugins/winrt/winrtrunfactories.cpp50
-rw-r--r--src/plugins/winrt/winrtrunfactories.h1
-rw-r--r--src/plugins/winrt/winrtrunnerhelper.cpp3
m---------src/shared/qbs0
-rw-r--r--src/src.qbs1
-rw-r--r--src/tools/sdktool/addkitoperation.cpp24
-rw-r--r--src/tools/sdktool/addkitoperation.h4
-rw-r--r--src/tools/sdktool/rmkitoperation.cpp4
-rw-r--r--tests/auto/cplusplus/ast/tst_ast.cpp61
-rw-r--r--tests/auto/cplusplus/cxx11/data/alignofAlignas.1.cpp6
-rw-r--r--tests/auto/cplusplus/findusages/tst_findusages.cpp33
-rw-r--r--tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp4
-rw-r--r--tests/cpplocators/testdata_basic/file1.mm23
-rw-r--r--tests/cppmodelmanager/testdata_defines/pch1.h1
-rw-r--r--tests/cppmodelmanager/testdata_defines/pch2.h1
-rw-r--r--tests/manual/manual.pro1
-rw-r--r--tests/manual/plain-cplusplus/Preprocessor.cpp339
-rw-r--r--tests/manual/plain-cplusplus/Preprocessor.h135
-rw-r--r--tests/manual/plain-cplusplus/main.cpp160
-rw-r--r--tests/manual/plain-cplusplus/plain-cplusplus.pro28
-rw-r--r--tests/manual/qml/testfiles/components/MyButton.qml2
-rw-r--r--tests/manual/qml/testfiles/empty.qml2
-rw-r--r--tests/manual/qml/testfiles/flipable.qml2
-rw-r--r--tests/manual/qml/testfiles/helloworld.qml2
-rw-r--r--tests/manual/qml/testfiles/helloworld_inverted.qml2
-rw-r--r--tests/manual/qml/testfiles/images.qml2
-rw-r--r--tests/manual/qml/testfiles/listmodel.qml2
-rw-r--r--tests/manual/qml/testfiles/listview.qml2
-rw-r--r--tests/manual/qml/testfiles/states.qml2
-rw-r--r--tests/manual/qml/testfiles/subcomponent.qml2
-rw-r--r--tests/manual/qml/testfiles/usingbutton.qml2
-rw-r--r--tests/manual/qml/testfiles/webview.qml1
-rw-r--r--tests/system/README12
-rw-r--r--tests/system/objects.map4
-rw-r--r--tests/system/settings/mac/QtProject/qtcreator/profiles.xml17
-rw-r--r--tests/system/settings/mac/QtProject/qtcreator/qtversion.xml14
-rw-r--r--tests/system/settings/unix/QtProject/qtcreator/profiles.xml17
-rw-r--r--tests/system/settings/unix/QtProject/qtcreator/qtversion.xml14
-rw-r--r--tests/system/settings/windows/QtProject/qtcreator/profiles.xml10
-rw-r--r--tests/system/settings/windows/QtProject/qtcreator/qtversion.xml14
-rw-r--r--tests/system/shared/classes.py16
-rw-r--r--tests/system/shared/project.py10
-rw-r--r--tests/system/shared/qtcreator.py4
-rwxr-xr-xtests/system/shared/suites_qtta.py10
-rw-r--r--tests/system/shared/utils.py6
-rwxr-xr-xtests/system/suite_CCOM/tst_CCOM01/test.py2
-rwxr-xr-xtests/system/suite_CCOM/tst_CCOM02/test.py2
-rwxr-xr-xtests/system/suite_WELP/tst_WELP01/test.py157
-rw-r--r--tests/system/suite_WELP/tst_WELP02/test.py70
-rw-r--r--tests/system/suite_debugger/tst_qml_locals/test.py2
-rw-r--r--tests/system/suite_general/tst_session_handling/test.py8
-rw-r--r--tests/system/suite_qtquick/tst_qtquick_creation4/test.py4
-rw-r--r--tests/tools/cplusplus-ast2png/dumpers.inc20
239 files changed, 3373 insertions, 2110 deletions
diff --git a/.gitignore b/.gitignore
index d98edd09bd..e507a19e1c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -137,7 +137,6 @@ tmp/
/tests/manual/qml-ast2dot/qml-ast2dot
/tests/manual/debugger/simple/libsimple_test_plugin.*dylib
/tests/manual/debugger/simple/simple_test_app
-/tests/manual/plain-cplusplus/plain-c++
/tests/manual/preprocessor/pp
/tests/tools/cplusplus-ast2png/cplusplus-ast2png
/tests/auto/aggregation/tst_aggregation
diff --git a/dist/changes-3.2.0 b/dist/changes-3.2.0
index 95cb455196..7c48a75c98 100644
--- a/dist/changes-3.2.0
+++ b/dist/changes-3.2.0
@@ -21,8 +21,11 @@ General
* Made keyboard and mouse activation of navigation panes and other trees more consistent
* Removed unhelpful Generic Highlighter loading progress bar
* Fixed case-sensitivity of file system locator filter (QTCREATORBUG-10843)
+ * Fixed that Window > Minimize, Zoom and Full Screen were always affecting the main window
+ instead of the active window
Editing
+ * Added support for manually editing bookmark line number (QTCREATORBUG-9721)
* Made Ctrl+Up and Ctrl+Down shortcuts configurable (QTCREATORBUG-4994)
* Made editor popup (Ctrl+Tab) adapt its size to contents (QTCREATORBUG-10618)
* Improved block editing (QTCREATORBUG-7773)
@@ -39,6 +42,8 @@ Editing
* Fixed Open With when file is open in multiple splits
* Fixed that search highlights were removed when switching editors
(QTCREATORBUG-9949)
+ * Fixed dropping files in the presence of splits or external windows
+ (QTCREATORBUG-9023)
Help
* Added page up and page down shortcuts to topic chooser
@@ -70,6 +75,9 @@ QMake Projects
with Qt 5.2 and later where this is supported (QTCREATORBUG-10024)
* Fixed that adding files to .pri file was missing $$PWD
+CMake Projects
+ * Fixed that .cmake files were opened as projects (QTCREATORBUG-12461)
+
Qbs Projects
* Added support for adding and removing files from projects
* Fixed that run configurations were created for products that are not runnable
@@ -124,6 +132,7 @@ QML Profiler
* Fixed drawing issues (QTBUG-38222)
* Fixed that clicking visible event was sometimes moving timeline
(QTCREATORBUG-11945)
+ * Fixed navigation through events (QTCREATORBUG-12634)
Analyzer
* Added support for Run in Terminal (QTCREATORBUG-7311)
@@ -197,6 +206,7 @@ Beautifier
* Added support for formatting a file asynchronously
* Added support for redirecting text to a formatter tool
instead of using temporary files
+ * Fixed that running formatting tool was blocking UI
Platform Specific
@@ -209,6 +219,7 @@ OS X
* Fixed activation of items with Enter in Bookmarks pane
Android
+ * Removed upper limit of version code in manifest editor (QTCREATORBUG-12668)
* Fixed that UI was unresponsive while creating AVD (QTCREATORBUG-10601)
Remote Linux
diff --git a/doc/images/creator-qbs-build-app.png b/doc/images/creator-qbs-build-app.png
new file mode 100644
index 0000000000..17e4684960
--- /dev/null
+++ b/doc/images/creator-qbs-build-app.png
Binary files differ
diff --git a/doc/images/creator-qbs-build-clean.png b/doc/images/creator-qbs-build-clean.png
new file mode 100644
index 0000000000..892a42dd57
--- /dev/null
+++ b/doc/images/creator-qbs-build-clean.png
Binary files differ
diff --git a/doc/images/qtcreator-android-deploy-configurations.png b/doc/images/qtcreator-android-deploy-configurations.png
index 169b5ce239..ea3f9a9505 100644
--- a/doc/images/qtcreator-android-deploy-configurations.png
+++ b/doc/images/qtcreator-android-deploy-configurations.png
Binary files differ
diff --git a/doc/images/qtcreator-android-manifest-editor.png b/doc/images/qtcreator-android-manifest-editor.png
index 13b206f066..31ac17eb1c 100644
--- a/doc/images/qtcreator-android-manifest-editor.png
+++ b/doc/images/qtcreator-android-manifest-editor.png
Binary files differ
diff --git a/doc/images/qtcreator-fakevim-options.png b/doc/images/qtcreator-fakevim-options.png
index d5e788eabe..4257cfa098 100644
--- a/doc/images/qtcreator-fakevim-options.png
+++ b/doc/images/qtcreator-fakevim-options.png
Binary files differ
diff --git a/doc/images/qtcreator-kit-selector.png b/doc/images/qtcreator-kit-selector.png
index 4319cb32a4..dcd53f7fa9 100644
--- a/doc/images/qtcreator-kit-selector.png
+++ b/doc/images/qtcreator-kit-selector.png
Binary files differ
diff --git a/doc/src/analyze/creator-analyze.qdoc b/doc/src/analyze/creator-analyze.qdoc
index a3663c87c4..d0a760c3b2 100644
--- a/doc/src/analyze/creator-analyze.qdoc
+++ b/doc/src/analyze/creator-analyze.qdoc
@@ -38,10 +38,8 @@
\image qtcreator-analyze-menu.png "Analyze mode menu"
- By default, the views in the \gui Analyze mode are locked into place in the
- workspace. Select \gui {Window > Views > Locked} to unlock the views. Drag
- and drop the views into new positions on the screen. Drag view borders to
- resize the views. The size and position of views are saved for future
+ You can drag and drop the views in the \gui Analyze mode to new positions
+ on the screen. The size and position of views are saved for future
sessions. Select \gui {Window > Views > Reset to Default Layout} to reset
the views to their original sizes and positions.
diff --git a/doc/src/analyze/creator-valgrind.qdoc b/doc/src/analyze/creator-valgrind.qdoc
index 6df6499b60..6b475066b3 100644
--- a/doc/src/analyze/creator-valgrind.qdoc
+++ b/doc/src/analyze/creator-valgrind.qdoc
@@ -46,9 +46,7 @@
\li In the \gui Projects mode, select a debug build configuration.
- \li Select \gui Analyze to open the \gui Analyze mode.
-
- \li Select \gui {Analyze Memory} on the toolbar.
+ \li Select \gui Analyze > \gui {Valgrind Memory Analyzer}.
\li Select the
\inlineimage qtcreator-analyze-start-button.png "Start button"
@@ -156,9 +154,7 @@
\li In the \gui Projects mode, select a release build configuration.
- \li Select \gui Analyze to open the \gui Analyze mode.
-
- \li Select \gui Profile on the toolbar.
+ \li Select \gui Analyze > \gui {Valgrind Function Profiler}.
\li Select the
\inlineimage qtcreator-analyze-start-button.png "Start button"
diff --git a/doc/src/android/androiddev.qdoc b/doc/src/android/androiddev.qdoc
index 3adc7d08e9..1a144cf468 100644
--- a/doc/src/android/androiddev.qdoc
+++ b/doc/src/android/androiddev.qdoc
@@ -190,7 +190,7 @@
information, see the Android documentation.
In addition, debugging is supported at android-10 API level, or higher. In
- the run settings for the project, in the \gui {Android target SDK} field,
+ the run settings for the project, in the \gui {Android build SDK} field,
select android-10, or higher. For more information about Android API levels,
see \l{http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels}
{What is API Level?}.
diff --git a/doc/src/android/deploying-android.qdoc b/doc/src/android/deploying-android.qdoc
index 8261e4fb2b..a1202e5d7b 100644
--- a/doc/src/android/deploying-android.qdoc
+++ b/doc/src/android/deploying-android.qdoc
@@ -146,7 +146,7 @@
\section3 Selecting API Level
- In the \gui {Android target SDK} field, you can select the API level to use
+ In the \gui {Android build SDK} field, you can select the API level to use
for building the application. Usually, you should select the newest API
level available.
@@ -235,6 +235,9 @@
install the application. Android OS then grants the application access to
the appropriate data and features.
- To add permissions, select \gui Add and select permissions from the list.
+ Select the \gui {Include default permissions and features for Qt modules}
+ check box to add the permissions needed by Qt libraries.
+
+ To add permissions, select them in the list, and then select \gui Add.
*/
diff --git a/doc/src/debugger/creator-debugger.qdoc b/doc/src/debugger/creator-debugger.qdoc
index 9ffea0e51c..3f049c335f 100644
--- a/doc/src/debugger/creator-debugger.qdoc
+++ b/doc/src/debugger/creator-debugger.qdoc
@@ -412,10 +412,8 @@
\image qtcreator-debugger-views.png "Debug mode views"
- By default, the views are locked into place in the workspace. Select
- \gui {Window > Views > Locked} to unlock the views. Drag and drop the
- views into new positions on the screen. Drag view borders to resize the
- views. The size and position of views are saved for future sessions. Select
+ You can drag and drop the views in \QD to new positions on the screen.
+ The size and position of views are saved for future sessions. Select
\gui {Window > Views > Reset to Default Layout} to reset the views to
their original sizes and positions.
@@ -894,8 +892,8 @@
Debugging helpers are always automatically used. To force a plain
C-like display of structures, select \gui Tools > \gui Options >
- \gui Debugger > \gui {Locals & Expressions}, and then select the
- \gui{Force Raw Structure Display} check box. For GDB
+ \gui Debugger > \gui {Locals & Expressions}, and then deselect the
+ \gui{Use Debugging Helper} check box. For GDB
and LLDB this will still use the Python scripts, but generate
more basic output. To force plain display for a single object
or for all objects of a given type, select the corresponding
@@ -1218,7 +1216,7 @@
\li Make sure the debugger is set up properly. For more information,
see \l{Setting Up Debugger}.
- \li In the \gui Debug mode, select \gui {Windows > Views > Debugger
+ \li In the \gui Debug mode, select \gui {Window > Views > Debugger
Log} to open the \gui {Debugger Log} view. Browse the contents of
the pane on the right hand side to find out what went wrong.
Always attach the contents of the pane to debugger-related
diff --git a/doc/src/editors/creator-coding-edit-mode.qdoc b/doc/src/editors/creator-coding-edit-mode.qdoc
index 53924284c5..67223821e6 100644
--- a/doc/src/editors/creator-coding-edit-mode.qdoc
+++ b/doc/src/editors/creator-coding-edit-mode.qdoc
@@ -142,12 +142,12 @@
\section1 Moving to Symbol Definition or Declaration
You can move directly to the definition or the declaration of a symbol by
- holding the \key Ctrl and clicking the symbol. If you have multiple splits
+ holding the \key Ctrl key and clicking the symbol. If you have multiple splits
opened, you can open the link in the next split by holding \key Ctrl and
- \key Alt while clicking on the symbol.
+ \key Alt while clicking the symbol.
- To enable this moving function, in \gui Tools > \gui{Options} >
- \gui{Text Editor} > \gui Behavior, select \gui{Enable mouse navigation}.
+ To enable this moving function, select \gui Tools > \gui{Options} >
+ \gui{Text Editor} > \gui Behavior > \gui{Enable mouse navigation}.
You can also select the symbol and press \key F2, or right-click the symbol
and select \gui {Follow Symbol Under Cursor} to move to its definition or
diff --git a/doc/src/howto/creator-cli.qdoc b/doc/src/howto/creator-cli.qdoc
index d339e9da4d..69d596feee 100644
--- a/doc/src/howto/creator-cli.qdoc
+++ b/doc/src/howto/creator-cli.qdoc
@@ -42,7 +42,7 @@
between the filename and line number. You can also use a space between the
separator and the line number.
- For example:
+ For example, on Windows:
\list
@@ -54,6 +54,14 @@
\endlist
+ On OS X:
+
+ \list
+
+ \li \c {Qt Creator.app/Contents/MacOS/Qt Creator -help}
+
+ \endlist
+
To open a project that is located in a particular folder, you can pass on the folder
name as a command line argument. \QC looks for a session that matches the folder name and
loads it. Or it looks for a project file in the folder and opens it. For example:
@@ -89,6 +97,16 @@
\li Attempt to connect to an already running instance of \QC.
\row
+ \li -pid
+ \li Attempt to connect to an already running instance of \QC with
+ the specified process ID.
+
+ \row
+ \li -block
+ \li Open files in editors in a running \QC instance and block the
+ command line until the first editor is closed.
+
+ \row
\li -load <plugin>
\li Load the specified plugin.
@@ -113,6 +131,11 @@
\li -color <color>
\li Core plugin: override the selected UI color.
+ \row
+ \li -presentationMode
+ \li Core plugin: display keyboard shortcuts as popups when you
+ press them. Mostly useful when presenting \QC to someone else.
+
\row
\li -debug <pid>
\li Debugger plugin: attach to the process with the given process ID.
@@ -146,9 +169,9 @@
and sysroots.
\row
- \li -wincrashevent <event-handle>
+ \li -wincrashevent <event-handle:pid>
\li Debugger plugin: Attach to crashed processes by using the specified
- event handle.
+ event handle and process ID.
\row
\li -customwizard-verbose
@@ -162,10 +185,6 @@
Open the projects and files that were open when you last exited \QC.
For more information about managing sessions, see \l{Managing Sessions}.
- \row
- \li -block
- \li Open files in editors in a running \QC instance and block the
- command line until the first editor is closed.
\endtable
\section1 Using Custom Styles
diff --git a/doc/src/howto/creator-external-tools.qdoc b/doc/src/howto/creator-external-tools.qdoc
index df8e4637f0..0369702c01 100644
--- a/doc/src/howto/creator-external-tools.qdoc
+++ b/doc/src/howto/creator-external-tools.qdoc
@@ -43,11 +43,12 @@
code and translations. The lrelease tool is used to create run-time
translation files for use by the released application.
- To synchronize ts files from a translator with the application code,
+ To synchronize translation source (TS) files from a translator with the
+ application code,
select \gui {Tools > External > Text > Linguist > Update Translations
(lupdate)}.
- To generate from the ts files qm translation files that can be used by an
+ To generate from the TS files Qt message (QM) files that can be used by an
application, select \gui {Tools > External > Text > Linguist > Release
Translations (lrelease)}.
diff --git a/doc/src/howto/creator-vcs.qdoc b/doc/src/howto/creator-vcs.qdoc
index 5b35e2f064..02abcec556 100644
--- a/doc/src/howto/creator-vcs.qdoc
+++ b/doc/src/howto/creator-vcs.qdoc
@@ -96,9 +96,9 @@
to \c %HOMEDRIVE%%HOMEPATH% when the Git executable is run and authorization
works as it would with \c {git bash}.
- \section1 Setting Up Common Options
+ \section1 Setting Up General Options
- Select \gui{Tools} > \gui{Options} > \gui{Version Control} > \gui{Common}
+ Select \gui{Tools} > \gui{Options} > \gui{Version Control} > \gui{General}
to specify settings for submit messages:
\list
@@ -109,33 +109,36 @@
parameter. If there is an error, the script should output a
message on standard error and return a non-zero exit code.
- \li \gui{User/alias configuration file} takes a file in mailmap format
- that lists user names and aliases. For example:
+ \li \gui{User/alias configuration file} is a text file that lists
+ author names in mailmap format. For each author, you must specify a
+ real name and email address and optionally an alias and a second
+ email address. For example:
\code
- Jon Doe <Jon.Doe@company.com>
+ Jon Doe <Jon.Doe@company.com> jdoe <jdoe@somemail.com>
Hans Mustermann <Hans.Mustermann@company.com> hm <info@company.com>
\endcode
- \note The second line above specifies the alias \e{hm} and the
- corresponding email address for \e{Hans Mustermann}. If the
- user/alias configuration file is present, the submit editor
- displays a context menu with \gui{Insert name} that pops up a
- dialog letting the user select a name.
+ After you specify a file in this field, you can select authors
+ as values of the submit message fields in the \gui Nicknames dialog.
\li \gui{User fields configuration file} is a simple text file
consisting of lines specifying submit message fields that take
- user names, for example:
+ authors as values, for example:
\code
- Reviewed-by:
+ Acked-by:
+ Initial-patch-by:
+ Reported-by:
+ Rubber-stamped-by:
Signed-off-by:
+ Tested-by:
\endcode
- The fields above appear below the submit message. They provide
- completion for the aliases/public user names specified in the
- \e{User/alias configuration file} as well as a button that opens the
- aforementioned user name dialog.
+ After you specify a file in this field, you can add authors as
+ values of the submit message fields when submitting changes. If
+ you also specified a \gui{User/alias configuration file}, you can
+ select authors in the \gui Nicknames dialog.
\li \gui{SSH prompt command} specifies an ssh-askpass command that you
can use (on Linux) to prompt the user for a password when using SSH.
diff --git a/doc/src/linux-mobile/creator-projects-running-generic-linux.qdocinc b/doc/src/linux-mobile/creator-projects-running-generic-linux.qdocinc
index e0f8398459..e276915812 100644
--- a/doc/src/linux-mobile/creator-projects-running-generic-linux.qdocinc
+++ b/doc/src/linux-mobile/creator-projects-running-generic-linux.qdocinc
@@ -1,8 +1,6 @@
\section1 Running on Embedded Linux Devices
- \list 1
-
- \li Build and run the application for a device:
+ To build and run the application for a device:
\list 1
@@ -13,8 +11,6 @@
\endlist
- \endlist
-
\QC uses the compiler specified in the project build settings
(tool chain) to build the application.
diff --git a/doc/src/projects/creator-projects-building.qdoc b/doc/src/projects/creator-projects-building.qdoc
index ccbedf5770..59ccb91dd8 100644
--- a/doc/src/projects/creator-projects-building.qdoc
+++ b/doc/src/projects/creator-projects-building.qdoc
@@ -48,12 +48,17 @@
\list 1
- \li Select a \l{glossary-buildandrun-kit}{kit} for the project.
+ \li Click the \gui {Build and Run Kit Selector} icon (1) or select
+ \gui Build > \gui {Open Build and Run Kit Selector} to select the
+ build and run \l{glossary-buildandrun-kit}{kit}.
\image qtcreator-kit-selector.png "Kit selector"
\li Choose \gui {Build > Build Project} or press \key {Ctrl+B}.
+ You can also select the \gui Run button (2) to also deploy and run
+ the application after building it.
+
\endlist
For more information on the options you have, see
@@ -63,4 +68,10 @@
subproject, you can use the \gui Build menu commands to build a file or
subproject.
+ To remove all build artifacts, select \gui Build > \gui {Clean All} or
+ \gui {Clean Project}. To clean the build directory and then build the
+ project, select \gui Build > \gui {Rebuild All} or \gui {Rebuild Project}.
+
+ To run qmake to generate new Makefiles, select \gui Build > \gui qmake.
+
*/
diff --git a/doc/src/projects/creator-projects-qbs.qdoc b/doc/src/projects/creator-projects-qbs.qdoc
index a04763e50d..9c8b246e94 100644
--- a/doc/src/projects/creator-projects-qbs.qdoc
+++ b/doc/src/projects/creator-projects-qbs.qdoc
@@ -39,6 +39,8 @@
selecting \gui Help > \gui {About Plugins} > \gui {Build Systems}
> \gui {QbsProjectManager} and restarting \QC.
+ \section1 Building Qbs
+
To build the Qbs plugin yourself from the \QC git repository:
\list 1
@@ -46,7 +48,7 @@
\li Fetch the Qbs submodule in your \QC git checkout with
\c {git submodule update --init}.
- \li Run qmake on \QC and build \QC again.
+ \li Use Qbs or qmake and make to build \QC again.
\li Enable the Qbs plugin as described above.
@@ -69,10 +71,88 @@
\c Depends item for a Qt application. For examples, see the
\c {examples} directory in the qbs repository.
+ \li Select \gui Projects to specify \gui {Build Settings} for the
+ project.
+
+ \li Select \gui {Build Steps} > \gui Details to specify build steps:
+
+ \image creator-qbs-build-app.png
+
+ \list 1
+
+ \li In the \gui {Build variant} field, select \gui Debug to
+ include debug symbols in the build for debugging the
+ application and \gui Release to create the final
+ installation file.
+
+ \li In the \gui {Parallel jobs} field, specify the number of
+ parallel jobs to use for building.
+
+ \li Select the \gui {Enable QML debugging} check box to debug
+ Qt Quick application projects.
+
+ \note Debugging requires opening a socket at a well-known
+ port, which presents a security risk. Anyone on the Internet
+ could connect to the application that you are debugging and
+ execute any JavaScript functions. Therefore, you must make
+ sure that the port is properly protected by a firewall.
+
+ \li In the \gui Properties field, specify the properties to pass
+ to the project. Use colons (:) to separate keys from values.
+ For more information, see
+ \l{http://qt-project.org/doc/qbs/language-introduction.html}
+ {Modules} in the Qbs Manual.
+
+ \li In the \gui Flags field:
+
+ \list
+
+ \li Select \gui {Dry run} to test building without
+ executing commands or making permanent
+ changes to the build graph.
+
+ \li Select \gui {Keep going} to continue building when
+ errors occur, if possible.
+
+ \li Select \gui {Check timestamps} to retrieve the
+ timestamps from the file system instead of using the
+ ones stored in the build graph. You only need this
+ option if you made changes to the build directory
+ manually, which is not recommended.
+
+ \endlist
+
+ \endlist
+
+ The \gui {Equivalent command line} field displays the build command
+ that is constructed based on the selected options.
+
+ \li Select \gui {Clean Steps} > \gui Details to specify flags for the
+ cleaning step.
+
+ \image creator-qbs-build-clean.png
+
+ \list
+
+ \li Select \gui {Clean all artifacts} to remove all build
+ artifacts.
+
+ \li Select \gui {Dry run} to test cleaning without executing
+ commands or making permanent changes to the build graph.
+
+ \li Select \gui {Keep going} to continue cleaning when errors
+ occur, if possible.
+
+ \endlist
+
+ The \gui {Equivalent command line} field displays the clean command
+ that is constructed based on the selected options.
+
+ \li Select \gui Build > \gui {Build Project} to build the application.
+
\li Click the
\inlineimage qtcreator-run.png
- (\gui Run) button to build, deploy, and run the application.
-
+ (\gui Run) button to deploy and run the application.
\endlist
*/
diff --git a/doc/src/projects/creator-projects-running-desktop.qdocinc b/doc/src/projects/creator-projects-running-desktop.qdocinc
deleted file mode 100644
index 5782622658..0000000000
--- a/doc/src/projects/creator-projects-running-desktop.qdocinc
+++ /dev/null
@@ -1,11 +0,0 @@
- \section1 Running on Desktop
-
- \list 1
-
- \li Select \gui Desktop as the build and run \l{glossary-buildandrun-kit}{kit}.
-
- \image qtcreator-kit-selector.png "Kit selector"
-
- \li Click the \gui Run button.
-
- \endlist
diff --git a/doc/src/projects/creator-projects-running.qdoc b/doc/src/projects/creator-projects-running.qdoc
index 534bec7690..48d7866f64 100644
--- a/doc/src/projects/creator-projects-running.qdoc
+++ b/doc/src/projects/creator-projects-running.qdoc
@@ -34,14 +34,28 @@
location from where it can be run on the desktop, on a device emulator or
simulator, or on a mobile device that is connected to the development PC.
- To run executable files without deploying them first, deselect the
- \gui {Tools > Options > Project > Always deploy project before running it}
- option.
+ To run executable files without deploying them first, select \gui Build >
+ \gui {Run Without Deployment}. To make this the default option, deselect the
+ \gui Tools > \gui Options > \gui Project >
+ \gui {Always deploy project before running it} option.
+
+ To run applications:
+
+ \list 1
+
+ \li Click the \gui {Build and Run Kit Selector} icon (1) or select
+ \gui Build > \gui {Open Build and Run Kit Selector} to select the
+ build and run \l{glossary-buildandrun-kit}{kit}.
+
+ \image qtcreator-kit-selector.png "Kit selector"
+
+ \li Click the \gui Run button (2).
+
+ \endlist
For more information on the options you have, see
\l{Specifying Run Settings}.
- \include projects/creator-projects-running-desktop.qdocinc
\include linux-mobile/creator-projects-running-generic-linux.qdocinc
\include qnx/creator-projects-running-qnx.qdocinc
*/
diff --git a/doc/src/projects/creator-projects-settings-build.qdoc b/doc/src/projects/creator-projects-settings-build.qdoc
index 67fc627391..029ea38fed 100644
--- a/doc/src/projects/creator-projects-settings-build.qdoc
+++ b/doc/src/projects/creator-projects-settings-build.qdoc
@@ -120,6 +120,9 @@
the build step and add a custom build step that specifies another shell
command.
+ \note For more information about the build steps when using Qbs, see
+ \l{Building Applications with Qbs}.
+
\section2 Adding Custom Build Steps
To add custom steps to the build settings, select \gui {Add Build Step >
@@ -156,6 +159,9 @@
(\gui {Move Up} and \gui {Move Down}).
\endlist
+ \note For more information about the cleaning steps when using Qbs, see
+ \l{Building Applications with Qbs}.
+
\section1 Build Environment
You can specify the environment you want to use for building in the
diff --git a/doc/src/qtquick/qtquick-app-development.qdoc b/doc/src/qtquick/qtquick-app-development.qdoc
index 307d22c29e..c54a065498 100644
--- a/doc/src/qtquick/qtquick-app-development.qdoc
+++ b/doc/src/qtquick/qtquick-app-development.qdoc
@@ -43,14 +43,14 @@
\li \l {Creating Components}
- You can use predefined QML types to create components or use a set
- of Qt Quick Controls for creating classic desktop-style user
- interfaces using Qt Quick 2.1 (available since Qt 5.1).
+ You can use basic QML types to create your own components that you
+ can combine with ready-made Qt Quick Controls and Layouts
+ (available since Qt 5.1).
\li \l {Creating Screens}
- You can use predefined QML types, Qt Quick Controls, and your own
- components to create screens. You can use states and transitions to
- navigate between screens.
+ You can combine basic QML types with ready-made Qt Quick Controls,
+ Dialogs, and Layouts (available since Qt 5.1) to create screens. You
+ can use states and transitions to navigate between screens.
\li \l {Exporting Designs from Graphics Software}
You can export designs from graphics software, such as Adobe
diff --git a/doc/src/qtquick/qtquick-components.qdoc b/doc/src/qtquick/qtquick-components.qdoc
index 4980510261..07fb88aeb5 100644
--- a/doc/src/qtquick/qtquick-components.qdoc
+++ b/doc/src/qtquick/qtquick-components.qdoc
@@ -71,14 +71,11 @@
\endlist
- QML types allow you to write cross-platform applications with custom look
- and feel. You can also use ready-made Qt Quick Components (for Qt 4) to
- create screens with a native look and feel for a particular target platform.
- Since Qt 5.1, a set of Qt Quick Controls is available for creating classic
- desktop-style user interfaces using Qt Quick 2.1.
-
- Qt Quick 1 Components are a part of Qt 4, whereas Qt Quick Controls were
- added to Qt 5.1.
+ You can also use ready-made Qt Quick 1 Components (for Qt 4) to create
+ screens with a native look and feel for a particular target platform.
+ Since Qt 5.1, Qt Quick Controls, Dialogs, and Layouts are available for
+ creating classic desktop-style user interfaces using Qt Quick 2.1. You can
+ use the Qt Quick Controls Styles to customize Qt Quick Controls.
The \QC project wizards create Qt Quick applications that use Qt Quick
Components or Controls.
diff --git a/doc/src/qtquick/qtquick-creating.qdoc b/doc/src/qtquick/qtquick-creating.qdoc
index 8c0117a25b..8870e7c1ad 100644
--- a/doc/src/qtquick/qtquick-creating.qdoc
+++ b/doc/src/qtquick/qtquick-creating.qdoc
@@ -68,10 +68,10 @@
\gui {Qt Quick UI} > \gui Choose.
\li In the \gui {Qt Quick component set} field, select the component set
- to use for the project. The Qt Quick imports enable you to create
- cross-platform applications with a custom look and feel, whereas the
- Qt Quick Controls provide the look and feel for a particular
- platform:
+ to use for the project. The Qt Quick imports enable you to use the
+ basic QML types to create user interfaces, whereas the Qt Quick
+ Controls provide a set of ready-made controls that you can customize
+ by using Qt Quick Controls Styles:
\list
@@ -85,6 +85,10 @@
\endlist
+ You can add imports later to combine Qt Quick basic types with Qt Quick
+ Controls, Qt Quick Dialogs, and Qt Quick Layouts (available since
+ Qt 5.1).
+
\endlist
\QC creates the following files:
diff --git a/doc/src/qtquick/qtquick-designer.qdoc b/doc/src/qtquick/qtquick-designer.qdoc
index c6b22bb80a..cc8b45025e 100644
--- a/doc/src/qtquick/qtquick-designer.qdoc
+++ b/doc/src/qtquick/qtquick-designer.qdoc
@@ -143,9 +143,9 @@
components, basic types, layouts, positioner types, and views.
Sets of UI components with the look and feel of a particular mobile device
- platform have been defined for Qt Quick 1. Since Qt 5.1, a set of Qt Quick
- Controls is available for creating classic desktop-style user interfaces
- using Qt Quick 2.1. The Qt Quick Components and Controls are based on
+ platform have been defined for Qt Quick 1. Since Qt 5.1, ready-made Qt
+ Quick Controls, Dialogs, and Layouts are available for creating user
+ interfaces using Qt Quick 2.1. The components and controls are based on
standard QML types. To view the components and controls in the
\gui {Library} pane, import the component sets in the \gui Imports pane.
diff --git a/doc/src/qtquick/qtquick-screens.qdoc b/doc/src/qtquick/qtquick-screens.qdoc
index 283fcc9f4f..0f7ce685fd 100644
--- a/doc/src/qtquick/qtquick-screens.qdoc
+++ b/doc/src/qtquick/qtquick-screens.qdoc
@@ -40,9 +40,9 @@
You can also use ready-made Qt Quick 1 Components (for Qt 4) to create
screens with a native look and feel for a particular target platform.
- Since Qt 5.1, a set of Qt Quick Controls is available for creating classic
- desktop-style user interfaces using Qt Quick 2.1. Qt Quick 1 Components are
- a part of Qt 4, whereas Qt Quick Controls were added to Qt 5.1.
+ Since Qt 5.1, Qt Quick Controls, Dialogs, and Layouts are available for
+ creating classic desktop-style user interfaces using Qt Quick 2.1. You can
+ use the Qt Quick Controls Styles to customize Qt Quick Controls.
\section1 Adding Components to Screens
@@ -347,10 +347,6 @@
\li \l{Flickable}
items can be flicked horizontally or vertically.
- \li \l{Flipable}
- items can be flipped between their front and back sides by using
- rotation, state, and transition.
-
\li FocusScope
assists in keyboard focus handling when building reusable QML
components.
@@ -394,18 +390,24 @@
down buttons, by pressing up or down on the keyboard, or by entering
a value in the box.
+ \omit
+ Not visible in the item library in 3.2.
\li StatusBar contains status information in your application. It
does not provide a layout of its own, but requires you to position
its contents, for instance by creating a \gui {Row Layout}.
+ \endomit
\li TextArea displays multiple lines of editable formatted text.
\li TextField displays a single line of editable plain text.
+ \omit
+ Not visible in the item library in 3.2.
\li ToolBar provides styling for ToolButton as well as other controls
that it can contain. However, it does not provide a layout of its
own, but requires you to position its contents, for instance by
creating a \gui {Row Layout}.
+ \endomit
\li ToolButton provides a button that is functionally similar to
\gui Button, but that looks more suitable on a \gui {Tool Bar}.
diff --git a/doc/src/widgets/qtdesigner-overview.qdoc b/doc/src/widgets/qtdesigner-overview.qdoc
index 989e65a1a3..ce7dfeb765 100644
--- a/doc/src/widgets/qtdesigner-overview.qdoc
+++ b/doc/src/widgets/qtdesigner-overview.qdoc
@@ -61,18 +61,7 @@
\section1 Specifying Settings for Qt Designer
- To change the layout of \QD user interface elements:
-
- \list 1
-
- \li Select \gui Tools > \gui{Form Editor} > \gui Views > \gui Locked.
-
- When this option is not checked, you can change the layout.
-
- \li Click the header of an element and drag the element to a new
- position.
-
- \endlist
+ You can drag and drop the views in \QD to new positions on the screen.
To specify settings for \QD:
diff --git a/doc/src/winrt/creator-winrt.qdoc b/doc/src/winrt/creator-winrt.qdoc
index ba6b744010..58228be6e5 100644
--- a/doc/src/winrt/creator-winrt.qdoc
+++ b/doc/src/winrt/creator-winrt.qdoc
@@ -42,7 +42,7 @@
\list 1
\li Select \gui Help > \gui {About Plugins} > \gui {Device Support} >
- \gui WinRT to enable the experimental Winows Runtime plugin.
+ \gui WinRT to enable the experimental Windows Runtime plugin.
\li Restart \QC to be able to use the plugin.
@@ -55,7 +55,7 @@
\li Select \gui Projects > \gui {Build & Run} > \gui {Add Kit} to
add a kit for building and running applications on Windows
- Runtime devices (the local computer, for now) Windows Phones,
+ Runtime devices (the local computer, for now), Windows Phones,
or the Windows Phone emulator.
\endlist
diff --git a/qbs/imports/QtcProduct.qbs b/qbs/imports/QtcProduct.qbs
index a0433de4ef..7372fa7698 100644
--- a/qbs/imports/QtcProduct.qbs
+++ b/qbs/imports/QtcProduct.qbs
@@ -15,6 +15,7 @@ Product {
}
cpp.minimumOsxVersion: "10.7"
cpp.minimumWindowsVersion: qbs.architecture === "x86" ? "5.1" : "5.2"
+ cpp.visibility: "minimal"
Depends { name: "Qt.core" }
diff --git a/qbs/modules/pluginspec/pluginspec.qbs b/qbs/modules/pluginspec/pluginspec.qbs
index 2b57b53d89..8c1045f3a3 100644
--- a/qbs/modules/pluginspec/pluginspec.qbs
+++ b/qbs/modules/pluginspec/pluginspec.qbs
@@ -12,7 +12,7 @@ Module {
Artifact {
fileTags: ["pluginSpec"]
- fileName: input.fileName.replace(/\.[^\.]*$/,'')
+ filePath: input.fileName.replace(/\.[^\.]*$/,'')
}
prepare: {
@@ -72,7 +72,7 @@ Module {
Artifact {
fileTags: ["qt_plugin_metadata"]
- fileName: {
+ filePath: {
var destdir = FileInfo.joinPaths(product.moduleProperty("Qt/core", "generatedFilesDir"),
input.fileName);
return destdir.replace(/\.[^\.]*$/, '.json');
diff --git a/qtcreator.pro b/qtcreator.pro
index ad7b7d763c..5d22eb0409 100644
--- a/qtcreator.pro
+++ b/qtcreator.pro
@@ -65,7 +65,7 @@ minQtVersion(5, 0, 0):exists(src/shared/qbs/qbs.pro) {
cache(QBS_RELATIVE_PLUGINS_PATH)
QBS_RELATIVE_SEARCH_PATH = $$relative_path($$QBS_RESOURCES_BUILD_DIR, $$QBS_APPS_DESTDIR)
cache(QBS_RELATIVE_SEARCH_PATH)
- QBS_CONFIG_ADDITION = qbs_no_dev_install
+ QBS_CONFIG_ADDITION = qbs_no_dev_install qbs_enable_project_file_updates
cache(CONFIG, add, QBS_CONFIG_ADDITION)
}
diff --git a/qtcreator.qbs b/qtcreator.qbs
index e0ee270736..7993328ffa 100644
--- a/qtcreator.qbs
+++ b/qtcreator.qbs
@@ -1,6 +1,7 @@
import qbs 1.0
Project {
+ minimumQbsVersion: "1.3"
property bool withAutotests: qbs.buildVariant === "debug"
property string ide_version_major: '3'
property string ide_version_minor: '2'
diff --git a/scripts/deployqtHelper_mac.sh b/scripts/deployqtHelper_mac.sh
index 28e3d26c23..3331e27a2e 100755
--- a/scripts/deployqtHelper_mac.sh
+++ b/scripts/deployqtHelper_mac.sh
@@ -44,6 +44,7 @@ macdeployqt "$1" \
"-executable=$1/Contents/Resources/sdktool" \
"-executable=$1/Contents/Resources/ios/iostool" \
"-executable=$1/Contents/Resources/ios/iossim" \
+ "-executable=$1/Contents/Resources/ios/iossim_1_8_2" \
"$qmlpuppetArgument" "$qml2puppetArgument" || exit 1
# copy qt creator qt.conf
diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py
index 5f1781e84d..4a99983e4a 100644
--- a/share/qtcreator/debugger/gdbbridge.py
+++ b/share/qtcreator/debugger/gdbbridge.py
@@ -510,7 +510,7 @@ class Dumper(DumperBase):
self.typesToReport = {}
if "forcens" in self.options:
- self.qtNamepaceToRport = self.qtNamespace()
+ self.qtNamepaceToReport = self.qtNamespace()
if self.qtNamespaceToReport:
self.output.append(',qtnamespace="%s"' % self.qtNamespaceToReport)
@@ -1500,6 +1500,16 @@ class Dumper(DumperBase):
except:
pass
+ try:
+ # Seemingly needed with Debian's GDB 7.4.1
+ s = gdb.execute("ptype QByteArray", to_string=True)
+ ns = s[s.find("class")+6:s.find("QByteArray")]
+ if len(ns):
+ self.qtNamespaceToReport = ns
+ self.qtNamespace = lambda: ns
+ return ns
+ except:
+ pass
self.currentQtNamespaceGuess = ""
return ""
diff --git a/share/qtcreator/qml/qmlpuppet/commands/valueschangedcommand.cpp b/share/qtcreator/qml/qmlpuppet/commands/valueschangedcommand.cpp
index cb7a316426..a995ab36fb 100644
--- a/share/qtcreator/qml/qmlpuppet/commands/valueschangedcommand.cpp
+++ b/share/qtcreator/qml/qmlpuppet/commands/valueschangedcommand.cpp
@@ -29,7 +29,7 @@
#include "valueschangedcommand.h"
-#include <QSharedMemory>
+#include "sharedmemory.h"
#include <QCache>
#include <QDebug>
@@ -37,7 +37,7 @@
namespace QmlDesigner {
-static QCache<qint32, QSharedMemory> globalSharedMemoryCache(10000);
+static QCache<qint32, SharedMemory> globalSharedMemoryCache(10000);
ValuesChangedCommand::ValuesChangedCommand()
: m_keyNumber(0)
@@ -63,7 +63,7 @@ quint32 ValuesChangedCommand::keyNumber() const
void ValuesChangedCommand::removeSharedMemorys(const QVector<qint32> &keyNumberVector)
{
foreach (qint32 keyNumber, keyNumberVector) {
- QSharedMemory *sharedMemory = globalSharedMemoryCache.take(keyNumber);
+ SharedMemory *sharedMemory = globalSharedMemoryCache.take(keyNumber);
delete sharedMemory;
}
}
@@ -75,17 +75,11 @@ void ValuesChangedCommand::sort()
static const QLatin1String valueKeyTemplateString("Values-%1");
-static QSharedMemory *createSharedMemory(qint32 key, int byteCount)
+static SharedMemory *createSharedMemory(qint32 key, int byteCount)
{
- QSharedMemory *sharedMemory = new QSharedMemory(QString(valueKeyTemplateString).arg(key));
+ SharedMemory *sharedMemory = new SharedMemory(QString(valueKeyTemplateString).arg(key));
bool sharedMemoryIsCreated = sharedMemory->create(byteCount);
- if (!sharedMemoryIsCreated) {
- if (sharedMemory->isAttached())
- sharedMemory->attach();
- sharedMemory->detach();
- sharedMemoryIsCreated = sharedMemory->create(byteCount);
- }
if (sharedMemoryIsCreated) {
globalSharedMemoryCache.insert(key, sharedMemory);
@@ -109,12 +103,13 @@ QDataStream &operator<<(QDataStream &out, const ValuesChangedCommand &command)
temporaryOutDataStream << command.valueChanges();
- QSharedMemory *sharedMemory = createSharedMemory(keyCounter, outDataStreamByteArray.size());
+ SharedMemory *sharedMemory = createSharedMemory(keyCounter, outDataStreamByteArray.size());
if (sharedMemory) {
sharedMemory->lock();
std::memcpy(sharedMemory->data(), outDataStreamByteArray.constData(), sharedMemory->size());
sharedMemory->unlock();
+
out << command.keyNumber();
return out;
}
@@ -128,13 +123,18 @@ QDataStream &operator<<(QDataStream &out, const ValuesChangedCommand &command)
void readSharedMemory(qint32 key, QVector<PropertyValueContainer> *valueChangeVector)
{
- QSharedMemory sharedMemory(QString(valueKeyTemplateString).arg(key));
+ SharedMemory sharedMemory(QString(valueKeyTemplateString).arg(key));
bool canAttach = sharedMemory.attach(QSharedMemory::ReadOnly);
if (canAttach) {
+ sharedMemory.lock();
+
QDataStream in(QByteArray::fromRawData(static_cast<const char*>(sharedMemory.constData()), sharedMemory.size()));
in.setVersion(QDataStream::Qt_4_8);
in >> *valueChangeVector;
+
+ sharedMemory.unlock();
+ sharedMemory.detach();
}
}
diff --git a/share/qtcreator/qml/qmlpuppet/container/container.pri b/share/qtcreator/qml/qmlpuppet/container/container.pri
index 8889196708..51bbb43aec 100644
--- a/share/qtcreator/qml/qmlpuppet/container/container.pri
+++ b/share/qtcreator/qml/qmlpuppet/container/container.pri
@@ -1,21 +1,24 @@
INCLUDEPATH += $$PWD/
HEADERS += $$PWD/addimportcontainer.h
+HEADERS += $$PWD/sharedmemory.h
HEADERS += $$PWD/imagecontainer.h
HEADERS += $$PWD/idcontainer.h
HEADERS += $$PWD/informationcontainer.h
HEADERS += $$PWD/instancecontainer.h
HEADERS += $$PWD/reparentcontainer.h
-HEADERS += $$PWD/propertyabstractcontainer.h
-HEADERS += $$PWD/propertybindingcontainer.h
-HEADERS += $$PWD/propertyvaluecontainer.h
+HEADERS += $$PWD/propertyabstractcontainer.h
+HEADERS += $$PWD/propertybindingcontainer.h
+HEADERS += $$PWD/propertyvaluecontainer.h
-SOURCES += $$PWD/addimportcontainer.cpp
-SOURCES += $$PWD/imagecontainer.cpp
-SOURCES += $$PWD/idcontainer.cpp
-SOURCES += $$PWD/informationcontainer.cpp
-SOURCES += $$PWD/instancecontainer.cpp
-SOURCES += $$PWD/reparentcontainer.cpp
-SOURCES += $$PWD/propertyabstractcontainer.cpp
-SOURCES += $$PWD/propertybindingcontainer.cpp
-SOURCES += $$PWD/propertyvaluecontainer.cpp
+SOURCES += $$PWD/addimportcontainer.cpp
+unix:SOURCES += $$PWD/sharedmemory_unix.cpp
+!unix:SOURCES += $$PWD/sharedmemory_qt.cpp
+SOURCES += $$PWD/imagecontainer.cpp
+SOURCES += $$PWD/idcontainer.cpp
+SOURCES += $$PWD/informationcontainer.cpp
+SOURCES += $$PWD/instancecontainer.cpp
+SOURCES += $$PWD/reparentcontainer.cpp
+SOURCES += $$PWD/propertyabstractcontainer.cpp
+SOURCES += $$PWD/propertybindingcontainer.cpp
+SOURCES += $$PWD/propertyvaluecontainer.cpp
diff --git a/share/qtcreator/qml/qmlpuppet/container/imagecontainer.cpp b/share/qtcreator/qml/qmlpuppet/container/imagecontainer.cpp
index b312c39702..031602e75c 100644
--- a/share/qtcreator/qml/qmlpuppet/container/imagecontainer.cpp
+++ b/share/qtcreator/qml/qmlpuppet/container/imagecontainer.cpp
@@ -29,7 +29,7 @@
#include "imagecontainer.h"
-#include <QSharedMemory>
+#include "sharedmemory.h"
#include <QCache>
#include <QDebug>
@@ -42,7 +42,7 @@
namespace QmlDesigner {
-static QCache<qint32, QSharedMemory> globalSharedMemoryCache(10000);
+static QCache<qint32, SharedMemory> globalSharedMemoryCache(10000);
ImageContainer::ImageContainer()
: m_instanceId(-1),
@@ -82,41 +82,52 @@ void ImageContainer::setImage(const QImage &image)
void ImageContainer::removeSharedMemorys(const QVector<qint32> &keyNumberVector)
{
foreach (qint32 keyNumber, keyNumberVector) {
- QSharedMemory *sharedMemory = globalSharedMemoryCache.take(keyNumber);
+ SharedMemory *sharedMemory = globalSharedMemoryCache.take(keyNumber);
delete sharedMemory;
}
}
static const QLatin1String imageKeyTemplateString("Image-%1");
-static QSharedMemory *createSharedMemory(qint32 key, int byteCount)
+static SharedMemory *createSharedMemory(qint32 key, int byteCount)
{
- QSharedMemory *sharedMemory = globalSharedMemoryCache.take(key);
-
- if (sharedMemory == 0)
- sharedMemory = new QSharedMemory(QString(imageKeyTemplateString).arg(key));
-
- bool sharedMemoryIsCreated = sharedMemory->isAttached();
- if (!sharedMemoryIsCreated)
- sharedMemoryIsCreated = sharedMemory->attach();
-
- bool sharedMemorySizeIsSmallerThanByteCount = sharedMemory->size() < byteCount;
- bool sharedMemorySizeIsDoubleBiggerThanByteCount = sharedMemory->size() * 2 > byteCount;
-
- if (!sharedMemoryIsCreated || sharedMemorySizeIsSmallerThanByteCount || sharedMemorySizeIsDoubleBiggerThanByteCount) {
- sharedMemory->detach();
- sharedMemoryIsCreated = sharedMemory->create(byteCount);
- }
-
- if (sharedMemoryIsCreated) {
- globalSharedMemoryCache.insert(key, sharedMemory);
- return sharedMemory;
+ SharedMemory *sharedMemory = globalSharedMemoryCache.take(key);
+
+ if (sharedMemory == 0) {
+ sharedMemory = new SharedMemory(QString(imageKeyTemplateString).arg(key));
+ bool sharedMemoryIsCreated = sharedMemory->create(byteCount);
+ if (sharedMemoryIsCreated) {
+ globalSharedMemoryCache.insert(key, sharedMemory);
+ } else {
+ delete sharedMemory;
+ sharedMemory = 0;
+ }
+ } else {
+ bool sharedMemoryIsAttached = sharedMemory->isAttached();
+ if (!sharedMemoryIsAttached)
+ sharedMemoryIsAttached = sharedMemory->attach();
+
+ bool sharedMemorySizeIsSmallerThanByteCount = sharedMemory->size() < byteCount;
+ bool sharedMemorySizeIsDoubleBiggerThanByteCount = sharedMemory->size() > (byteCount * 2);
+
+ if (!sharedMemoryIsAttached) {
+ sharedMemory->create(byteCount);
+ } else if (sharedMemorySizeIsSmallerThanByteCount || sharedMemorySizeIsDoubleBiggerThanByteCount) {
+ sharedMemory->detach();
+ sharedMemory->create(byteCount);
+ }
+
+ if (!sharedMemory->isAttached()) {
+ globalSharedMemoryCache.remove(key);
+ delete sharedMemory;
+ sharedMemory = 0;
+ }
}
- return 0;
+ return sharedMemory;
}
-static void writeSharedMemory(QSharedMemory *sharedMemory, const QImage &image)
+static void writeSharedMemory(SharedMemory *sharedMemory, const QImage &image)
{
sharedMemory->lock();
@@ -129,7 +140,6 @@ static void writeSharedMemory(QSharedMemory *sharedMemory, const QImage &image)
std::memcpy(sharedMemory->data(), headerData, 20);
std::memcpy(reinterpret_cast<char*>(sharedMemory->data()) + 20, image.constBits(), image.byteCount());
-
sharedMemory->unlock();
}
@@ -156,7 +166,7 @@ QDataStream &operator<<(QDataStream &out, const ImageContainer &container)
out << qint32(0);
writeStream(out, image);
} else {
- QSharedMemory *sharedMemory = createSharedMemory(container.keyNumber(), image.byteCount() + extraDataSize);
+ SharedMemory *sharedMemory = createSharedMemory(container.keyNumber(), image.byteCount() + extraDataSize);
out << qint32(sharedMemory != 0); // send if shared memory is used
@@ -171,7 +181,7 @@ QDataStream &operator<<(QDataStream &out, const ImageContainer &container)
static void readSharedMemory(qint32 key, ImageContainer &container)
{
- QSharedMemory sharedMemory(QString(imageKeyTemplateString).arg(key));
+ SharedMemory sharedMemory(QString(imageKeyTemplateString).arg(key));
bool canAttach = sharedMemory.attach(QSharedMemory::ReadOnly);
@@ -194,6 +204,7 @@ static void readSharedMemory(qint32 key, ImageContainer &container)
container.setImage(image);
sharedMemory.unlock();
+ sharedMemory.detach();
}
}
diff --git a/share/qtcreator/qml/qmlpuppet/container/sharedmemory.h b/share/qtcreator/qml/qmlpuppet/container/sharedmemory.h
new file mode 100644
index 0000000000..32815b65ae
--- /dev/null
+++ b/share/qtcreator/qml/qmlpuppet/container/sharedmemory.h
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** 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 Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#ifndef QMLDESIGNER_SHAREDMEMORY_H
+#define QMLDESIGNER_SHAREDMEMORY_H
+
+#include <QSharedMemory>
+#include <QSystemSemaphore>
+
+namespace QmlDesigner {
+
+class SharedMemory
+{
+ friend class SharedMemoryLocker;
+public:
+ SharedMemory();
+ SharedMemory(const QString &key);
+ ~SharedMemory();
+
+ void setKey(const QString &key);
+ QString key() const;
+
+ bool create(int size, QSharedMemory::AccessMode mode = QSharedMemory::ReadWrite);
+ int size() const;
+
+ bool attach(QSharedMemory::AccessMode mode = QSharedMemory::ReadWrite);
+ bool isAttached() const;
+ bool detach();
+
+ void *data();
+ const void* constData() const;
+ const void *data() const;
+
+ bool lock();
+ bool unlock();
+
+ QSharedMemory::SharedMemoryError error() const;
+ QString errorString() const;
+
+protected:
+#ifdef Q_OS_UNIX
+ bool initKeyInternal();
+ bool cleanHandleInternal();
+ bool createInternal(QSharedMemory::AccessMode mode, int size);
+ bool attachInternal(QSharedMemory::AccessMode mode);
+ bool detachInternal();
+ int handle();
+
+ void setErrorString(const QString &function);
+#endif
+private:
+#ifndef Q_OS_UNIX
+ QSharedMemory m_sharedMemory;
+#else
+ void *m_memory;
+ int m_size;
+ QString m_key;
+ QByteArray m_nativeKey;
+ QSharedMemory::SharedMemoryError m_error;
+ QString m_errorString;
+ QSystemSemaphore m_systemSemaphore;
+ bool m_lockedByMe;
+ int m_fileHandle;
+ bool m_createdByMe;
+#endif
+};
+
+} // namespace QmlDesigner
+
+#endif // QMLDESIGNER_SHAREDMEMORY_H
diff --git a/share/qtcreator/qml/qmlpuppet/container/sharedmemory_qt.cpp b/share/qtcreator/qml/qmlpuppet/container/sharedmemory_qt.cpp
new file mode 100644
index 0000000000..78923658d8
--- /dev/null
+++ b/share/qtcreator/qml/qmlpuppet/container/sharedmemory_qt.cpp
@@ -0,0 +1,117 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** 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 Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include "sharedmemory.h"
+
+namespace QmlDesigner {
+
+SharedMemory::SharedMemory()
+{
+}
+
+SharedMemory::SharedMemory(const QString &key)
+ : m_sharedMemory(key)
+{
+}
+
+SharedMemory::~SharedMemory()
+{
+}
+
+void SharedMemory::setKey(const QString &key)
+{
+ m_sharedMemory.setKey(key);
+}
+
+QString SharedMemory::key() const
+{
+ return m_sharedMemory.key();
+}
+
+bool SharedMemory::create(int size, QSharedMemory::AccessMode mode)
+{
+ return m_sharedMemory.create(size, mode);
+}
+
+int SharedMemory::size() const
+{
+ return m_sharedMemory.size();
+}
+
+bool SharedMemory::attach(QSharedMemory::AccessMode mode)
+{
+ return m_sharedMemory.attach(mode);
+}
+
+bool SharedMemory::isAttached() const
+{
+ return m_sharedMemory.isAttached();
+}
+
+bool SharedMemory::detach()
+{
+ return m_sharedMemory.detach();
+}
+
+void *SharedMemory::data()
+{
+ return m_sharedMemory.data();
+}
+
+const void *SharedMemory::constData() const
+{
+ return m_sharedMemory.constData();
+}
+
+const void *SharedMemory::data() const
+{
+ return m_sharedMemory.data();
+}
+
+bool SharedMemory::lock()
+{
+ return m_sharedMemory.lock();
+}
+
+bool SharedMemory::unlock()
+{
+ return m_sharedMemory.unlock();
+}
+
+QSharedMemory::SharedMemoryError SharedMemory::error() const
+{
+ return m_sharedMemory.error();
+}
+
+QString SharedMemory::errorString() const
+{
+ return m_sharedMemory.errorString();
+}
+
+} // namespace QmlDesigner
diff --git a/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp b/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp
new file mode 100644
index 0000000000..d356dd31ef
--- /dev/null
+++ b/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp
@@ -0,0 +1,500 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** 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 Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include "sharedmemory.h"
+#include <qdir.h>
+#include <qcryptographichash.h>
+
+#include "qplatformdefs.h"
+
+#include <errno.h>
+
+#include <sys/mman.h>
+#include <sys/stat.h> /* For mode constants */
+#include <fcntl.h> /* For O_* constants */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef Q_OS_OSX
+#include <sys/posix_shm.h>
+#endif
+#include <fcntl.h>
+#include <unistd.h>
+
+#include <private/qcore_unix_p.h>
+
+#ifdef Q_OS_OSX
+#define NAME_MAX PSHMNAMLEN
+#endif
+
+#ifndef QStringLiteral
+#define QStringLiteral(str) QString::fromUtf8(str)
+#endif
+
+#include <QRegExp>
+
+namespace QmlDesigner {
+
+class SharedMemoryLocker
+{
+public:
+ SharedMemoryLocker(SharedMemory *sharedMemory) : m_sharedMemory(sharedMemory)
+ {
+ Q_ASSERT(m_sharedMemory);
+ }
+
+ ~SharedMemoryLocker()
+ {
+ if (m_sharedMemory)
+ m_sharedMemory->unlock();
+ }
+
+ bool lock()
+ {
+ if (m_sharedMemory && m_sharedMemory->lock())
+ return true;
+ m_sharedMemory = 0;
+ return false;
+ }
+
+ bool tryLocker(const QString function) {
+ if (!lock()) {
+ m_sharedMemory->m_errorString = QStringLiteral("%1: unable to lock").arg(function);
+ m_sharedMemory->m_error = QSharedMemory::LockError;
+ return false;
+ }
+ return true;
+ }
+
+private:
+ SharedMemory *m_sharedMemory;
+};
+
+static QByteArray makePlatformSafeKey(const QString &key)
+{
+ if (key.isEmpty())
+ return QByteArray();
+ QByteArray data(QCryptographicHash::hash(key.toLatin1(), QCryptographicHash::Sha1).toBase64());
+
+ data = data.replace('+', '-');
+ data = data.replace('/', '_');
+
+ data.truncate(31); // OS X is only supporting 31 byte long names
+
+ return data;
+}
+
+
+SharedMemory::SharedMemory()
+ : m_memory(0),
+ m_size(0),
+ m_error(QSharedMemory::NoError),
+ m_systemSemaphore(QString()),
+ m_lockedByMe(false),
+ m_fileHandle(-1),
+ m_createdByMe(false)
+{
+}
+
+SharedMemory::SharedMemory(const QString &key)
+ : m_memory(0),
+ m_size(0),
+ m_error(QSharedMemory::NoError),
+ m_systemSemaphore(QString()),
+ m_lockedByMe(false),
+ m_fileHandle(-1),
+ m_createdByMe(false)
+{
+ setKey(key);
+}
+
+SharedMemory::~SharedMemory()
+{
+ if (m_memory) {
+ munmap(m_memory, m_size);
+ }
+
+ if (m_fileHandle != -1) {
+ close(m_fileHandle);
+ if (m_createdByMe)
+ shm_unlink(m_nativeKey);
+ }
+
+ setKey(QString());
+}
+
+void SharedMemory::setKey(const QString &key)
+{
+ if (key == m_key && makePlatformSafeKey(key) == m_nativeKey)
+ return;
+
+ if (isAttached())
+ detach();
+ cleanHandleInternal();
+ m_key = key;
+ m_nativeKey = makePlatformSafeKey(key);
+}
+
+QString SharedMemory::key() const
+{
+ return m_key;
+}
+
+bool SharedMemory::create(int size, QSharedMemory::AccessMode mode)
+{
+ if (!initKeyInternal())
+ return false;
+
+
+ m_systemSemaphore.setKey(m_key, 1, QSystemSemaphore::Create);
+
+
+ QString function = QLatin1String("SharedMemory::create");
+
+ SharedMemoryLocker lock(this);
+ if (!m_key.isNull() && !lock.tryLocker(function))
+ return false;
+
+ if (size <= 0) {
+ m_error = QSharedMemory::InvalidSize;
+ m_errorString = QStringLiteral("%1: create size is less then 0").arg(function);
+ return false;
+ }
+
+ return createInternal(mode ,size);
+}
+
+int SharedMemory::size() const
+{
+ return m_size;
+}
+
+bool SharedMemory::attach(QSharedMemory::AccessMode mode)
+{
+ if (isAttached() || !initKeyInternal())
+ return false;
+
+ SharedMemoryLocker lock(this);
+ if (!m_key.isNull() && !lock.tryLocker(QStringLiteral("SharedMemory::attach")))
+ return false;
+
+ if (isAttached() || !handle())
+ return false;
+
+ return attachInternal(mode);
+}
+
+
+bool SharedMemory::isAttached() const
+{
+ return (0 != m_memory);
+}
+
+bool SharedMemory::detach()
+{
+ if (!isAttached())
+ return false;
+
+ SharedMemoryLocker lock(this);
+ if (!m_key.isNull() && !lock.tryLocker(QStringLiteral("SharedMemory::detach")))
+ return false;
+
+ return detachInternal();
+}
+
+void *SharedMemory::data()
+{
+ return m_memory;
+}
+
+const void* SharedMemory::constData() const
+{
+ return m_memory;
+}
+
+const void *SharedMemory::data() const
+{
+ return m_memory;
+}
+
+bool SharedMemory::lock()
+{
+ if (m_lockedByMe) {
+ qWarning("SharedMemory::lock: already locked");
+ return true;
+ }
+ if (m_systemSemaphore.acquire()) {
+ m_lockedByMe = true;
+ return true;
+ }
+ QString function = QStringLiteral("SharedMemory::lock");
+ m_errorString = QStringLiteral("%1: unable to lock").arg(function);
+ m_error = QSharedMemory::LockError;
+ return false;
+}
+
+bool SharedMemory::unlock()
+{
+ if (!m_lockedByMe)
+ return false;
+ m_lockedByMe = false;
+ if (m_systemSemaphore.release())
+ return true;
+ QString function = QStringLiteral("SharedMemory::unlock");
+ m_errorString = QStringLiteral("%1: unable to unlock").arg(function);
+ m_error = QSharedMemory::LockError;
+ return false;
+}
+
+QSharedMemory::SharedMemoryError SharedMemory::error() const
+{
+ return m_error;
+}
+
+QString SharedMemory::errorString() const
+{
+ return m_errorString;
+}
+
+void SharedMemory::setErrorString(const QString &function)
+{
+ // EINVAL is handled in functions so they can give better error strings
+ switch (errno) {
+ case EACCES:
+ m_errorString = QStringLiteral("%1: permission denied").arg(function);
+ m_error = QSharedMemory::PermissionDenied;
+ break;
+ case EEXIST:
+ m_errorString = QStringLiteral("%1: already exists").arg(function);
+ m_error = QSharedMemory::AlreadyExists;
+ break;
+ case ENOENT:
+ m_errorString = QStringLiteral("%1: doesn't exist").arg(function);
+ m_error = QSharedMemory::NotFound;
+ break;
+ case EMFILE:
+ case ENOMEM:
+ case ENOSPC:
+ m_errorString = QStringLiteral("%1: out of resources").arg(function);
+ m_error = QSharedMemory::OutOfResources;
+ break;
+ default:
+ m_errorString = QStringLiteral("%1: unknown error %2").arg(function).arg(strerror(errno));
+ m_error = QSharedMemory::UnknownError;
+ }
+}
+
+bool SharedMemory::initKeyInternal()
+{
+ if (!cleanHandleInternal())
+ return false;
+
+ m_systemSemaphore.setKey(QString(), 1);
+ m_systemSemaphore.setKey(m_key, 1);
+ if (m_systemSemaphore.error() != QSystemSemaphore::NoError) {
+ m_errorString = QStringLiteral("SharedMemoryPrivate::initKey: unable to set key on lock");
+ switch (m_systemSemaphore.error()) {
+ case QSystemSemaphore::PermissionDenied:
+ m_error = QSharedMemory::PermissionDenied;
+ break;
+ case QSystemSemaphore::KeyError:
+ m_error = QSharedMemory::KeyError;
+ break;
+ case QSystemSemaphore::AlreadyExists:
+ m_error = QSharedMemory::AlreadyExists;
+ break;
+ case QSystemSemaphore::NotFound:
+ m_error = QSharedMemory::NotFound;
+ break;
+ case QSystemSemaphore::OutOfResources:
+ m_error = QSharedMemory::OutOfResources;
+ break;
+ case QSystemSemaphore::UnknownError:
+ default:
+ m_error = QSharedMemory::UnknownError;
+ break;
+ }
+
+ return false;
+ }
+
+ m_errorString = QString();
+ m_error = QSharedMemory::NoError;
+ return true;
+}
+
+int SharedMemory::handle()
+{
+ return m_fileHandle;
+}
+
+bool SharedMemory::cleanHandleInternal()
+{
+ m_fileHandle = -1;
+ return true;
+}
+
+bool SharedMemory::createInternal(QSharedMemory::AccessMode mode, int size)
+{
+ detachInternal();
+
+#ifdef Q_OS_OSX
+ if (m_fileHandle > -1 && m_createdByMe) {
+ close(m_fileHandle);
+ shm_unlink(m_nativeKey.constData());
+ m_fileHandle = -1;
+ }
+#endif
+
+ if (m_fileHandle == -1) {
+ int permission = mode == QSharedMemory::ReadOnly ? O_RDONLY : O_RDWR;
+ m_fileHandle = shm_open(m_nativeKey.constData(), O_CREAT | permission, 0666);
+
+ if (m_fileHandle == -1) {
+ switch (errno) {
+ case EINVAL:
+ m_errorString = QStringLiteral("QSharedMemory::create: key is not invalid");
+ m_error = QSharedMemory::KeyError;
+ break;
+ case EMFILE:
+ m_errorString = QStringLiteral("QSharedMemory::create: maximum file limit reached");
+ m_error = QSharedMemory::UnknownError;
+ break;
+ case ENAMETOOLONG:
+ m_errorString = QStringLiteral("QSharedMemory::create: key is to long");
+ m_error = QSharedMemory::KeyError;
+ break;
+ default:
+ setErrorString(QStringLiteral("SharedMemory::create"));
+ }
+ return false;
+ }
+
+ m_createdByMe = true;
+ }
+
+ struct stat statBuffer;
+ fstat(m_fileHandle, &statBuffer);
+ int fileSize = statBuffer.st_size;
+
+ if (fileSize < size) {
+ int returnValue = ftruncate(m_fileHandle, size);
+ if (returnValue == -1) {
+ switch (errno) {
+ case EFBIG:
+ m_errorString = QStringLiteral("QSharedMemory::create: size is to large");
+ m_error = QSharedMemory::InvalidSize;
+ break;
+ default:
+ setErrorString(QStringLiteral("SharedMemory::create"));
+ }
+
+ close(m_fileHandle);
+ shm_unlink(m_nativeKey.constData());
+ m_fileHandle = -1;
+ m_size = 0;
+
+ return false;
+ }
+ }
+
+ int protection = mode == QSharedMemory::ReadOnly ? PROT_READ : PROT_WRITE;
+ m_memory = mmap(0, size, protection, MAP_SHARED, m_fileHandle, 0);
+
+ if (m_memory == MAP_FAILED) {
+ close(m_fileHandle);
+ shm_unlink(m_nativeKey.constData());
+ m_memory = 0;
+ m_fileHandle = -1;
+ m_size = 0;
+
+ return false;
+ }
+
+ m_size = size;
+
+ return true;
+}
+
+bool SharedMemory::attachInternal(QSharedMemory::AccessMode mode)
+{
+ if (m_fileHandle == -1) {
+ int permission = mode == QSharedMemory::ReadOnly ? O_RDONLY : O_RDWR;
+ m_fileHandle = shm_open(m_nativeKey.constData(), permission, 0666);
+ if (m_fileHandle == -1) {
+ switch (errno) {
+ case EINVAL:
+ m_errorString = QStringLiteral("QSharedMemory::attach: key is invalid");
+ m_error = QSharedMemory::KeyError;
+ break;
+ case EMFILE:
+ m_errorString = QStringLiteral("QSharedMemory::attach: maximum file limit reached");
+ m_error = QSharedMemory::UnknownError;
+ break;
+ case ENAMETOOLONG:
+ m_errorString = QStringLiteral("QSharedMemory::attach: key is to long");
+ m_error = QSharedMemory::KeyError;
+ break;
+ default:
+ setErrorString(QStringLiteral("SharedMemory::attach"));
+ }
+ return false;
+ }
+ }
+
+ struct stat statBuffer;
+ fstat(m_fileHandle, &statBuffer);
+ int size = statBuffer.st_size;
+
+ int protection = mode == QSharedMemory::ReadOnly ? PROT_READ : PROT_WRITE;
+ m_memory = mmap(0, size, protection, MAP_SHARED, m_fileHandle, 0);
+
+ if (m_memory == MAP_FAILED) {
+ m_memory = 0;
+
+ return false;
+ }
+
+ m_size = size;
+
+ return true;
+}
+
+bool SharedMemory::detachInternal()
+{
+ if (m_memory) {
+ munmap(m_memory, m_size);
+ m_memory = 0;
+ m_size = 0;
+ }
+
+ return false;
+}
+
+} // namespace QmlDesigner
diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/Window.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/Window.qml
new file mode 100644
index 0000000000..e04c067cf8
--- /dev/null
+++ b/share/qtcreator/qml/qmlpuppet/mockfiles/Window.qml
@@ -0,0 +1,5 @@
+import QtQuick 2.2
+
+Rectangle {
+ property string title
+}
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp
index b5ca681a9f..bc1e5c7bd3 100644
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp
+++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp
@@ -94,7 +94,7 @@ static bool isPropertyBlackListed(const QmlDesigner::PropertyName &propertyName)
namespace QmlDesigner {
namespace Internal {
-QHash<EnumerationName, int> ObjectNodeInstance::m_enumationValueHash;
+QHash<EnumerationName, QVariant> ObjectNodeInstance::m_enumationValueHash;
ObjectNodeInstance::ObjectNodeInstance(QObject *object)
: m_object(object),
@@ -713,6 +713,7 @@ PropertyNameList allPropertyNames(QObject *object, const PropertyName &baseName
} else if (QQmlValueTypeFactory::valueType(metaProperty.userType())) {
QQmlValueType *valueType = QQmlValueTypeFactory::valueType(metaProperty.userType());
valueType->setValue(metaProperty.read(object));
+ propertyNameList.append(baseName + PropertyName(metaProperty.name()));
propertyNameList.append(allPropertyNames(valueType, baseName + PropertyName(metaProperty.name()) + '.', inspectedObjects));
} else {
propertyNameList.append(baseName + PropertyName(metaProperty.name()));
@@ -1088,17 +1089,9 @@ static bool isCrashingType(QQmlType *type)
return false;
}
-static QObject *createDummyWindow(QQmlContext *context, const QUrl &sourceUrl)
+static QObject *createDummyWindow(QQmlContext *context)
{
- QQmlComponent component(context->engine());
- QByteArray dummyWindow;
- dummyWindow.append("import QtQuick 2.0\n");
- dummyWindow.append("Rectangle {\n");
- dummyWindow.append("property string title\n");
- dummyWindow.append("}\n");
-
- component.setData(dummyWindow, sourceUrl);
-
+ QQmlComponent component(context->engine(), QUrl(QStringLiteral("qrc:/qtquickplugin/mockfiles/Window.qml")));
return component.create();
}
@@ -1136,10 +1129,12 @@ QObject *ObjectNodeInstance::createPrimitive(const QString &typeName, int majorN
if (isWindow(object)) {
delete object;
- object = createDummyWindow(context, type->sourceUrl());
+ object = createDummyWindow(context);
}
- } else {
+ }
+
+ if (!object) {
qWarning() << "QuickDesigner: Cannot create an object of type"
<< QString("%1 %2,%3").arg(typeName).arg(majorNumber).arg(minorNumber)
<< "- type isn't known to declarative meta type system";
@@ -1327,27 +1322,31 @@ void ObjectNodeInstance::doComponentCompleteRecursive(QObject *object, NodeInsta
}
}
-static QHash<EnumerationName, int> enumationValuesFromMetaEnum(const QMetaEnum &metaEnum)
+static QHash<EnumerationName, QVariant> enumationValuesFromMetaEnum(const QMetaEnum &metaEnum)
{
- QHash<EnumerationName, int> enumationValues;
+ QHash<EnumerationName, QVariant> enumationValues;
for (int index = 0; index < metaEnum.keyCount(); index++) {
EnumerationName enumerationName = EnumerationName(metaEnum.scope()) + "." + metaEnum.key(index);
- enumationValues.insert(enumerationName, metaEnum.value(index));
+ enumationValues.insert(enumerationName, QVariant::fromValue(metaEnum.value(index)));
+ qDebug() << __FUNCTION__ << enumerationName << metaEnum.value(index);
}
return enumationValues;
}
-static QHash<EnumerationName, int> collectEnumationValues(const Enumeration &enumeration)
+static QHash<EnumerationName, QVariant> collectEnumationValues(const Enumeration &enumeration)
{
- QHash<EnumerationName, int> enumationValues;
+ QHash<EnumerationName, QVariant> enumationValues;
EnumerationName enumerationScope = enumeration.scope();
- const QMetaObject *metaObject = QMetaType::metaObjectForType(QMetaType::type(enumerationScope.data()));
+ const QMetaObject *metaObject = QMetaType::metaObjectForType(QMetaType::type(enumerationScope.constData()));
if (metaObject) {
int enumeratorCount = metaObject->enumeratorOffset() + metaObject->enumeratorCount();
for (int index = metaObject->enumeratorOffset(); index < enumeratorCount; index++)
enumationValues.unite(enumationValuesFromMetaEnum(metaObject->enumerator(index)));
+ } else {
+ enumationValues.insert(enumeration.toEnumerationName(), QVariant::fromValue(enumeration.nameToString()));
}
+
return enumationValues;
}
@@ -1357,7 +1356,7 @@ QVariant ObjectNodeInstance::enumationValue(const Enumeration &enumeration)
if (!m_enumationValueHash.contains(enumerationName))
m_enumationValueHash.unite(collectEnumationValues(enumeration));
- return QVariant::fromValue(m_enumationValueHash.value(enumerationName));
+ return m_enumationValueHash.value(enumerationName);
}
ObjectNodeInstance::Pointer ObjectNodeInstance::parentInstance() const
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.h
index 2d4635b372..239b774491 100644
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.h
+++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.h
@@ -220,7 +220,7 @@ private:
qint32 m_instanceId;
bool m_deleteHeldInstance;
bool m_isInLayoutable;
- static QHash<EnumerationName, int> m_enumationValueHash;
+ static QHash<EnumerationName, QVariant> m_enumationValueHash;
};
} // namespace Internal
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp
index 33931cbd70..9ed471cde5 100644
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp
+++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp
@@ -325,7 +325,7 @@ QSizeF QuickItemNodeInstance::size() const
{
double width;
- if (DesignerSupport::isValidWidth(quickItem())) {
+ if (DesignerSupport::isValidHeight(quickItem())) { // isValidHeight is QQuickItemPrivate::get(item)->widthValid
width = quickItem()->width();
} else {
width = quickItem()->implicitWidth();
@@ -333,7 +333,7 @@ QSizeF QuickItemNodeInstance::size() const
double height;
- if (DesignerSupport::isValidHeight(quickItem())) {
+ if (DesignerSupport::isValidWidth(quickItem())) { // isValidWidth is QQuickItemPrivate::get(item)->heightValid
height = quickItem()->height();
} else {
height = quickItem()->implicitHeight();
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppet.pri b/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppet.pri
index 466507e455..924c015db6 100644
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppet.pri
+++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppet.pri
@@ -14,7 +14,7 @@ QT += core-private qml-private quick-private gui-private
QT += v8-private
}
-!macx {
+!osx {
CONFIG += c++11
}
@@ -41,8 +41,9 @@ DEFINES -= QT_NO_CAST_FROM_ASCII
OTHER_FILES += Info.plist
+unix:!osx:LIBS += -lrt # posix shared memory
-macx {
+osx {
CONFIG -= app_bundle
QMAKE_LFLAGS += -sectcreate __TEXT __info_plist $$system_quote($$PWD/Info.plist)
} else {
diff --git a/share/qtcreator/qml/qmlpuppet/qmlpuppet.qrc b/share/qtcreator/qml/qmlpuppet/qmlpuppet.qrc
index ceb6142cb3..e9588ab045 100644
--- a/share/qtcreator/qml/qmlpuppet/qmlpuppet.qrc
+++ b/share/qtcreator/qml/qmlpuppet/qmlpuppet.qrc
@@ -3,5 +3,6 @@
<file>images/template_image.png</file>
<file>html/welcome.html</file>
<file>images/webkit.png</file>
+ <file>mockfiles/Window.qml</file>
</qresource>
</RCC>
diff --git a/share/qtcreator/qml/qmlpuppet/qmlpuppet/qmlpuppet.pri b/share/qtcreator/qml/qmlpuppet/qmlpuppet/qmlpuppet.pri
index 516300a870..7792021049 100644
--- a/share/qtcreator/qml/qmlpuppet/qmlpuppet/qmlpuppet.pri
+++ b/share/qtcreator/qml/qmlpuppet/qmlpuppet/qmlpuppet.pri
@@ -22,10 +22,12 @@ SOURCES += $$PWD/qmlpuppetmain.cpp
RESOURCES += $$PWD/../qmlpuppet.qrc
DEFINES -= QT_NO_CAST_FROM_ASCII
+unix:!macx:LIBS += -lrt # posix shared memory
+
OTHER_FILES += Info.plist
macx {
CONFIG -= app_bundle
- QMAKE_LFLAGS += -sectcreate __TEXT __info_plist $$quote($$PWD/Info.plist)
+ QMAKE_LFLAGS += -sectcreate __TEXT __info_plist \"$$PWD/Info.plist\"
} else {
target.path = $$QTC_PREFIX/bin
INSTALLS += target
diff --git a/share/qtcreator/qmldesigner/common/DesignerScrollViewStyle.qml b/share/qtcreator/qmldesigner/common/DesignerScrollViewStyle.qml
index 1c90f7fc4f..173eaac792 100644
--- a/share/qtcreator/qmldesigner/common/DesignerScrollViewStyle.qml
+++ b/share/qtcreator/qmldesigner/common/DesignerScrollViewStyle.qml
@@ -58,4 +58,5 @@ ScrollViewStyle {
decrementControl: Item {}
incrementControl: Item {}
+ corner: Item {}
}
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorButton.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorButton.qml
index 1e72852039..c3a6363593 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorButton.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorButton.qml
@@ -252,7 +252,7 @@ Item {
}
onPressed: positionChanged(mouse)
- onClicked: colorButton.clicked()
+ onReleased: colorButton.clicked()
}
Rectangle {
anchors.fill: parent
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorEditor.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorEditor.qml
index 13f976c3d5..aa4b76edfe 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorEditor.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ColorEditor.qml
@@ -62,6 +62,7 @@ Column {
id: colorEditorTimer
repeat: false
interval: 100
+ running: false
onTriggered: {
if (backendendValue !== undefined)
backendendValue.value = colorEditor.color
@@ -69,21 +70,22 @@ Column {
}
onColorChanged: {
- if (!gradientLine.isCompleted)
+ if (!gradientLine.isInValidState)
return;
if (supportGradient && gradientLine.hasGradient) {
- gradientLine.currentColor = color
textField.text = convertColorToString(color)
+ gradientLine.currentColor = color
}
- if (buttonRow.checkedIndex !== 1)
+ if (buttonRow.checkedIndex !== 1) {
//Delay setting the color to keep ui responsive
colorEditorTimer.restart()
+ }
}
GradientLine {
- property bool isCompleted: false
+ property bool isInValidState: false
visible: buttonRow.checkedIndex === 1
id: gradientLine
@@ -110,18 +112,23 @@ Column {
Connections {
target: modelNodeBackend
+ onSelectionToBeChanged: {
+ colorEditorTimer.stop()
+ gradientLine.isInValidState = false
+ }
+ }
+
+ Connections {
+ target: modelNodeBackend
onSelectionChanged: {
if (supportGradient && gradientLine.hasGradient) {
colorEditor.color = gradientLine.currentColor
- } else {
- colorEditor.color = colorEditor.value
+ gradientLine.currentColor = color
}
+ gradientLine.isInValidState = true
}
}
- Component.onCompleted: {
- isCompleted= true
- }
}
SectionLayout {
@@ -149,7 +156,7 @@ Column {
LineEdit {
id: textField
- hasToConvertColor: true
+ writeValueManually: true
validator: RegExpValidator {
regExp: /#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?/g
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/CustomSpinBoxStyle.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/CustomSpinBoxStyle.qml
index 2fbca27961..9bfcd2eba6 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/CustomSpinBoxStyle.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/CustomSpinBoxStyle.qml
@@ -39,6 +39,7 @@ SpinBoxStyle {
padding.top: 3
padding.bottom: 1
padding.right: 18
+ padding.left: 12
incrementControl: Item {
implicitWidth: 14
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/GradientLine.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/GradientLine.qml
index 9296f27752..f6af022399 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/GradientLine.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/GradientLine.qml
@@ -122,8 +122,11 @@ Item {
onClicked: {
var currentPosition = mouseX / colorLine.effectiveWidth
- gradientModel.addStop(currentPosition, currentColor)
- colorLine.select(gradientModel.count - 1)
+ var newIndex = gradientModel.addStop(currentPosition, currentColor)
+
+ if (newIndex > 0)
+ colorLine.select(newIndex)
+
colorLine.invalidate()
}
Item {
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/LineEdit.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/LineEdit.qml
index 451c7d9bd8..9cea91a9e5 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/LineEdit.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/LineEdit.qml
@@ -47,22 +47,24 @@ Controls.TextField {
property bool showTranslateCheckBox: true
- property bool hasToConvertColor: false
+ property bool writeValueManually: false
property bool __dirty: false
+ property bool showExtendedFunctionButton: true
+
ExtendedFunctionButton {
x: 2
y: 4
backendValue: lineEdit.backendValue
- visible: lineEdit.enabled
+ visible: lineEdit.enabled && showExtendedFunctionButton
}
ColorLogic {
id: colorLogic
backendValue: lineEdit.backendValue
onValueFromBackendChanged: {
- if (hasToConvertColor) {
+ if (writeValueManually) {
lineEdit.text = convertColorToString(valueFromBackend)
} else {
lineEdit.text = valueFromBackend
@@ -78,7 +80,7 @@ Controls.TextField {
Connections {
target: modelNodeBackend
onSelectionToBeChanged: {
- if (__dirty) {
+ if (__dirty && !writeValueManually) {
lineEdit.backendValue.value = text
}
__dirty = false
@@ -87,7 +89,7 @@ Controls.TextField {
onEditingFinished: {
- if (hasToConvertColor)
+ if (writeValueManually)
return
if (!__dirty)
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ScrollView.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ScrollView.qml
index 54d68e7485..0a7ba0098a 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ScrollView.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ScrollView.qml
@@ -1,6 +1,10 @@
import QtQuick 2.1
import QtQuick.Controls 1.0 as Controls
+import "../../common/"
Controls.ScrollView {
+ style: DesignerScrollViewStyle {
+ }
+ frameVisible: false
}
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/SpinBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/SpinBox.qml
index 241897fe96..6fd1c09eaf 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/SpinBox.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/SpinBox.qml
@@ -37,7 +37,6 @@ Controls.SpinBox {
property color highlightColor: "orange"
property color textColor: colorLogic.textColor
property variant backendValue;
- prefix: " "
ExtendedFunctionButton {
x: 2
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml
index cf34062a01..693d069b40 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml
@@ -77,6 +77,7 @@ Rectangle {
Layout.fillWidth: true
Layout.maximumWidth: 320
showTranslateCheckBox: false
+ showExtendedFunctionButton: false
}
ExpandingSpacer {
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/PathViewSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/PathViewSpecifics.qml
index 8b5454a58c..3825a17215 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/PathViewSpecifics.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/PathViewSpecifics.qml
@@ -208,22 +208,6 @@ Column {
}
}
-
- Label {
- text: qsTr("Follows current")
- toolTip: qsTr("Determines whether the highlight is managed by the view.")
- }
-
- SecondColumnLayout {
- CheckBox {
- backendValue: backendValues.highlightFollowsCurrentItem
- }
-
- ExpandingSpacer {
-
- }
- }
-
}
}
}
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RectangleSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RectangleSpecifics.qml
index df43a5cc84..9dd3a44894 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RectangleSpecifics.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RectangleSpecifics.qml
@@ -91,6 +91,8 @@ Column {
backendValue: backendValues.radius
hasSlider: true
Layout.preferredWidth: 80
+ minimumValue: 0
+ maximumValue: Math.min(backendValues.height.value, backendValues.width.value) / 2
}
ExpandingSpacer {
diff --git a/src/app/app_version_header.qbs b/src/app/app_version_header.qbs
index bd08249b47..891cf3974c 100644
--- a/src/app/app_version_header.qbs
+++ b/src/app/app_version_header.qbs
@@ -9,7 +9,7 @@ Product {
Transformer {
inputs: ["app_version.h.in"]
Artifact {
- fileName: "app/app_version.h"
+ filePath: "app/app_version.h"
fileTags: "hpp"
}
prepare: {
diff --git a/src/libs/3rdparty/cplusplus/AST.cpp b/src/libs/3rdparty/cplusplus/AST.cpp
index 312b1dcfc2..0eb73f58fb 100644
--- a/src/libs/3rdparty/cplusplus/AST.cpp
+++ b/src/libs/3rdparty/cplusplus/AST.cpp
@@ -68,7 +68,7 @@ bool AST::match(AST *pattern, ASTMatcher *matcher)
return match0(pattern, matcher);
}
-unsigned AttributeSpecifierAST::firstToken() const
+unsigned GnuAttributeSpecifierAST::firstToken() const
{
return attribute_token;
}
@@ -242,7 +242,7 @@ unsigned AsmDefinitionAST::lastToken() const
}
/** \generated */
-unsigned AttributeAST::firstToken() const
+unsigned GnuAttributeAST::firstToken() const
{
if (identifier_token)
return identifier_token;
@@ -259,7 +259,7 @@ unsigned AttributeAST::firstToken() const
}
/** \generated */
-unsigned AttributeAST::lastToken() const
+unsigned GnuAttributeAST::lastToken() const
{
if (rparen_token)
return rparen_token + 1;
@@ -4194,7 +4194,7 @@ unsigned WhileStatementAST::lastToken() const
}
/** \generated */
-unsigned AttributeSpecifierAST::lastToken() const
+unsigned GnuAttributeSpecifierAST::lastToken() const
{
if (second_rparen_token)
return second_rparen_token + 1;
@@ -4524,3 +4524,37 @@ unsigned DotDesignatorAST::lastToken() const
return 1;
}
+/** \generated */
+unsigned AlignmentSpecifierAST::firstToken() const
+{
+ if (align_token)
+ return align_token;
+ if (lparen_token)
+ return lparen_token;
+ if (typeIdExprOrAlignmentExpr)
+ if (unsigned candidate = typeIdExprOrAlignmentExpr->firstToken())
+ return candidate;
+ if (ellipses_token)
+ return ellipses_token;
+ if (rparen_token)
+ return rparen_token;
+ return 0;
+}
+
+/** \generated */
+unsigned AlignmentSpecifierAST::lastToken() const
+{
+ if (rparen_token)
+ return rparen_token + 1;
+ if (ellipses_token)
+ return ellipses_token + 1;
+ if (typeIdExprOrAlignmentExpr)
+ if (unsigned candidate = typeIdExprOrAlignmentExpr->lastToken())
+ return candidate;
+ if (lparen_token)
+ return lparen_token + 1;
+ if (align_token)
+ return align_token + 1;
+ return 1;
+}
+
diff --git a/src/libs/3rdparty/cplusplus/AST.h b/src/libs/3rdparty/cplusplus/AST.h
index a0f5a2fa64..e0e76f0323 100644
--- a/src/libs/3rdparty/cplusplus/AST.h
+++ b/src/libs/3rdparty/cplusplus/AST.h
@@ -126,13 +126,13 @@ public:
virtual AccessDeclarationAST *asAccessDeclaration() { return 0; }
virtual AliasDeclarationAST *asAliasDeclaration() { return 0; }
+ virtual AlignmentSpecifierAST *asAlignmentSpecifier() { return 0; }
virtual AlignofExpressionAST *asAlignofExpression() { return 0; }
virtual AnonymousNameAST *asAnonymousName() { return 0; }
virtual ArrayAccessAST *asArrayAccess() { return 0; }
virtual ArrayDeclaratorAST *asArrayDeclarator() { return 0; }
virtual ArrayInitializerAST *asArrayInitializer() { return 0; }
virtual AsmDefinitionAST *asAsmDefinition() { return 0; }
- virtual AttributeAST *asAttribute() { return 0; }
virtual AttributeSpecifierAST *asAttributeSpecifier() { return 0; }
virtual BaseSpecifierAST *asBaseSpecifier() { return 0; }
virtual BinaryExpressionAST *asBinaryExpression() { return 0; }
@@ -182,6 +182,8 @@ public:
virtual ForeachStatementAST *asForeachStatement() { return 0; }
virtual FunctionDeclaratorAST *asFunctionDeclarator() { return 0; }
virtual FunctionDefinitionAST *asFunctionDefinition() { return 0; }
+ virtual GnuAttributeAST *asGnuAttribute() { return 0; }
+ virtual GnuAttributeSpecifierAST *asGnuAttributeSpecifier() { return 0; }
virtual GotoStatementAST *asGotoStatement() { return 0; }
virtual IdExpressionAST *asIdExpression() { return 0; }
virtual IfStatementAST *asIfStatement() { return 0; }
@@ -463,15 +465,57 @@ protected:
class CPLUSPLUS_EXPORT AttributeSpecifierAST: public SpecifierAST
{
public:
+ AttributeSpecifierAST()
+ {}
+
+ virtual AttributeSpecifierAST *asAttributeSpecifier() { return this; }
+
+ virtual AttributeSpecifierAST *clone(MemoryPool *pool) const = 0;
+};
+
+class CPLUSPLUS_EXPORT AlignmentSpecifierAST: public AttributeSpecifierAST
+{
+public:
+ unsigned align_token;
+ unsigned lparen_token;
+ ExpressionAST *typeIdExprOrAlignmentExpr;
+ unsigned ellipses_token;
+ unsigned rparen_token;
+
+public:
+ AlignmentSpecifierAST()
+ : align_token(0)
+ , lparen_token(0)
+ , typeIdExprOrAlignmentExpr(0)
+ , ellipses_token(0)
+ , rparen_token(0)
+ {}
+
+ virtual AlignmentSpecifierAST *asAlignmentSpecifier() { return this; }
+
+ virtual unsigned firstToken() const;
+ virtual unsigned lastToken() const;
+
+ virtual AlignmentSpecifierAST *clone(MemoryPool *pool) const;
+
+protected:
+ virtual void accept0(ASTVisitor *visitor);
+ virtual bool match0(AST *, ASTMatcher *);
+};
+
+
+class CPLUSPLUS_EXPORT GnuAttributeSpecifierAST: public AttributeSpecifierAST
+{
+public:
unsigned attribute_token;
unsigned first_lparen_token;
unsigned second_lparen_token;
- AttributeListAST *attribute_list;
+ GnuAttributeListAST *attribute_list;
unsigned first_rparen_token;
unsigned second_rparen_token;
public:
- AttributeSpecifierAST()
+ GnuAttributeSpecifierAST()
: attribute_token(0)
, first_lparen_token(0)
, second_lparen_token(0)
@@ -480,19 +524,19 @@ public:
, second_rparen_token(0)
{}
- virtual AttributeSpecifierAST *asAttributeSpecifier() { return this; }
+ virtual GnuAttributeSpecifierAST *asGnuAttributeSpecifier() { return this; }
virtual unsigned firstToken() const;
virtual unsigned lastToken() const;
- virtual AttributeSpecifierAST *clone(MemoryPool *pool) const;
+ virtual GnuAttributeSpecifierAST *clone(MemoryPool *pool) const;
protected:
virtual void accept0(ASTVisitor *visitor);
virtual bool match0(AST *, ASTMatcher *);
};
-class CPLUSPLUS_EXPORT AttributeAST: public AST
+class CPLUSPLUS_EXPORT GnuAttributeAST: public AST
{
public:
unsigned identifier_token;
@@ -502,7 +546,7 @@ public:
unsigned rparen_token;
public:
- AttributeAST()
+ GnuAttributeAST()
: identifier_token(0)
, lparen_token(0)
, tag_token(0)
@@ -510,12 +554,12 @@ public:
, rparen_token(0)
{}
- virtual AttributeAST *asAttribute() { return this; }
+ virtual GnuAttributeAST *asGnuAttribute() { return this; }
virtual unsigned firstToken() const;
virtual unsigned lastToken() const;
- virtual AttributeAST *clone(MemoryPool *pool) const;
+ virtual GnuAttributeAST *clone(MemoryPool *pool) const;
protected:
virtual void accept0(ASTVisitor *visitor);
diff --git a/src/libs/3rdparty/cplusplus/ASTClone.cpp b/src/libs/3rdparty/cplusplus/ASTClone.cpp
index 969adef311..3458846ea0 100644
--- a/src/libs/3rdparty/cplusplus/ASTClone.cpp
+++ b/src/libs/3rdparty/cplusplus/ASTClone.cpp
@@ -55,23 +55,35 @@ SimpleSpecifierAST *SimpleSpecifierAST::clone(MemoryPool *pool) const
return ast;
}
-AttributeSpecifierAST *AttributeSpecifierAST::clone(MemoryPool *pool) const
+AlignmentSpecifierAST *AlignmentSpecifierAST::clone(MemoryPool *pool) const
{
- AttributeSpecifierAST *ast = new (pool) AttributeSpecifierAST;
+ AlignmentSpecifierAST *ast = new (pool) AlignmentSpecifierAST;
+ ast->align_token = align_token;
+ ast->lparen_token = lparen_token;
+ if (typeIdExprOrAlignmentExpr)
+ ast->typeIdExprOrAlignmentExpr = typeIdExprOrAlignmentExpr->clone(pool);
+ ast->ellipses_token = ellipses_token;
+ ast->rparen_token = rparen_token;
+ return ast;
+}
+
+GnuAttributeSpecifierAST *GnuAttributeSpecifierAST::clone(MemoryPool *pool) const
+{
+ GnuAttributeSpecifierAST *ast = new (pool) GnuAttributeSpecifierAST;
ast->attribute_token = attribute_token;
ast->first_lparen_token = first_lparen_token;
ast->second_lparen_token = second_lparen_token;
- for (AttributeListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
+ for (GnuAttributeListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
- *ast_iter = new (pool) AttributeListAST((iter->value) ? iter->value->clone(pool) : 0);
+ *ast_iter = new (pool) GnuAttributeListAST((iter->value) ? iter->value->clone(pool) : 0);
ast->first_rparen_token = first_rparen_token;
ast->second_rparen_token = second_rparen_token;
return ast;
}
-AttributeAST *AttributeAST::clone(MemoryPool *pool) const
+GnuAttributeAST *GnuAttributeAST::clone(MemoryPool *pool) const
{
- AttributeAST *ast = new (pool) AttributeAST;
+ GnuAttributeAST *ast = new (pool) GnuAttributeAST;
ast->identifier_token = identifier_token;
ast->lparen_token = lparen_token;
ast->tag_token = tag_token;
diff --git a/src/libs/3rdparty/cplusplus/ASTMatch0.cpp b/src/libs/3rdparty/cplusplus/ASTMatch0.cpp
index ff51efcd1a..b0e732b257 100644
--- a/src/libs/3rdparty/cplusplus/ASTMatch0.cpp
+++ b/src/libs/3rdparty/cplusplus/ASTMatch0.cpp
@@ -56,17 +56,25 @@ bool SimpleSpecifierAST::match0(AST *pattern, ASTMatcher *matcher)
return false;
}
-bool AttributeSpecifierAST::match0(AST *pattern, ASTMatcher *matcher)
+bool AlignmentSpecifierAST::match0(AST *pattern, ASTMatcher *matcher)
{
- if (AttributeSpecifierAST *_other = pattern->asAttributeSpecifier())
+ if (AlignmentSpecifierAST *_other = pattern->asAlignmentSpecifier())
return matcher->match(this, _other);
return false;
}
-bool AttributeAST::match0(AST *pattern, ASTMatcher *matcher)
+bool GnuAttributeSpecifierAST::match0(AST *pattern, ASTMatcher *matcher)
{
- if (AttributeAST *_other = pattern->asAttribute())
+ if (GnuAttributeSpecifierAST *_other = pattern->asGnuAttributeSpecifier())
+ return matcher->match(this, _other);
+
+ return false;
+}
+
+bool GnuAttributeAST::match0(AST *pattern, ASTMatcher *matcher)
+{
+ if (GnuAttributeAST *_other = pattern->asGnuAttribute())
return matcher->match(this, _other);
return false;
diff --git a/src/libs/3rdparty/cplusplus/ASTMatcher.cpp b/src/libs/3rdparty/cplusplus/ASTMatcher.cpp
index 415adbcf3d..055b55a32d 100644
--- a/src/libs/3rdparty/cplusplus/ASTMatcher.cpp
+++ b/src/libs/3rdparty/cplusplus/ASTMatcher.cpp
@@ -73,7 +73,28 @@ bool ASTMatcher::match(SimpleSpecifierAST *node, SimpleSpecifierAST *pattern)
return true;
}
-bool ASTMatcher::match(AttributeSpecifierAST *node, AttributeSpecifierAST *pattern)
+bool ASTMatcher::match(AlignmentSpecifierAST *node, AlignmentSpecifierAST *pattern)
+{
+ (void) node;
+ (void) pattern;
+
+ pattern->align_token = node->align_token;
+
+ pattern->lparen_token = node->lparen_token;
+
+ if (! pattern->typeIdExprOrAlignmentExpr)
+ pattern->typeIdExprOrAlignmentExpr = node->typeIdExprOrAlignmentExpr;
+ else if (! AST::match(node->typeIdExprOrAlignmentExpr, pattern->typeIdExprOrAlignmentExpr, this))
+ return false;
+
+ pattern->ellipses_token = node->ellipses_token;
+
+ pattern->rparen_token = node->rparen_token;
+
+ return true;
+}
+
+bool ASTMatcher::match(GnuAttributeSpecifierAST *node, GnuAttributeSpecifierAST *pattern)
{
(void) node;
(void) pattern;
@@ -96,7 +117,7 @@ bool ASTMatcher::match(AttributeSpecifierAST *node, AttributeSpecifierAST *patte
return true;
}
-bool ASTMatcher::match(AttributeAST *node, AttributeAST *pattern)
+bool ASTMatcher::match(GnuAttributeAST *node, GnuAttributeAST *pattern)
{
(void) node;
(void) pattern;
diff --git a/src/libs/3rdparty/cplusplus/ASTMatcher.h b/src/libs/3rdparty/cplusplus/ASTMatcher.h
index 042d5c9c9d..888ada0c20 100644
--- a/src/libs/3rdparty/cplusplus/ASTMatcher.h
+++ b/src/libs/3rdparty/cplusplus/ASTMatcher.h
@@ -33,14 +33,13 @@ public:
virtual bool match(AccessDeclarationAST *node, AccessDeclarationAST *pattern);
virtual bool match(AliasDeclarationAST *node, AliasDeclarationAST *pattern);
+ virtual bool match(AlignmentSpecifierAST *node, AlignmentSpecifierAST *pattern);
virtual bool match(AlignofExpressionAST *node, AlignofExpressionAST *pattern);
virtual bool match(AnonymousNameAST *node, AnonymousNameAST *pattern);
virtual bool match(ArrayAccessAST *node, ArrayAccessAST *pattern);
virtual bool match(ArrayDeclaratorAST *node, ArrayDeclaratorAST *pattern);
virtual bool match(ArrayInitializerAST *node, ArrayInitializerAST *pattern);
virtual bool match(AsmDefinitionAST *node, AsmDefinitionAST *pattern);
- virtual bool match(AttributeAST *node, AttributeAST *pattern);
- virtual bool match(AttributeSpecifierAST *node, AttributeSpecifierAST *pattern);
virtual bool match(BaseSpecifierAST *node, BaseSpecifierAST *pattern);
virtual bool match(BinaryExpressionAST *node, BinaryExpressionAST *pattern);
virtual bool match(BoolLiteralAST *node, BoolLiteralAST *pattern);
@@ -84,6 +83,8 @@ public:
virtual bool match(ForeachStatementAST *node, ForeachStatementAST *pattern);
virtual bool match(FunctionDeclaratorAST *node, FunctionDeclaratorAST *pattern);
virtual bool match(FunctionDefinitionAST *node, FunctionDefinitionAST *pattern);
+ virtual bool match(GnuAttributeAST *node, GnuAttributeAST *pattern);
+ virtual bool match(GnuAttributeSpecifierAST *node, GnuAttributeSpecifierAST *pattern);
virtual bool match(GotoStatementAST *node, GotoStatementAST *pattern);
virtual bool match(IdExpressionAST *node, IdExpressionAST *pattern);
virtual bool match(IfStatementAST *node, IfStatementAST *pattern);
diff --git a/src/libs/3rdparty/cplusplus/ASTPatternBuilder.h b/src/libs/3rdparty/cplusplus/ASTPatternBuilder.h
index 929337ee9b..c8c9d50d6d 100644
--- a/src/libs/3rdparty/cplusplus/ASTPatternBuilder.h
+++ b/src/libs/3rdparty/cplusplus/ASTPatternBuilder.h
@@ -63,16 +63,23 @@ public:
return __ast;
}
- AttributeSpecifierAST *AttributeSpecifier(AttributeListAST *attribute_list = 0)
+ AlignmentSpecifierAST *AlignmentSpecifier(ExpressionAST *typeIdExprOrAlignmentExpr = 0)
{
- AttributeSpecifierAST *__ast = new (&pool) AttributeSpecifierAST;
+ AlignmentSpecifierAST *__ast = new (&pool) AlignmentSpecifierAST;
+ __ast->typeIdExprOrAlignmentExpr = typeIdExprOrAlignmentExpr;
+ return __ast;
+ }
+
+ GnuAttributeSpecifierAST *GnuAttributeSpecifier(GnuAttributeListAST *attribute_list = 0)
+ {
+ GnuAttributeSpecifierAST *__ast = new (&pool) GnuAttributeSpecifierAST;
__ast->attribute_list = attribute_list;
return __ast;
}
- AttributeAST *Attribute(ExpressionListAST *expression_list = 0)
+ GnuAttributeAST *GnuAttribute(ExpressionListAST *expression_list = 0)
{
- AttributeAST *__ast = new (&pool) AttributeAST;
+ GnuAttributeAST *__ast = new (&pool) GnuAttributeAST;
__ast->expression_list = expression_list;
return __ast;
}
@@ -1168,14 +1175,6 @@ public:
return __ast;
}
- AttributeListAST *AttributeList(AttributeAST *value, AttributeListAST *next = 0)
- {
- AttributeListAST *__list = new (&pool) AttributeListAST;
- __list->next = next;
- __list->value = value;
- return __list;
- }
-
BaseSpecifierListAST *BaseSpecifierList(BaseSpecifierAST *value, BaseSpecifierListAST *next = 0)
{
BaseSpecifierListAST *__list = new (&pool) BaseSpecifierListAST;
@@ -1240,6 +1239,14 @@ public:
return __list;
}
+ GnuAttributeListAST *GnuAttributeList(GnuAttributeAST *value, GnuAttributeListAST *next = 0)
+ {
+ GnuAttributeListAST *__list = new (&pool) GnuAttributeListAST;
+ __list->next = next;
+ __list->value = value;
+ return __list;
+ }
+
MemInitializerListAST *MemInitializerList(MemInitializerAST *value, MemInitializerListAST *next = 0)
{
MemInitializerListAST *__list = new (&pool) MemInitializerListAST;
diff --git a/src/libs/3rdparty/cplusplus/ASTVisit.cpp b/src/libs/3rdparty/cplusplus/ASTVisit.cpp
index af8b916c9b..77b7e1b3fd 100644
--- a/src/libs/3rdparty/cplusplus/ASTVisit.cpp
+++ b/src/libs/3rdparty/cplusplus/ASTVisit.cpp
@@ -54,7 +54,15 @@ void SimpleSpecifierAST::accept0(ASTVisitor *visitor)
visitor->endVisit(this);
}
-void AttributeSpecifierAST::accept0(ASTVisitor *visitor)
+void AlignmentSpecifierAST::accept0(ASTVisitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(typeIdExprOrAlignmentExpr, visitor);
+ }
+ visitor->endVisit(this);
+}
+
+void GnuAttributeSpecifierAST::accept0(ASTVisitor *visitor)
{
if (visitor->visit(this)) {
accept(attribute_list, visitor);
@@ -62,7 +70,7 @@ void AttributeSpecifierAST::accept0(ASTVisitor *visitor)
visitor->endVisit(this);
}
-void AttributeAST::accept0(ASTVisitor *visitor)
+void GnuAttributeAST::accept0(ASTVisitor *visitor)
{
if (visitor->visit(this)) {
accept(expression_list, visitor);
diff --git a/src/libs/3rdparty/cplusplus/ASTVisitor.h b/src/libs/3rdparty/cplusplus/ASTVisitor.h
index 2d22680380..16b6ebd58b 100644
--- a/src/libs/3rdparty/cplusplus/ASTVisitor.h
+++ b/src/libs/3rdparty/cplusplus/ASTVisitor.h
@@ -75,14 +75,13 @@ public:
virtual bool visit(AccessDeclarationAST *) { return true; }
virtual bool visit(AliasDeclarationAST *) { return true; }
+ virtual bool visit(AlignmentSpecifierAST *) { return true; }
virtual bool visit(AlignofExpressionAST *) { return true; }
virtual bool visit(AnonymousNameAST *) { return true; }
virtual bool visit(ArrayAccessAST *) { return true; }
virtual bool visit(ArrayDeclaratorAST *) { return true; }
virtual bool visit(ArrayInitializerAST *) { return true; }
virtual bool visit(AsmDefinitionAST *) { return true; }
- virtual bool visit(AttributeAST *) { return true; }
- virtual bool visit(AttributeSpecifierAST *) { return true; }
virtual bool visit(BaseSpecifierAST *) { return true; }
virtual bool visit(BinaryExpressionAST *) { return true; }
virtual bool visit(BoolLiteralAST *) { return true; }
@@ -126,6 +125,8 @@ public:
virtual bool visit(ForeachStatementAST *) { return true; }
virtual bool visit(FunctionDeclaratorAST *) { return true; }
virtual bool visit(FunctionDefinitionAST *) { return true; }
+ virtual bool visit(GnuAttributeAST *) { return true; }
+ virtual bool visit(GnuAttributeSpecifierAST *) { return true; }
virtual bool visit(GotoStatementAST *) { return true; }
virtual bool visit(IdExpressionAST *) { return true; }
virtual bool visit(IfStatementAST *) { return true; }
@@ -224,14 +225,13 @@ public:
virtual void endVisit(AccessDeclarationAST *) {}
virtual void endVisit(AliasDeclarationAST *) {}
+ virtual void endVisit(AlignmentSpecifierAST *) {}
virtual void endVisit(AlignofExpressionAST *) {}
virtual void endVisit(AnonymousNameAST *) {}
virtual void endVisit(ArrayAccessAST *) {}
virtual void endVisit(ArrayDeclaratorAST *) {}
virtual void endVisit(ArrayInitializerAST *) {}
virtual void endVisit(AsmDefinitionAST *) {}
- virtual void endVisit(AttributeAST *) {}
- virtual void endVisit(AttributeSpecifierAST *) {}
virtual void endVisit(BaseSpecifierAST *) {}
virtual void endVisit(BinaryExpressionAST *) {}
virtual void endVisit(BoolLiteralAST *) {}
@@ -275,6 +275,8 @@ public:
virtual void endVisit(ForeachStatementAST *) {}
virtual void endVisit(FunctionDeclaratorAST *) {}
virtual void endVisit(FunctionDefinitionAST *) {}
+ virtual void endVisit(GnuAttributeAST *) {}
+ virtual void endVisit(GnuAttributeSpecifierAST *) {}
virtual void endVisit(GotoStatementAST *) {}
virtual void endVisit(IdExpressionAST *) {}
virtual void endVisit(IfStatementAST *) {}
diff --git a/src/libs/3rdparty/cplusplus/ASTfwd.h b/src/libs/3rdparty/cplusplus/ASTfwd.h
index 744fd57756..f48ae335f6 100644
--- a/src/libs/3rdparty/cplusplus/ASTfwd.h
+++ b/src/libs/3rdparty/cplusplus/ASTfwd.h
@@ -33,13 +33,13 @@ class ASTMatcher;
class AccessDeclarationAST;
class AliasDeclarationAST;
+class AlignmentSpecifierAST;
class AlignofExpressionAST;
class AnonymousNameAST;
class ArrayAccessAST;
class ArrayDeclaratorAST;
class ArrayInitializerAST;
class AsmDefinitionAST;
-class AttributeAST;
class AttributeSpecifierAST;
class BaseSpecifierAST;
class BinaryExpressionAST;
@@ -89,6 +89,8 @@ class ForStatementAST;
class ForeachStatementAST;
class FunctionDeclaratorAST;
class FunctionDefinitionAST;
+class GnuAttributeAST;
+class GnuAttributeSpecifierAST;
class GotoStatementAST;
class IdExpressionAST;
class IfStatementAST;
@@ -201,7 +203,7 @@ typedef List<MemInitializerAST *> MemInitializerListAST;
typedef List<NewArrayDeclaratorAST *> NewArrayDeclaratorListAST;
typedef List<PostfixAST *> PostfixListAST;
typedef List<PostfixDeclaratorAST *> PostfixDeclaratorListAST;
-typedef List<AttributeAST *> AttributeListAST;
+typedef List<GnuAttributeAST *> GnuAttributeListAST;
typedef List<NestedNameSpecifierAST *> NestedNameSpecifierListAST;
typedef List<CatchClauseAST *> CatchClauseListAST;
typedef List<PtrOperatorAST *> PtrOperatorListAST;
diff --git a/src/libs/3rdparty/cplusplus/Bind.cpp b/src/libs/3rdparty/cplusplus/Bind.cpp
index 499b44f29f..8665bfc8cf 100644
--- a/src/libs/3rdparty/cplusplus/Bind.cpp
+++ b/src/libs/3rdparty/cplusplus/Bind.cpp
@@ -303,14 +303,14 @@ const Name *Bind::objCSelectorArgument(ObjCSelectorArgumentAST *ast, bool *hasAr
return identifier(ast->name_token);
}
-bool Bind::visit(AttributeAST *ast)
+bool Bind::visit(GnuAttributeAST *ast)
{
(void) ast;
CPP_CHECK(!"unreachable");
return false;
}
-void Bind::attribute(AttributeAST *ast)
+void Bind::attribute(GnuAttributeAST *ast)
{
if (! ast)
return;
@@ -2567,6 +2567,8 @@ bool Bind::visit(ObjCMethodDeclarationAST *ast)
this->statement(ast->function_body);
(void) switchScope(previousScope);
_scope->addMember(method);
+ } else if (method) {
+ _scope->addMember(method);
}
return false;
@@ -2902,12 +2904,20 @@ bool Bind::visit(SimpleSpecifierAST *ast)
return false;
}
-bool Bind::visit(AttributeSpecifierAST *ast)
+bool Bind::visit(AlignmentSpecifierAST *ast)
+{
+ // Prevent visiting the type-id or alignment expression from changing the currently
+ // calculated type:
+ expression(ast->typeIdExprOrAlignmentExpr);
+ return false;
+}
+
+bool Bind::visit(GnuAttributeSpecifierAST *ast)
{
// unsigned attribute_token = ast->attribute_token;
// unsigned first_lparen_token = ast->first_lparen_token;
// unsigned second_lparen_token = ast->second_lparen_token;
- for (AttributeListAST *it = ast->attribute_list; it; it = it->next) {
+ for (GnuAttributeListAST *it = ast->attribute_list; it; it = it->next) {
this->attribute(it->value);
}
// unsigned first_rparen_token = ast->first_rparen_token;
diff --git a/src/libs/3rdparty/cplusplus/Bind.h b/src/libs/3rdparty/cplusplus/Bind.h
index ded74a9da8..d7dc7073db 100644
--- a/src/libs/3rdparty/cplusplus/Bind.h
+++ b/src/libs/3rdparty/cplusplus/Bind.h
@@ -77,7 +77,7 @@ protected:
unsigned calculateScopeStart(ObjCProtocolDeclarationAST *ast) const;
const Name *objCSelectorArgument(ObjCSelectorArgumentAST *ast, bool *hasArg);
- void attribute(AttributeAST *ast);
+ void attribute(GnuAttributeAST *ast);
FullySpecifiedType declarator(DeclaratorAST *ast, const FullySpecifiedType &init, DeclaratorIdAST **declaratorId);
void qtInterfaceName(QtInterfaceNameAST *ast);
void baseSpecifier(BaseSpecifierAST *ast, unsigned colon_token, Class *klass);
@@ -112,7 +112,7 @@ protected:
// AST
virtual bool visit(ObjCSelectorArgumentAST *ast);
- virtual bool visit(AttributeAST *ast);
+ virtual bool visit(GnuAttributeAST *ast);
virtual bool visit(DeclaratorAST *ast);
virtual bool visit(QtPropertyDeclarationItemAST *ast);
virtual bool visit(QtInterfaceNameAST *ast);
@@ -245,7 +245,8 @@ protected:
// SpecifierAST
virtual bool visit(SimpleSpecifierAST *ast);
- virtual bool visit(AttributeSpecifierAST *ast);
+ virtual bool visit(AlignmentSpecifierAST *ast);
+ virtual bool visit(GnuAttributeSpecifierAST *ast);
virtual bool visit(TypeofSpecifierAST *ast);
virtual bool visit(DecltypeSpecifierAST *ast);
virtual bool visit(ClassSpecifierAST *ast);
diff --git a/src/libs/3rdparty/cplusplus/Parser.cpp b/src/libs/3rdparty/cplusplus/Parser.cpp
index af7f6dfa7d..bcd70fbb36 100644
--- a/src/libs/3rdparty/cplusplus/Parser.cpp
+++ b/src/libs/3rdparty/cplusplus/Parser.cpp
@@ -26,8 +26,13 @@
#include "Literals.h"
#include "ObjectiveCTypeQualifiers.h"
#include "QtContextKeywords.h"
+
+#include <unordered_map>
+#include <utility>
+
#include <string>
#include <cstdio> // for putchar
+
#if defined(_MSC_VER) && (_MSC_VER < 1800)
# define va_copy(dst, src) ((dst) = (src))
#elif defined(__INTEL_COMPILER) && !defined(va_copy)
@@ -43,9 +48,9 @@ using namespace CPlusPlus;
namespace {
class DebugRule {
+public:
static int depth;
-public:
DebugRule(const char *name, const char *spell, unsigned idx, bool blocked)
{
for (int i = 0; i <= depth; ++i)
@@ -150,12 +155,93 @@ inline bool isRightAssociative(int tokenKind)
} // end of anonymous namespace
+class Parser::ASTCache
+{
+ ASTCache(const ASTCache &other);
+ void operator =(const ASTCache &other);
+
+public:
+ enum ASTKind {
+ Expression,
+ ExpressionList,
+ ParameterDeclarationClause,
+ TypeId
+ };
+
+public:
+ ASTCache() {}
+
+ void insert(ASTKind astKind, unsigned tokenIndexBeforeParsing,
+ AST *resultingAST, unsigned resultingTokenIndex)
+ {
+ const auto key = std::make_pair(astKind, tokenIndexBeforeParsing);
+ const auto value = std::make_pair(resultingAST, resultingTokenIndex);
+ const auto keyValue = std::make_pair(key, value);
+ _cache.insert(keyValue);
+ }
+
+ AST *find(ASTKind astKind, unsigned tokenIndex,
+ unsigned *resultingTokenIndex, bool *foundInCache) const
+ {
+ const auto key = std::make_pair(astKind, tokenIndex);
+ const auto it = _cache.find(key);
+ if (it == _cache.end()) {
+ *foundInCache = false;
+ return 0;
+ } else {
+ *foundInCache = true;
+ *resultingTokenIndex = it->second.second;
+ return it->second.first;
+ }
+ }
+
+ void clear()
+ {
+ _cache.clear();
+ }
+
+private:
+ struct KeyHasher {
+ size_t operator()(const std::pair<int, unsigned> &key) const
+ { return std::hash<int>()(key.first) ^ std::hash<unsigned>()(key.second); }
+ };
+
+ typedef std::pair<int, unsigned> ASTKindAndTokenIndex;
+ typedef std::pair<AST *, unsigned> ASTAndTokenIndex;
+ std::unordered_map<ASTKindAndTokenIndex, ASTAndTokenIndex, KeyHasher> _cache;
+};
+
#ifndef CPLUSPLUS_NO_DEBUG_RULE
# define DEBUG_THIS_RULE() DebugRule __debug_rule__(__func__, tok().spell(), cursor(), _translationUnit->blockErrors())
+inline void debugPrintCheckCache(bool goodCase)
+{
+ for (int i = 0; i <= DebugRule::depth - 1; ++i)
+ fputc('-', stderr);
+ if (goodCase)
+ fprintf(stderr, " CACHE: Re-using AST from Cache.\n");
+ else
+ fprintf(stderr, " CACHE: Already tried to parse this, skipping.\n");
+}
#else
# define DEBUG_THIS_RULE() do {} while (0)
+inline void debugPrintCheckCache(bool) {}
#endif
+#define CHECK_CACHE(ASTKind, ASTType, returnValueInBadCase) \
+ do { \
+ bool foundInCache; \
+ unsigned newTokenIndex; \
+ if (AST *ast = _astCache->find(ASTKind, cursor(), &newTokenIndex, &foundInCache)) { \
+ debugPrintCheckCache(true); \
+ node = (ASTType *) ast; \
+ _tokenIndex = newTokenIndex; \
+ return true; \
+ } else if (foundInCache) { \
+ debugPrintCheckCache(false); \
+ return returnValueInBadCase; \
+ } \
+ } while (0)
+
#define PARSE_EXPRESSION_WITH_OPERATOR_PRECEDENCE(node, minPrecedence) { \
if (LA() == T_THROW) { \
if (!parseThrowExpression(node)) \
@@ -175,14 +261,18 @@ Parser::Parser(TranslationUnit *unit)
_tokenIndex(1),
_templateArguments(0),
_inFunctionBody(false),
- _inObjCImplementationContext(false),
_inExpressionStatement(false),
_expressionDepth(0),
- _statementDepth(0)
+ _statementDepth(0),
+ _astCache(new ASTCache),
+ _expressionStatementAstCache(new ASTCache)
{ }
Parser::~Parser()
-{ }
+{
+ delete _expressionStatementAstCache;
+ delete _astCache;
+}
bool Parser::switchTemplateArguments(bool templateArguments)
{
@@ -633,7 +723,7 @@ bool Parser::parseDeclaration(DeclarationAST *&node)
if (_languageFeatures.objCEnabled && LA() == T___ATTRIBUTE__) {
const unsigned start = cursor();
SpecifierListAST *attributes = 0, **attr = &attributes;
- while (parseAttributeSpecifier(*attr))
+ while (parseGnuAttributeSpecifier(*attr))
attr = &(*attr)->next;
if (LA() == T_AT_INTERFACE)
return parseObjCInterface(node, attributes);
@@ -761,11 +851,7 @@ bool Parser::parseNamespace(DeclarationAST *&node)
ast->namespace_token = namespace_token;
if (LA() == T_IDENTIFIER)
ast->identifier_token = consumeToken();
- SpecifierListAST **attr_ptr = &ast->attribute_list;
- while (LA() == T___ATTRIBUTE__) {
- parseAttributeSpecifier(*attr_ptr);
- attr_ptr = &(*attr_ptr)->next;
- }
+ parseOptionalAttributeSpecifierSequence(ast->attribute_list);
if (LA() == T_LBRACE) {
parseLinkageBody(ast->linkage_body);
} else { // attempt to do error recovery
@@ -1196,9 +1282,8 @@ bool Parser::parseCvQualifiers(SpecifierListAST *&node)
spec->specifier_token = consumeToken();
*ast = new (_pool) SpecifierListAST(spec);
ast = &(*ast)->next;
- } else if (LA() == T___ATTRIBUTE__) {
- parseAttributeSpecifier(*ast);
- ast = &(*ast)->next;
+ } else if (parseOptionalAttributeSpecifierSequence(*ast)) {
+ continue;
} else {
break;
}
@@ -1398,11 +1483,7 @@ bool Parser::parseCoreDeclarator(DeclaratorAST *&node, SpecifierListAST *decl_sp
DEBUG_THIS_RULE();
unsigned start = cursor();
SpecifierListAST *attributes = 0;
- SpecifierListAST **attribute_ptr = &attributes;
- while (LA() == T___ATTRIBUTE__) {
- parseAttributeSpecifier(*attribute_ptr);
- attribute_ptr = &(*attribute_ptr)->next;
- }
+ parseOptionalAttributeSpecifierSequence(attributes);
PtrOperatorListAST *ptr_operators = 0, **ptr_operators_tail = &ptr_operators;
while (parsePtrOperator(*ptr_operators_tail))
@@ -1577,12 +1658,7 @@ bool Parser::parseDeclarator(DeclaratorAST *&node, SpecifierListAST *decl_specif
consumeToken(); // skip T_RPAREN
}
- SpecifierListAST **spec_ptr = &node->post_attribute_list;
- while (LA() == T___ATTRIBUTE__) {
- parseAttributeSpecifier(*spec_ptr);
- spec_ptr = &(*spec_ptr)->next;
- }
-
+ parseOptionalAttributeSpecifierSequence(node->post_attribute_list);
return true;
}
@@ -1856,6 +1932,8 @@ bool Parser::parseTypeParameter(DeclarationAST *&node)
bool Parser::parseTypeId(ExpressionAST *&node)
{
DEBUG_THIS_RULE();
+ CHECK_CACHE(ASTCache::TypeId, ExpressionAST, false);
+
SpecifierListAST *type_specifier = 0;
if (parseTypeSpecifier(type_specifier)) {
TypeIdAST *ast = new (_pool) TypeIdAST;
@@ -1872,6 +1950,8 @@ bool Parser::parseParameterDeclarationClause(ParameterDeclarationClauseAST *&nod
DEBUG_THIS_RULE();
if (LA() == T_RPAREN)
return true; // nothing to do
+ CHECK_CACHE(ASTCache::ParameterDeclarationClause, ParameterDeclarationClauseAST, true);
+ const unsigned initialCursor = cursor();
ParameterDeclarationListAST *parameter_declarations = 0;
@@ -1896,6 +1976,7 @@ bool Parser::parseParameterDeclarationClause(ParameterDeclarationClauseAST *&nod
node = ast;
}
+ _astCache->insert(ASTCache::ParameterDeclarationClause, initialCursor, node, cursor());
return true;
}
@@ -1985,11 +2066,8 @@ bool Parser::parseClassSpecifier(SpecifierListAST *&node)
unsigned classkey_token = consumeToken();
- SpecifierListAST *attributes = 0, **attr_ptr = &attributes;
- while (LA() == T___ATTRIBUTE__) {
- parseAttributeSpecifier(*attr_ptr);
- attr_ptr = &(*attr_ptr)->next;
- }
+ SpecifierListAST *attributes = 0;
+ parseOptionalAttributeSpecifierSequence(attributes);
if (LA(1) == T_IDENTIFIER && LA(2) == T_IDENTIFIER) {
const Identifier *id = tok(2).identifier;
@@ -2464,12 +2542,8 @@ bool Parser::parseElaboratedTypeSpecifier(SpecifierListAST *&node)
if (lookAtClassKey() || LA() == T_ENUM || LA() == T_TYPENAME) {
unsigned classkey_token = consumeToken();
- SpecifierListAST *attributes = 0, **attr_ptr = &attributes;
- while (LA() == T___ATTRIBUTE__) {
- parseAttributeSpecifier(*attr_ptr);
- attr_ptr = &(*attr_ptr)->next;
- }
-
+ SpecifierListAST *attributes = 0;
+ parseOptionalAttributeSpecifierSequence(attributes);
NameAST *name = 0;
if (parseName(name)) {
ElaboratedTypeSpecifierAST *ast = new (_pool) ElaboratedTypeSpecifierAST;
@@ -2838,9 +2912,14 @@ bool Parser::parseTypeIdList(ExpressionListAST *&node)
bool Parser::parseExpressionList(ExpressionListAST *&node)
{
DEBUG_THIS_RULE();
+ CHECK_CACHE(ASTCache::ExpressionList, ExpressionListAST, false);
+ unsigned initialCursor = cursor();
- if (_languageFeatures.cxx11Enabled)
- return parseInitializerList0x(node);
+ if (_languageFeatures.cxx11Enabled) {
+ bool result = parseInitializerList0x(node);
+ _astCache->insert(ASTCache::ExpressionList, initialCursor, (AST *) node, cursor());
+ return result;
+ }
ExpressionListAST **expression_list_ptr = &node;
ExpressionAST *expression = 0;
@@ -2857,9 +2936,11 @@ bool Parser::parseExpressionList(ExpressionListAST *&node)
expression_list_ptr = &(*expression_list_ptr)->next;
}
}
+ _astCache->insert(ASTCache::ExpressionList, initialCursor, (AST *) node, cursor());
return true;
}
+ _astCache->insert(ASTCache::ExpressionList, initialCursor, 0, cursor());
return false;
}
@@ -3022,9 +3103,11 @@ bool Parser::parseExpressionStatement(StatementAST *&node)
const bool wasInExpressionStatement = _inExpressionStatement;
_inExpressionStatement = true;
- // switch to the temp pool
+ // switch to the temp pool and cache
MemoryPool *previousPool = _pool;
_pool = &_expressionStatementTempPool;
+ ASTCache *previousASTCache = _astCache;
+ _astCache = _expressionStatementAstCache;
bool parsed = false;
@@ -3041,12 +3124,15 @@ bool Parser::parseExpressionStatement(StatementAST *&node)
_inExpressionStatement = wasInExpressionStatement;
if (! _inExpressionStatement) {
- // rewind the memory pool after parsing a toplevel expression statement.
+ // rewind the memory pool and cache after parsing a toplevel expression statement.
_expressionStatementTempPool.reset();
+ _astCache->clear();
}
- // restore the pool
+ // restore the pool and cache
_pool = previousPool;
+ _astCache = previousASTCache;
+
return parsed;
}
@@ -3799,39 +3885,83 @@ bool Parser::lookAtClassKey() const
}
}
-bool Parser::parseAttributeSpecifier(SpecifierListAST *&node)
+bool Parser::parseOptionalAttributeSpecifierSequence(SpecifierListAST *&attribute_list)
+{
+ bool didRead = false;
+ while (parseAttributeSpecifier(attribute_list))
+ didRead = true;
+ return didRead;
+}
+
+bool Parser::parseAttributeSpecifier(SpecifierListAST *&attribute_list)
+{
+ SpecifierListAST **attr_ptr = &attribute_list;
+ switch (LA()) {
+ case T_ALIGNAS: {
+ AlignmentSpecifierAST *ast = new (_pool) AlignmentSpecifierAST;
+ ast->align_token = consumeToken();
+ match(T_LPAREN, &ast->lparen_token);
+
+ const unsigned saved = cursor();
+ if (!parseTypeId(ast->typeIdExprOrAlignmentExpr) ||
+ (LA() != T_RPAREN &&
+ (LA(1) != T_DOT_DOT_DOT || LA(2) != T_RPAREN))) {
+ rewind(saved);
+ parseExpression(ast->typeIdExprOrAlignmentExpr);
+ }
+
+ if (LA() == T_DOT_DOT_DOT)
+ ast->ellipses_token = consumeToken();
+ match(T_RPAREN, &ast->rparen_token);
+ attribute_list = new (_pool) SpecifierListAST(ast);
+ return true;
+ }
+ //### TODO: C++11-style attributes
+// case T_LBRACKET:
+ case T___ATTRIBUTE__:
+ while (LA() == T___ATTRIBUTE__) {
+ parseGnuAttributeSpecifier(*attr_ptr);
+ attr_ptr = &(*attr_ptr)->next;
+ }
+ return true;
+ default:
+ return false;
+ }
+}
+
+bool Parser::parseGnuAttributeSpecifier(SpecifierListAST *&node)
{
DEBUG_THIS_RULE();
if (LA() != T___ATTRIBUTE__)
return false;
- AttributeSpecifierAST *ast = new (_pool) AttributeSpecifierAST;
+ GnuAttributeSpecifierAST *ast = new (_pool) GnuAttributeSpecifierAST;
ast->attribute_token = consumeToken();
match(T_LPAREN, &ast->first_lparen_token);
match(T_LPAREN, &ast->second_lparen_token);
- parseAttributeList(ast->attribute_list);
+ parseGnuAttributeList(ast->attribute_list);
match(T_RPAREN, &ast->first_rparen_token);
match(T_RPAREN, &ast->second_rparen_token);
node = new (_pool) SpecifierListAST(ast);
return true;
}
-bool Parser::parseAttributeList(AttributeListAST *&node)
+bool Parser::parseGnuAttributeList(GnuAttributeListAST *&node)
{
DEBUG_THIS_RULE();
- AttributeListAST **iter = &node;
+ GnuAttributeListAST **iter = &node;
while (LA() == T_CONST || LA() == T_IDENTIFIER) {
- *iter = new (_pool) AttributeListAST;
+ *iter = new (_pool) GnuAttributeListAST;
if (LA() == T_CONST) {
- AttributeAST *attr = new (_pool) AttributeAST;
+ GnuAttributeAST *attr = new (_pool) GnuAttributeAST;
attr->identifier_token = consumeToken();
(*iter)->value = attr;
iter = &(*iter)->next;
} else if (LA() == T_IDENTIFIER) {
- AttributeAST *attr = new (_pool) AttributeAST;
+ GnuAttributeAST *attr = new (_pool) GnuAttributeAST;
attr->identifier_token = consumeToken();
if (LA() == T_LPAREN) {
attr->lparen_token = consumeToken();
@@ -3856,7 +3986,7 @@ bool Parser::parseBuiltinTypeSpecifier(SpecifierListAST *&node)
{
DEBUG_THIS_RULE();
if (LA() == T___ATTRIBUTE__) {
- return parseAttributeSpecifier(node);
+ return parseGnuAttributeSpecifier(node);
} else if (LA() == T___TYPEOF__) {
TypeofSpecifierAST *ast = new (_pool) TypeofSpecifierAST;
ast->typeof_token = consumeToken();
@@ -3912,8 +4042,7 @@ bool Parser::parseSimpleDeclaration(DeclarationAST *&node, ClassSpecifierAST *de
spec->specifier_token = consumeToken();
*decl_specifier_seq_ptr = new (_pool) SpecifierListAST(spec);
decl_specifier_seq_ptr = &(*decl_specifier_seq_ptr)->next;
- } else if (LA() == T___ATTRIBUTE__) {
- parseAttributeSpecifier(*decl_specifier_seq_ptr);
+ } else if (parseAttributeSpecifier(*decl_specifier_seq_ptr)) {
decl_specifier_seq_ptr = &(*decl_specifier_seq_ptr)->next;
} else if (! named_type_specifier && ! has_complex_type_specifier && lookAtBuiltinTypeSpecifier()) {
parseBuiltinTypeSpecifier(*decl_specifier_seq_ptr);
@@ -5244,6 +5373,7 @@ bool Parser::parseCastExpression(ExpressionAST *&node)
DEBUG_THIS_RULE();
if (LA() == T_LPAREN) {
unsigned lparen_token = consumeToken();
+ unsigned initialCursor = cursor();
ExpressionAST *type_id = 0;
if (parseTypeId(type_id) && LA() == T_RPAREN) {
@@ -5298,6 +5428,7 @@ bool Parser::parseCastExpression(ExpressionAST *&node)
}
parse_as_unary_expression:
+ _astCache->insert(ASTCache::TypeId, initialCursor, 0, cursor());
rewind(lparen_token);
}
@@ -5398,6 +5529,8 @@ bool Parser::parseConstantExpression(ExpressionAST *&node)
bool Parser::parseExpression(ExpressionAST *&node)
{
DEBUG_THIS_RULE();
+ CHECK_CACHE(ASTCache::Expression, ExpressionAST, false);
+ unsigned initialCursor = cursor();
if (_expressionDepth > MAX_EXPRESSION_DEPTH)
return false;
@@ -5405,6 +5538,8 @@ bool Parser::parseExpression(ExpressionAST *&node)
++_expressionDepth;
bool success = parseCommaExpression(node);
--_expressionDepth;
+
+ _astCache->insert(ASTCache::Expression, initialCursor, node, cursor());
return success;
}
@@ -5628,7 +5763,7 @@ bool Parser::parseObjCInterface(DeclarationAST *&node,
DEBUG_THIS_RULE();
if (! attributes && LA() == T___ATTRIBUTE__) {
SpecifierListAST **attr = &attributes;
- while (parseAttributeSpecifier(*attr))
+ while (parseGnuAttributeSpecifier(*attr))
attr = &(*attr)->next;
}
@@ -5717,7 +5852,7 @@ bool Parser::parseObjCProtocol(DeclarationAST *&node,
DEBUG_THIS_RULE();
if (! attributes && LA() == T___ATTRIBUTE__) {
SpecifierListAST **attr = &attributes;
- while (parseAttributeSpecifier(*attr))
+ while (parseGnuAttributeSpecifier(*attr))
attr = &(*attr)->next;
}
@@ -6219,7 +6354,7 @@ bool Parser::parseObjCMethodPrototype(ObjCMethodPrototypeAST *&node)
}
SpecifierListAST **attr = &ast->attribute_list;
- while (parseAttributeSpecifier(*attr))
+ while (parseGnuAttributeSpecifier(*attr))
attr = &(*attr)->next;
node = ast;
@@ -6328,7 +6463,7 @@ bool Parser::parseObjCKeywordDeclaration(ObjCSelectorArgumentAST *&argument, Obj
parseObjCTypeName(node->type_name);
SpecifierListAST **attr = &node->attribute_list;
- while (parseAttributeSpecifier(*attr))
+ while (parseGnuAttributeSpecifier(*attr))
attr = &(*attr)->next;
SimpleNameAST *param_name = new (_pool) SimpleNameAST;
@@ -6528,7 +6663,7 @@ bool Parser::parseLambdaDeclarator(LambdaDeclaratorAST *&node)
match(T_RPAREN, &ast->rparen_token);
SpecifierListAST **attr = &ast->attributes;
- while (parseAttributeSpecifier(*attr))
+ while (parseGnuAttributeSpecifier(*attr))
attr = &(*attr)->next;
if (LA() == T_MUTABLE)
@@ -6552,7 +6687,7 @@ bool Parser::parseTrailingReturnType(TrailingReturnTypeAST *&node)
ast->arrow_token = consumeToken();
SpecifierListAST **attr = &ast->attributes;
- while (parseAttributeSpecifier(*attr))
+ while (parseGnuAttributeSpecifier(*attr))
attr = &(*attr)->next;
parseTrailingTypeSpecifierSeq(ast->type_specifier_list);
diff --git a/src/libs/3rdparty/cplusplus/Parser.h b/src/libs/3rdparty/cplusplus/Parser.h
index 10f8f6c542..4a2a6dfb7e 100644
--- a/src/libs/3rdparty/cplusplus/Parser.h
+++ b/src/libs/3rdparty/cplusplus/Parser.h
@@ -164,8 +164,10 @@ public:
bool parseTypeParameter(DeclarationAST *&node);
bool parseBuiltinTypeSpecifier(SpecifierListAST *&node);
- bool parseAttributeSpecifier(SpecifierListAST *&node);
- bool parseAttributeList(AttributeListAST *&node);
+ bool parseOptionalAttributeSpecifierSequence(SpecifierListAST *&attribute_list);
+ bool parseAttributeSpecifier(SpecifierListAST *&attribute_list);
+ bool parseGnuAttributeSpecifier(SpecifierListAST *&node);
+ bool parseGnuAttributeList(GnuAttributeListAST *&node);
bool parseDeclSpecifierSeq(SpecifierListAST *&node,
bool noStorageSpecifiers = false,
@@ -316,7 +318,6 @@ private:
unsigned _tokenIndex;
bool _templateArguments: 1;
bool _inFunctionBody: 1;
- bool _inObjCImplementationContext: 1;
bool _inExpressionStatement: 1;
int _expressionDepth;
int _statementDepth;
@@ -324,8 +325,9 @@ private:
MemoryPool _expressionStatementTempPool;
std::map<unsigned, TemplateArgumentListEntry> _templateArgumentList;
- class Rewind;
- friend class Rewind;
+ class ASTCache;
+ ASTCache *_astCache;
+ ASTCache *_expressionStatementAstCache;
private:
Parser(const Parser& source);
diff --git a/src/libs/cplusplus/FastPreprocessor.cpp b/src/libs/cplusplus/FastPreprocessor.cpp
index c49695fc8c..3c5b4312ce 100644
--- a/src/libs/cplusplus/FastPreprocessor.cpp
+++ b/src/libs/cplusplus/FastPreprocessor.cpp
@@ -66,9 +66,10 @@ QByteArray FastPreprocessor::run(Document::Ptr newDoc, const QByteArray &source)
return preprocessed;
}
-void FastPreprocessor::sourceNeeded(unsigned line, const QString &fileName,
- IncludeType mode)
+void FastPreprocessor::sourceNeeded(unsigned line, const QString &fileName, IncludeType mode,
+ const QStringList &initialIncludes)
{
+ Q_UNUSED(initialIncludes)
Q_ASSERT(_currentDoc);
// CHECKME: Is that cleanName needed?
QString cleanName = QDir::cleanPath(fileName);
diff --git a/src/libs/cplusplus/FastPreprocessor.h b/src/libs/cplusplus/FastPreprocessor.h
index df19c4dcdf..b4a14cfdb4 100644
--- a/src/libs/cplusplus/FastPreprocessor.h
+++ b/src/libs/cplusplus/FastPreprocessor.h
@@ -57,7 +57,8 @@ public:
QByteArray run(Document::Ptr newDoc, const QByteArray &source);
// CPlusPlus::Client
- virtual void sourceNeeded(unsigned line, const QString &fileName, IncludeType mode);
+ virtual void sourceNeeded(unsigned line, const QString &fileName, IncludeType mode,
+ const QStringList &initialIncludes = QStringList());
virtual void macroAdded(const Macro &);
diff --git a/src/libs/cplusplus/FindUsages.cpp b/src/libs/cplusplus/FindUsages.cpp
index 813acc3ebc..0b776e30f4 100644
--- a/src/libs/cplusplus/FindUsages.cpp
+++ b/src/libs/cplusplus/FindUsages.cpp
@@ -348,14 +348,14 @@ void FindUsages::objCSelectorArgument(ObjCSelectorArgumentAST *ast)
// unsigned colon_token = ast->colon_token;
}
-bool FindUsages::visit(AttributeAST *ast)
+bool FindUsages::visit(GnuAttributeAST *ast)
{
(void) ast;
Q_ASSERT(!"unreachable");
return false;
}
-void FindUsages::attribute(AttributeAST *ast)
+void FindUsages::attribute(GnuAttributeAST *ast)
{
if (! ast)
return;
@@ -1971,12 +1971,12 @@ bool FindUsages::visit(SimpleSpecifierAST *ast)
return false;
}
-bool FindUsages::visit(AttributeSpecifierAST *ast)
+bool FindUsages::visit(GnuAttributeSpecifierAST *ast)
{
// unsigned attribute_token = ast->attribute_token;
// unsigned first_lparen_token = ast->first_lparen_token;
// unsigned second_lparen_token = ast->second_lparen_token;
- for (AttributeListAST *it = ast->attribute_list; it; it = it->next) {
+ for (GnuAttributeListAST *it = ast->attribute_list; it; it = it->next) {
this->attribute(it->value);
}
// unsigned first_rparen_token = ast->first_rparen_token;
diff --git a/src/libs/cplusplus/FindUsages.h b/src/libs/cplusplus/FindUsages.h
index 2d63c2a859..c09652da2c 100644
--- a/src/libs/cplusplus/FindUsages.h
+++ b/src/libs/cplusplus/FindUsages.h
@@ -95,7 +95,7 @@ protected:
void postfixDeclarator(PostfixDeclaratorAST *ast);
void objCSelectorArgument(ObjCSelectorArgumentAST *ast);
- void attribute(AttributeAST *ast);
+ void attribute(GnuAttributeAST *ast);
void declarator(DeclaratorAST *ast, Scope *symbol = 0);
void qtPropertyDeclarationItem(QtPropertyDeclarationItemAST *ast);
void qtInterfaceName(QtInterfaceNameAST *ast);
@@ -127,7 +127,7 @@ protected:
// AST
virtual bool visit(ObjCSelectorArgumentAST *ast);
- virtual bool visit(AttributeAST *ast);
+ virtual bool visit(GnuAttributeAST *ast);
virtual bool visit(DeclaratorAST *ast);
virtual bool visit(QtPropertyDeclarationItemAST *ast);
virtual bool visit(QtInterfaceNameAST *ast);
@@ -258,7 +258,7 @@ protected:
// SpecifierAST
virtual bool visit(SimpleSpecifierAST *ast);
- virtual bool visit(AttributeSpecifierAST *ast);
+ virtual bool visit(GnuAttributeSpecifierAST *ast);
virtual bool visit(TypeofSpecifierAST *ast);
virtual bool visit(DecltypeSpecifierAST *ast);
virtual bool visit(ClassSpecifierAST *ast);
diff --git a/src/libs/cplusplus/PreprocessorClient.h b/src/libs/cplusplus/PreprocessorClient.h
index a990a39357..3680770dc2 100644
--- a/src/libs/cplusplus/PreprocessorClient.h
+++ b/src/libs/cplusplus/PreprocessorClient.h
@@ -32,7 +32,7 @@
#include <cplusplus/CPlusPlusForwardDeclarations.h>
-#include <QString>
+#include <QStringList>
#include <QVector>
QT_BEGIN_NAMESPACE
@@ -100,7 +100,8 @@ public:
virtual void startSkippingBlocks(unsigned utf16charsOffset) = 0;
virtual void stopSkippingBlocks(unsigned utf16charsOffset) = 0;
- virtual void sourceNeeded(unsigned line, const QString &fileName, IncludeType mode) = 0;
+ virtual void sourceNeeded(unsigned line, const QString &fileName, IncludeType mode,
+ const QStringList &initialIncludes = QStringList()) = 0;
static inline bool isInjectedFile(const QString &fileName)
{
diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp
index eb72166154..6bfffda64f 100644
--- a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp
+++ b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp
@@ -214,7 +214,7 @@ QHash<QString, Dialect> ModelManagerInterface::languageForSuffix() const
void ModelManagerInterface::writeMessageInternal(const QString &msg) const
{
- qCWarning(qmljsLog) << msg;
+ qCDebug(qmljsLog) << msg;
}
ModelManagerInterface::WorkingCopy ModelManagerInterface::workingCopyInternal() const
@@ -634,7 +634,7 @@ void ModelManagerInterface::updateDocument(Document::Ptr doc)
void ModelManagerInterface::updateLibraryInfo(const QString &path, const LibraryInfo &info)
{
if (!info.pluginTypeInfoError().isEmpty())
- qCWarning(qmljsLog) << "Dumping errors for " << path << ":" << info.pluginTypeInfoError();
+ qCDebug(qmljsLog) << "Dumping errors for " << path << ":" << info.pluginTypeInfoError();
{
QMutexLocker locker(&m_mutex);
diff --git a/src/libs/qmljs/qmljsplugindumper.cpp b/src/libs/qmljs/qmljsplugindumper.cpp
index bdd6c63cf4..18fb1666ed 100644
--- a/src/libs/qmljs/qmljsplugindumper.cpp
+++ b/src/libs/qmljs/qmljsplugindumper.cpp
@@ -465,18 +465,13 @@ void PluginDumper::dump(const Plugin &plugin)
connect(process, SIGNAL(finished(int)), SLOT(qmlPluginTypeDumpDone(int)));
connect(process, SIGNAL(error(QProcess::ProcessError)), SLOT(qmlPluginTypeDumpError(QProcess::ProcessError)));
QStringList args;
- if (plugin.importUri.isEmpty()) {
- args << QLatin1String("--path");
- args << plugin.importPath;
- if (ComponentVersion(plugin.importVersion).isValid())
- args << plugin.importVersion;
- } else {
- if (info.qmlDumpHasRelocatableFlag)
- args << QLatin1String("-relocatable");
- args << plugin.importUri;
- args << plugin.importVersion;
- args << plugin.importPath;
- }
+ if (plugin.importUri.isEmpty())
+ return; // dumping with --path always fails
+ if (info.qmlDumpHasRelocatableFlag)
+ args << QLatin1String("-relocatable");
+ args << plugin.importUri;
+ args << plugin.importVersion;
+ args << plugin.importPath;
process->start(info.qmlDumpPath, args);
m_runningQmldumps.insert(process, plugin.qmldirPath);
}
diff --git a/src/plugins/analyzerbase/analyzermanager.cpp b/src/plugins/analyzerbase/analyzermanager.cpp
index afb06ab464..0de28c728d 100644
--- a/src/plugins/analyzerbase/analyzermanager.cpp
+++ b/src/plugins/analyzerbase/analyzermanager.cpp
@@ -624,14 +624,13 @@ void AnalyzerManager::addAction(AnalyzerAction *action)
d->addAction(action);
}
-QDockWidget *AnalyzerManager::createDockWidget(IAnalyzerTool *tool, const QString &title,
+QDockWidget *AnalyzerManager::createDockWidget(IAnalyzerTool *tool,
QWidget *widget, Qt::DockWidgetArea area)
{
QTC_ASSERT(!widget->objectName().isEmpty(), return 0);
QDockWidget *dockWidget = d->m_mainWindow->addDockForWidget(widget);
dockWidget->setProperty(INITIAL_DOCK_AREA, int(area));
d->m_dockWidgets.append(AnalyzerManagerPrivate::DockPtr(dockWidget));
- dockWidget->setWindowTitle(title);
d->m_toolWidgets[tool].push_back(dockWidget);
return dockWidget;
}
diff --git a/src/plugins/analyzerbase/analyzermanager.h b/src/plugins/analyzerbase/analyzermanager.h
index 2ba0764e65..a7ebee19fc 100644
--- a/src/plugins/analyzerbase/analyzermanager.h
+++ b/src/plugins/analyzerbase/analyzermanager.h
@@ -69,8 +69,8 @@ public:
static void addAction(AnalyzerAction *action);
// Dockwidgets are registered to the main window.
- static QDockWidget *createDockWidget(IAnalyzerTool *tool, const QString &title,
- QWidget *widget, Qt::DockWidgetArea area = Qt::TopDockWidgetArea);
+ static QDockWidget *createDockWidget(IAnalyzerTool *tool,
+ QWidget *widget, Qt::DockWidgetArea area = Qt::BottomDockWidgetArea);
static Utils::FancyMainWindow *mainWindow();
diff --git a/src/plugins/android/androidglobal.h b/src/plugins/android/androidglobal.h
index 47f147b87d..61c94085fc 100644
--- a/src/plugins/android/androidglobal.h
+++ b/src/plugins/android/androidglobal.h
@@ -47,6 +47,8 @@ public:
template<class T> static T *buildStep(const ProjectExplorer::BuildConfiguration *dc)
{
+ if (!dc)
+ return 0;
foreach (const Core::Id &id, dc->knownStepLists()) {
ProjectExplorer::BuildStepList *bsl = dc->stepList(id);
if (!bsl)
diff --git a/src/plugins/android/androidmanifesteditorwidget.cpp b/src/plugins/android/androidmanifesteditorwidget.cpp
index b968c8f21c..9eaa74b637 100644
--- a/src/plugins/android/androidmanifesteditorwidget.cpp
+++ b/src/plugins/android/androidmanifesteditorwidget.cpp
@@ -1006,6 +1006,7 @@ void AndroidManifestEditorWidget::parseApplication(QXmlStreamReader &reader, QXm
if (!m_appNameInStringsXml) {
keys << QLatin1String("android:label");
values << m_appNameLineEdit->text();
+ m_setAppName = false;
}
bool ensureIconAttribute = !m_lIconPath.isEmpty()
|| !m_mIconPath.isEmpty()
diff --git a/src/plugins/android/androidsettingswidget.cpp b/src/plugins/android/androidsettingswidget.cpp
index 4fc6d78ec7..7243f99de5 100644
--- a/src/plugins/android/androidsettingswidget.cpp
+++ b/src/plugins/android/androidsettingswidget.cpp
@@ -49,6 +49,8 @@
#include <QFile>
#include <QTextStream>
#include <QProcess>
+#include <QTimer>
+#include <QTime>
#include <QDesktopServices>
#include <QFileDialog>
@@ -134,6 +136,9 @@ AndroidSettingsWidget::AndroidSettingsWidget(QWidget *parent)
{
m_ui->setupUi(this);
+ connect(&m_checkGdbWatcher, SIGNAL(finished()),
+ this, SLOT(checkGdbFinished()));
+
m_ui->SDKLocationPathChooser->setFileName(m_androidConfig.sdkLocation());
m_ui->SDKLocationPathChooser->setPromptDialogTitle(tr("Select Android SDK folder"));
m_ui->NDKLocationPathChooser->setFileName(m_androidConfig.ndkLocation());
@@ -170,6 +175,9 @@ AndroidSettingsWidget::AndroidSettingsWidget(QWidget *parent)
m_ui->downloadAntToolButton->setVisible(!Utils::HostOsInfo::isLinuxHost());
m_ui->downloadOpenJDKToolButton->setVisible(!Utils::HostOsInfo::isLinuxHost());
+ connect(m_ui->gdbWarningLabel, SIGNAL(linkActivated(QString)),
+ this, SLOT(showGdbWarningDialog()));
+
check(All);
applyToUi(All);
@@ -183,6 +191,50 @@ AndroidSettingsWidget::~AndroidSettingsWidget()
m_futureWatcher.waitForFinished();
}
+// NOTE: Will be run via QFuture
+static QPair<QStringList, bool> checkGdbForBrokenPython(const QStringList &paths)
+{
+ foreach (const QString &path, paths) {
+ QTime timer;
+ timer.start();
+ QProcess proc;
+ proc.setProcessChannelMode(QProcess::MergedChannels);
+ proc.start(path);
+ proc.waitForStarted();
+
+ QByteArray output;
+ while (proc.waitForReadyRead(300)) {
+ output += proc.readAll();
+ if (output.contains("(gdb)"))
+ break;
+ if (timer.elapsed() > 7 * 1000)
+ return qMakePair(paths, true); // Took too long, abort
+ }
+
+ output.clear();
+
+ proc.write("python import string\n");
+ proc.write("python print(string.ascii_uppercase)\n");
+ proc.write("python import struct\n");
+ proc.write("quit\n");
+ while (proc.waitForFinished(300)) {
+ if (timer.elapsed() > 9 * 1000)
+ return qMakePair(paths, true); // Took too long, abort
+ }
+ proc.waitForFinished();
+
+ output = proc.readAll();
+
+ bool error = output.contains("_PyObject_Free")
+ || output.contains("_PyExc_IOError")
+ || output.contains("_sysconfigdata_nd ")
+ || !output.contains("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ if (error)
+ return qMakePair(paths, error);
+ }
+ return qMakePair(paths, false);
+}
+
void AndroidSettingsWidget::check(AndroidSettingsWidget::Mode mode)
{
if (mode & Sdk) {
@@ -198,6 +250,8 @@ void AndroidSettingsWidget::check(AndroidSettingsWidget::Mode mode)
Utils::FileName platformPath = m_androidConfig.ndkLocation();
Utils::FileName toolChainPath = m_androidConfig.ndkLocation();
Utils::FileName sourcesPath = m_androidConfig.ndkLocation();
+ m_ui->gdbWarningIconLabel->setVisible(false);
+ m_ui->gdbWarningLabel->setVisible(false);
if (m_androidConfig.ndkLocation().isEmpty()) {
m_ndkState = NotSet;
} else if (!platformPath.appendPath(QLatin1String("platforms")).toFileInfo().exists()
@@ -214,6 +268,21 @@ void AndroidSettingsWidget::check(AndroidSettingsWidget::Mode mode)
= AndroidToolChainFactory::toolchainPathsForNdk(m_androidConfig.ndkLocation());
m_ndkCompilerCount = compilerPaths.count();
+ // Check for a gdb with a broken python
+ QStringList gdbPaths;
+ foreach (const AndroidToolChainFactory::AndroidToolChainInformation &ati, compilerPaths) {
+ // we only check the arm gdbs, that's indicative enough
+ if (ati.architecture != ProjectExplorer::Abi::ArmArchitecture)
+ continue;
+ Utils::FileName gdbPath = m_androidConfig.gdbPath(ati.architecture, ati.version);
+ if (gdbPath.toFileInfo().exists())
+ gdbPaths << gdbPath.toString();
+ }
+
+ if (!gdbPaths.isEmpty()) {
+ m_checkGdbWatcher.setFuture(QtConcurrent::run(&checkGdbForBrokenPython, gdbPaths));
+ m_gdbCheckPaths = gdbPaths;
+ }
// See if we have qt versions for those toolchains
QSet<ProjectExplorer::Abi::Architecture> toolchainsForArch;
@@ -508,6 +577,25 @@ void AndroidSettingsWidget::createKitToggled()
m_androidConfig.setAutomaticKitCreation(m_ui->CreateKitCheckBox->isChecked());
}
+void AndroidSettingsWidget::checkGdbFinished()
+{
+ QPair<QStringList, bool> result = m_checkGdbWatcher.future().result();
+ if (result.first != m_gdbCheckPaths) // no longer relevant
+ return;
+ m_ui->gdbWarningIconLabel->setVisible(result.second);
+ m_ui->gdbWarningLabel->setVisible(result.second);
+}
+
+void AndroidSettingsWidget::showGdbWarningDialog()
+{
+ QMessageBox::warning(this,
+ tr("Unsupported GDB"),
+ tr("The GDB inside this NDK seems to not support Python. "
+ "The Qt Project offers fixed GDB builds at: "
+ "<a href=\"http://download.qt-project.org/official_releases/gdb/osx/\">"
+ "http://download.qt-project.org/official_releases/gdb/osx/</a>"));
+}
+
void AndroidSettingsWidget::manageAVD()
{
QProcess *avdProcess = new QProcess();
diff --git a/src/plugins/android/androidsettingswidget.h b/src/plugins/android/androidsettingswidget.h
index e657db3e6d..8e7aaf5b89 100644
--- a/src/plugins/android/androidsettingswidget.h
+++ b/src/plugins/android/androidsettingswidget.h
@@ -92,6 +92,9 @@ private slots:
void manageAVD();
void createKitToggled();
+ void checkGdbFinished();
+ void showGdbWarningDialog();
+
private:
enum Mode { Sdk = 1, Ndk = 2, Java = 4, All = Sdk | Ndk | Java };
enum State { NotSet = 0, Okay = 1, Error = 2 };
@@ -111,6 +114,8 @@ private:
AndroidConfig m_androidConfig;
AvdModel m_AVDModel;
QFutureWatcher<AndroidConfig::CreateAvdInfo> m_futureWatcher;
+ QFutureWatcher<QPair<QStringList, bool>> m_checkGdbWatcher;
+ QStringList m_gdbCheckPaths;
};
} // namespace Internal
diff --git a/src/plugins/android/androidsettingswidget.ui b/src/plugins/android/androidsettingswidget.ui
index 5b40861e16..4b4321f70a 100644
--- a/src/plugins/android/androidsettingswidget.ui
+++ b/src/plugins/android/androidsettingswidget.ui
@@ -6,45 +6,34 @@
<rect>
<x>0</x>
<y>0</y>
- <width>573</width>
- <height>429</height>
+ <width>843</width>
+ <height>625</height>
</rect>
</property>
<property name="windowTitle">
<string>Android Configuration</string>
</property>
- <layout class="QGridLayout" name="gridLayout" columnstretch="0,1,0,0">
- <item row="0" column="0">
- <widget class="QLabel" name="OpenJDKLocationLabel">
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="2" column="0">
+ <widget class="QLabel" name="SDKLocationLabel">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
- <string>JDK location:</string>
+ <string>Android SDK location:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
- <item row="0" column="1" colspan="2">
- <widget class="Utils::PathChooser" name="OpenJDKLocationPathChooser" native="true"/>
- </item>
- <item row="0" column="3">
- <widget class="QToolButton" name="downloadOpenJDKToolButton">
- <property name="toolTip">
- <string>Download JDK</string>
- </property>
- <property name="icon">
- <iconset resource="android.qrc">
- <normaloff>:/android/images/download.png</normaloff>:/android/images/download.png</iconset>
- </property>
- </widget>
+ <item row="10" column="1">
+ <widget class="Utils::PathChooser" name="AntLocationPathChooser" native="true"/>
</item>
- <item row="1" column="1" colspan="3">
+ <item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="jdkWarningIconLabel">
@@ -58,7 +47,7 @@
<string/>
</property>
<property name="pixmap">
- <pixmap>:/core/images/warning.png</pixmap>
+ <pixmap resource="../coreplugin/core.qrc">:/core/images/warning.png</pixmap>
</property>
</widget>
</item>
@@ -80,37 +69,7 @@
</item>
</layout>
</item>
- <item row="2" column="0">
- <widget class="QLabel" name="SDKLocationLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Android SDK location:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="2" column="1" colspan="2">
- <widget class="Utils::PathChooser" name="SDKLocationPathChooser" native="true"/>
- </item>
- <item row="2" column="3">
- <widget class="QToolButton" name="downloadSDKToolButton">
- <property name="toolTip">
- <string>Download Android SDK</string>
- </property>
- <property name="icon">
- <iconset resource="android.qrc">
- <normaloff>:/android/images/download.png</normaloff>:/android/images/download.png</iconset>
- </property>
- </widget>
- </item>
- <item row="3" column="1" colspan="3">
+ <item row="3" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="sdkWarningIconLabel">
@@ -146,29 +105,13 @@
</item>
</layout>
</item>
- <item row="4" column="0">
- <widget class="QLabel" name="NDKLocationLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Android NDK location:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="4" column="1" colspan="2">
- <widget class="Utils::PathChooser" name="NDKLocationPathChooser" native="true"/>
+ <item row="0" column="1">
+ <widget class="Utils::PathChooser" name="OpenJDKLocationPathChooser" native="true"/>
</item>
- <item row="4" column="3">
- <widget class="QToolButton" name="downloadNDKToolButton">
+ <item row="10" column="2">
+ <widget class="QToolButton" name="downloadAntToolButton">
<property name="toolTip">
- <string>Download Android NDK</string>
+ <string>Download Ant</string>
</property>
<property name="icon">
<iconset resource="android.qrc">
@@ -176,98 +119,7 @@
</property>
</widget>
</item>
- <item row="5" column="1" colspan="3">
- <layout class="QHBoxLayout" name="horizontalLayout_3">
- <property name="spacing">
- <number>2</number>
- </property>
- <item>
- <widget class="QLabel" name="ndkWarningIconLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string/>
- </property>
- <property name="pixmap">
- <pixmap resource="../coreplugin/core.qrc">:/core/images/error.png</pixmap>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="toolchainFoundLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="6" column="1" colspan="3">
- <widget class="QCheckBox" name="CreateKitCheckBox">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Automatically create kits for Android tool chains</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="7" column="1" colspan="3">
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <property name="spacing">
- <number>2</number>
- </property>
- <item>
- <widget class="QLabel" name="kitWarningIconLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string/>
- </property>
- <property name="pixmap">
- <pixmap resource="../coreplugin/core.qrc">:/core/images/warning.png</pixmap>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="kitWarningLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string/>
- </property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="8" column="0">
+ <item row="10" column="0">
<widget class="QLabel" name="AntLocationLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
@@ -283,13 +135,21 @@
</property>
</widget>
</item>
- <item row="8" column="1" colspan="2">
- <widget class="Utils::PathChooser" name="AntLocationPathChooser" native="true"/>
+ <item row="2" column="2">
+ <widget class="QToolButton" name="downloadSDKToolButton">
+ <property name="toolTip">
+ <string>Download Android SDK</string>
+ </property>
+ <property name="icon">
+ <iconset resource="android.qrc">
+ <normaloff>:/android/images/download.png</normaloff>:/android/images/download.png</iconset>
+ </property>
+ </widget>
</item>
- <item row="8" column="3">
- <widget class="QToolButton" name="downloadAntToolButton">
+ <item row="4" column="2">
+ <widget class="QToolButton" name="downloadNDKToolButton">
<property name="toolTip">
- <string>Download Ant</string>
+ <string>Download Android NDK</string>
</property>
<property name="icon">
<iconset resource="android.qrc">
@@ -297,7 +157,7 @@
</property>
</widget>
</item>
- <item row="9" column="0" colspan="4">
+ <item row="11" column="0" colspan="2">
<widget class="QFrame" name="AVDManagerFrame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
@@ -416,6 +276,182 @@
</layout>
</widget>
</item>
+ <item row="0" column="0">
+ <widget class="QLabel" name="OpenJDKLocationLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>JDK location:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="ndkWarningIconLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="pixmap">
+ <pixmap resource="../coreplugin/core.qrc">:/core/images/error.png</pixmap>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="toolchainFoundLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="NDKLocationLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Android NDK location:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <widget class="Utils::PathChooser" name="NDKLocationPathChooser" native="true"/>
+ </item>
+ <item row="0" column="2">
+ <widget class="QToolButton" name="downloadOpenJDKToolButton">
+ <property name="toolTip">
+ <string>Download JDK</string>
+ </property>
+ <property name="icon">
+ <iconset resource="android.qrc">
+ <normaloff>:/android/images/download.png</normaloff>:/android/images/download.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item row="8" column="1">
+ <widget class="QCheckBox" name="CreateKitCheckBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Automatically create kits for Android tool chains</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="9" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="kitWarningIconLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="pixmap">
+ <pixmap resource="../coreplugin/core.qrc">:/core/images/warning.png</pixmap>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="kitWarningLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="2" column="1">
+ <widget class="Utils::PathChooser" name="SDKLocationPathChooser" native="true"/>
+ </item>
+ <item row="5" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_6">
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="gdbWarningIconLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="pixmap">
+ <pixmap resource="../coreplugin/core.qrc">:/core/images/error.png</pixmap>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="gdbWarningLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&lt;a href=&quot;xx&quot;&gt;The GDB in the NDK appears to have broken python support.&lt;/a&gt;</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
</layout>
</widget>
<customwidgets>
@@ -428,6 +464,7 @@
</customwidgets>
<resources>
<include location="android.qrc"/>
+ <include location="../coreplugin/core.qrc"/>
</resources>
<connections>
<connection>
@@ -627,24 +664,64 @@
<signal>clicked()</signal>
<receiver>AndroidSettingsWidget</receiver>
<slot>openSDKDownloadUrl()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
</connection>
<connection>
<sender>downloadNDKToolButton</sender>
<signal>clicked()</signal>
<receiver>AndroidSettingsWidget</receiver>
<slot>openNDKDownloadUrl()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
</connection>
<connection>
<sender>downloadAntToolButton</sender>
<signal>clicked()</signal>
<receiver>AndroidSettingsWidget</receiver>
<slot>openAntDownloadUrl()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
</connection>
<connection>
<sender>downloadOpenJDKToolButton</sender>
<signal>clicked()</signal>
<receiver>AndroidSettingsWidget</receiver>
<slot>openOpenJDKDownloadUrl()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
</connection>
</connections>
<slots>
diff --git a/src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h b/src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h
index 16096a1494..06834ada17 100644
--- a/src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h
+++ b/src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h
@@ -43,6 +43,8 @@ namespace Internal {
class BareMetalDeviceConfigurationWizardSetupPage : public QWizardPage
{
+ Q_OBJECT
+
public:
explicit BareMetalDeviceConfigurationWizardSetupPage(QWidget *parent = 0);
diff --git a/src/plugins/baremetal/baremetalruncontrolfactory.cpp b/src/plugins/baremetal/baremetalruncontrolfactory.cpp
index b79cfb91f7..1e2e98dbfe 100644
--- a/src/plugins/baremetal/baremetalruncontrolfactory.cpp
+++ b/src/plugins/baremetal/baremetalruncontrolfactory.cpp
@@ -47,6 +47,8 @@
#include <utils/portlist.h>
#include <utils/qtcassert.h>
+#include <QApplication>
+
using namespace Analyzer;
using namespace Debugger;
using namespace ProjectExplorer;
@@ -134,6 +136,12 @@ RunControl *BareMetalRunControlFactory::create(RunConfiguration *runConfiguratio
return 0;
}
DebuggerStartParameters sp = startParameters(rc);
+ if (!QFile::exists(sp.executable)) {
+ *errorMessage = QApplication::translate("Core::Internal::ExecuteFilter",
+ "Could not find executable for \"%1\".")
+ .arg(sp.executable);
+ return 0;
+ }
return DebuggerPlugin::createDebugger(sp,runConfiguration,errorMessage);
}
diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp
index f06eed2911..8e859e73f0 100644
--- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp
@@ -606,6 +606,8 @@ bool CMakeProject::fromMap(const QVariantMap &map)
bool CMakeProject::setupTarget(Target *t)
{
t->updateDefaultBuildConfigurations();
+ if (t->buildConfigurations().isEmpty())
+ return false;
t->updateDefaultDeployConfigurations();
return true;
diff --git a/src/plugins/coreplugin/coreplugin.qbs b/src/plugins/coreplugin/coreplugin.qbs
index 07216acf86..a034cd0722 100644
--- a/src/plugins/coreplugin/coreplugin.qbs
+++ b/src/plugins/coreplugin/coreplugin.qbs
@@ -175,8 +175,6 @@ QtcPlugin {
name: "ProgressManager_mac"
condition: qbs.targetOS.contains("osx")
files: [
- "macfullscreen.h",
- "macfullscreen.mm",
"progressmanager/progressmanager_mac.mm",
]
}
diff --git a/src/plugins/coreplugin/find/findtoolbar.cpp b/src/plugins/coreplugin/find/findtoolbar.cpp
index 5fd065cc6d..2125de7109 100644
--- a/src/plugins/coreplugin/find/findtoolbar.cpp
+++ b/src/plugins/coreplugin/find/findtoolbar.cpp
@@ -349,8 +349,6 @@ void FindToolBar::updateToolBar()
bool replaceEnabled = enabled && m_currentDocumentFind->supportsReplace();
bool showAllControls = canShowAllControls(replaceEnabled);
- m_goToCurrentFindAction->setEnabled(enabled);
-
m_findNextAction->setEnabled(enabled);
m_findPreviousAction->setEnabled(enabled);
@@ -615,9 +613,11 @@ void FindToolBar::updateFlagMenus()
m_preserveCaseAction->setEnabled((supportedFlags & FindPreserveCase) && !regexp && replaceEnabled);
}
-bool FindToolBar::setFocusToCurrentFindSupport()
+void FindToolBar::setFocusToCurrentFindSupport()
{
- return m_currentDocumentFind->setFocusToCurrentFindSupport();
+ if (!m_currentDocumentFind->setFocusToCurrentFindSupport())
+ if (QWidget *w = focusWidget())
+ w->clearFocus();
}
void FindToolBar::hideAndResetFocus()
diff --git a/src/plugins/coreplugin/find/findtoolbar.h b/src/plugins/coreplugin/find/findtoolbar.h
index 1951c61e39..6990bc5c2b 100644
--- a/src/plugins/coreplugin/find/findtoolbar.h
+++ b/src/plugins/coreplugin/find/findtoolbar.h
@@ -119,7 +119,7 @@ private slots:
void adaptToCandidate();
- bool setFocusToCurrentFindSupport();
+ void setFocusToCurrentFindSupport();
protected:
bool focusNextPrevChild(bool next);
diff --git a/src/plugins/cppeditor/cppquickfix_test.cpp b/src/plugins/cppeditor/cppquickfix_test.cpp
index 60436efa44..88516ad276 100644
--- a/src/plugins/cppeditor/cppquickfix_test.cpp
+++ b/src/plugins/cppeditor/cppquickfix_test.cpp
@@ -325,6 +325,50 @@ void CppEditorPlugin::test_quickfix_data()
"}\n"
);
+ // Checks: Enum type in class is found.
+ QTest::newRow("CompleteSwitchCaseStatement_enumTypeInClass")
+ << CppQuickFixFactoryPtr(new CompleteSwitchCaseStatement) << _(
+ "struct C { enum EnumType { V1, V2 }; };\n"
+ "\n"
+ "void f(C::EnumType t) {\n"
+ " @switch (t) {\n"
+ " }\n"
+ "}\n"
+ ) << _(
+ "struct C { enum EnumType { V1, V2 }; };\n"
+ "\n"
+ "void f(C::EnumType t) {\n"
+ " switch (t) {\n"
+ " case C::V1:\n"
+ " break;\n"
+ " case C::V2:\n"
+ " break;\n"
+ " }\n"
+ "}\n"
+ );
+
+ // Checks: Enum type in namespace is found.
+ QTest::newRow("CompleteSwitchCaseStatement_enumTypeInNamespace")
+ << CppQuickFixFactoryPtr(new CompleteSwitchCaseStatement) << _(
+ "namespace N { enum EnumType { V1, V2 }; };\n"
+ "\n"
+ "void f(N::EnumType t) {\n"
+ " @switch (t) {\n"
+ " }\n"
+ "}\n"
+ ) << _(
+ "namespace N { enum EnumType { V1, V2 }; };\n"
+ "\n"
+ "void f(N::EnumType t) {\n"
+ " switch (t) {\n"
+ " case N::V1:\n"
+ " break;\n"
+ " case N::V2:\n"
+ " break;\n"
+ " }\n"
+ "}\n"
+ );
+
// Checks: The missing enum value is added.
QTest::newRow("CompleteSwitchCaseStatement_oneValueMissing")
<< CppQuickFixFactoryPtr(new CompleteSwitchCaseStatement) << _(
diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp
index 0276ec51db..fb88ef661b 100644
--- a/src/plugins/cppeditor/cppquickfixes.cpp
+++ b/src/plugins/cppeditor/cppquickfixes.cpp
@@ -2293,6 +2293,8 @@ Enum *findEnum(const QList<LookupItem> &results, const LookupContext &ctxt)
if (ClassOrNamespace *con = ctxt.lookupType(namedType->name(), result.scope())) {
const QList<Enum *> enums = con->unscopedEnums();
const Name *referenceName = namedType->name();
+ if (const QualifiedNameId *qualifiedName = referenceName->asQualifiedNameId())
+ referenceName = qualifiedName->name();
foreach (Enum *e, enums) {
if (const Name *candidateName = e->name()) {
if (candidateName->match(referenceName))
diff --git a/src/plugins/cpptools/cpplocatorfilter_test.cpp b/src/plugins/cpptools/cpplocatorfilter_test.cpp
index 1a6b2472f2..ad4da2fc5c 100644
--- a/src/plugins/cpptools/cpplocatorfilter_test.cpp
+++ b/src/plugins/cpptools/cpplocatorfilter_test.cpp
@@ -168,7 +168,9 @@ void CppToolsPlugin::test_cpplocatorfilters_CppLocatorFilter_data()
MyTestDataDir testDirectory(QLatin1String("testdata_basic"));
const QString testFile = testDirectory.file(QLatin1String("file1.cpp"));
+ const QString objTestFile = testDirectory.file(QLatin1String("file1.mm"));
const QString testFileShort = FileUtils::shortNativePath(FileName::fromString(testFile));
+ const QString objTestFileShort = FileUtils::shortNativePath(FileName::fromString(objTestFile));
QTest::newRow("CppFunctionsFilter")
<< testFile
@@ -247,6 +249,27 @@ void CppToolsPlugin::test_cpplocatorfilters_CppLocatorFilter_data()
<< ResultData(_("MyNamespace::myFunction"), _("(bool, int)"))
<< ResultData(_("myFunction"), _("(bool, int)"))
);
+
+ QTest::newRow("CppClassesFilter-ObjC")
+ << objTestFile
+ << cppClassesFilter
+ << _("M")
+ << (QList<ResultData>()
+ << ResultData(_("MyClass"), objTestFileShort)
+ << ResultData(_("MyClass"), objTestFileShort)
+ << ResultData(_("MyClass"), objTestFileShort)
+ << ResultData(_("MyProtocol"), objTestFileShort)
+ );
+
+ QTest::newRow("CppFunctionsFilter-ObjC")
+ << objTestFile
+ << cppFunctionsFilter
+ << _("M")
+ << (QList<ResultData>()
+ << ResultData(_("anotherMethod"), _("MyClass"))
+ << ResultData(_("anotherMethod:"), _("MyClass"))
+ << ResultData(_("someMethod"), _("MyClass"))
+ );
}
void CppToolsPlugin::test_cpplocatorfilters_CppCurrentDocumentFilter()
diff --git a/src/plugins/cpptools/cppmodelmanager_test.cpp b/src/plugins/cpptools/cppmodelmanager_test.cpp
index 3ca3e3d49d..6f7a6f1fa0 100644
--- a/src/plugins/cpptools/cppmodelmanager_test.cpp
+++ b/src/plugins/cpptools/cppmodelmanager_test.cpp
@@ -37,6 +37,8 @@
#include <coreplugin/testdatadir.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/session.h>
+
+#include <cplusplus/LookupContext.h>
#include <utils/hostosinfo.h>
#include <QDebug>
@@ -873,7 +875,7 @@ void CppToolsPlugin::test_modelmanager_defines_per_project()
}
}
-void CppToolsPlugin::test_modelmanager_defines_per_project_pch()
+void CppToolsPlugin::test_modelmanager_precompiled_headers()
{
ModelManagerTestHelper helper;
@@ -922,14 +924,16 @@ void CppToolsPlugin::test_modelmanager_defines_per_project_pch()
struct Data {
QString firstDeclarationName;
+ QString firstClassInPchFile;
QString fileName;
} d[] = {
- { _("one"), main1File },
- { _("two"), main2File }
+ { _("one"), _("ClassInPch1"), main1File },
+ { _("two"), _("ClassInPch2"), main2File }
};
const int size = sizeof(d) / sizeof(d[0]);
for (int i = 0; i < size; ++i) {
const QString firstDeclarationName = d[i].firstDeclarationName;
+ const QByteArray firstClassInPchFile = d[i].firstClassInPchFile.toUtf8();
const QString fileName = d[i].fileName;
Core::IEditor *editor = Core::EditorManager::openEditor(fileName);
@@ -943,11 +947,22 @@ void CppToolsPlugin::test_modelmanager_defines_per_project_pch()
while (sup->lastSemanticInfoDocument().isNull())
QCoreApplication::processEvents();
- sup->snapshotUpdater()->setUsePrecompiledHeaders(true);
- sup->snapshotUpdater()->update(mm->workingCopy());
-
- Document::Ptr doc = mm->document(fileName);
- QCOMPARE(nameOfFirstDeclaration(doc), firstDeclarationName);
+ const QSharedPointer<SnapshotUpdater> updater = sup->snapshotUpdater();
+ updater->setUsePrecompiledHeaders(true);
+ updater->update(mm->workingCopy());
+
+ // Check if defines from pch are considered
+ Document::Ptr document = mm->document(fileName);
+ QCOMPARE(nameOfFirstDeclaration(document), firstDeclarationName);
+
+ // Check if declarations from pch are considered
+ CPlusPlus::LookupContext context(document, updater->snapshot());
+ const CPlusPlus::Identifier *identifier
+ = document->control()->identifier(firstClassInPchFile.data());
+ const QList<CPlusPlus::LookupItem> results = context.lookup(identifier,
+ document->globalNamespace());
+ QVERIFY(!results.isEmpty());
+ QVERIFY(results.first().declaration()->type()->asClassType());
}
}
diff --git a/src/plugins/cpptools/cppsnapshotupdater.cpp b/src/plugins/cpptools/cppsnapshotupdater.cpp
index 60c8d3e414..a6900d3d2c 100644
--- a/src/plugins/cpptools/cppsnapshotupdater.cpp
+++ b/src/plugins/cpptools/cppsnapshotupdater.cpp
@@ -177,7 +177,8 @@ void SnapshotUpdater::update(CppModelManager::WorkingCopy workingCopy)
}
if (!m_editorDefines.isEmpty())
sourceProcessor.run(editorDefinesFileName);
- sourceProcessor.run(m_fileInEditor);
+ sourceProcessor.run(m_fileInEditor, m_usePrecompiledHeaders ? m_precompiledHeaders
+ : QStringList());
m_snapshot = sourceProcessor.snapshot();
Snapshot newSnapshot = m_snapshot.simplified(document());
diff --git a/src/plugins/cpptools/cppsourceprocessor.cpp b/src/plugins/cpptools/cppsourceprocessor.cpp
index 47986331b3..33b2a0896e 100644
--- a/src/plugins/cpptools/cppsourceprocessor.cpp
+++ b/src/plugins/cpptools/cppsourceprocessor.cpp
@@ -148,9 +148,10 @@ void CppSourceProcessor::addFrameworkPath(const ProjectPart::HeaderPath &framewo
void CppSourceProcessor::setTodo(const QStringList &files)
{ m_todo = QSet<QString>::fromList(files); }
-void CppSourceProcessor::run(const QString &fileName)
+void CppSourceProcessor::run(const QString &fileName,
+ const QStringList &initialIncludes)
{
- sourceNeeded(0, fileName, IncludeGlobal);
+ sourceNeeded(0, fileName, IncludeGlobal, initialIncludes);
}
void CppSourceProcessor::removeFromCache(const QString &fileName)
@@ -377,7 +378,8 @@ void CppSourceProcessor::stopSkippingBlocks(unsigned utf16charsOffset)
m_currentDoc->stopSkippingBlocks(utf16charsOffset);
}
-void CppSourceProcessor::sourceNeeded(unsigned line, const QString &fileName, IncludeType type)
+void CppSourceProcessor::sourceNeeded(unsigned line, const QString &fileName, IncludeType type,
+ const QStringList &initialIncludes)
{
if (fileName.isEmpty())
return;
@@ -417,6 +419,11 @@ void CppSourceProcessor::sourceNeeded(unsigned line, const QString &fileName, In
Document::Ptr document = Document::create(absoluteFileName);
document->setRevision(m_revision);
document->setEditorRevision(editorRevision);
+ foreach (const QString &include, initialIncludes) {
+ m_included.insert(include);
+ Document::Include inc(include, include, 0, IncludeLocal);
+ document->addIncludeFile(inc);
+ }
const QFileInfo info(absoluteFileName);
if (info.exists())
document->setLastModified(info.lastModified());
diff --git a/src/plugins/cpptools/cppsourceprocessor.h b/src/plugins/cpptools/cppsourceprocessor.h
index e10d143816..e51315c32c 100644
--- a/src/plugins/cpptools/cppsourceprocessor.h
+++ b/src/plugins/cpptools/cppsourceprocessor.h
@@ -43,7 +43,7 @@ public:
void setHeaderPaths(const ProjectPart::HeaderPaths &headerPaths);
void setTodo(const QStringList &files);
- void run(const QString &fileName);
+ void run(const QString &fileName, const QStringList &initialIncludes = QStringList());
void removeFromCache(const QString &fileName);
void resetEnvironment();
@@ -80,7 +80,8 @@ private:
void markAsIncludeGuard(const QByteArray &macroName) QTC_OVERRIDE;
void startSkippingBlocks(unsigned utf16charsOffset) QTC_OVERRIDE;
void stopSkippingBlocks(unsigned utf16charsOffset) QTC_OVERRIDE;
- void sourceNeeded(unsigned line, const QString &fileName, IncludeType type) QTC_OVERRIDE;
+ void sourceNeeded(unsigned line, const QString &fileName, IncludeType type,
+ const QStringList &initialIncludes) QTC_OVERRIDE;
private:
CPlusPlus::Snapshot m_snapshot;
diff --git a/src/plugins/cpptools/cpptoolsplugin.cpp b/src/plugins/cpptools/cpptoolsplugin.cpp
index 58227e27b2..f2c8e455c4 100644
--- a/src/plugins/cpptools/cpptoolsplugin.cpp
+++ b/src/plugins/cpptools/cpptoolsplugin.cpp
@@ -429,19 +429,20 @@ QString correspondingHeaderOrSource(const QString &fileName, bool *wasHeader)
currentProject);
if (!path.isEmpty())
return path;
- }
// Find files in other projects
- CppModelManager *modelManager = CppModelManager::instance();
- QList<CppModelManagerInterface::ProjectInfo> projectInfos = modelManager->projectInfos();
- foreach (const CppModelManagerInterface::ProjectInfo &projectInfo, projectInfos) {
- const ProjectExplorer::Project *project = projectInfo.project().data();
- if (project == currentProject)
- continue; // We have already checked the current project.
-
- const QString path = correspondingHeaderOrSourceInProject(fi, candidateFileNames, project);
- if (!path.isEmpty())
- return path;
+ } else {
+ CppModelManager *modelManager = CppModelManager::instance();
+ QList<CppModelManagerInterface::ProjectInfo> projectInfos = modelManager->projectInfos();
+ foreach (const CppModelManagerInterface::ProjectInfo &projectInfo, projectInfos) {
+ const ProjectExplorer::Project *project = projectInfo.project().data();
+ if (project == currentProject)
+ continue; // We have already checked the current project.
+
+ const QString path = correspondingHeaderOrSourceInProject(fi, candidateFileNames, project);
+ if (!path.isEmpty())
+ return path;
+ }
}
return QString();
diff --git a/src/plugins/cpptools/cpptoolsplugin.h b/src/plugins/cpptools/cpptoolsplugin.h
index 74fccf7179..27de8d0ba4 100644
--- a/src/plugins/cpptools/cpptoolsplugin.h
+++ b/src/plugins/cpptools/cpptoolsplugin.h
@@ -150,8 +150,8 @@ private slots:
void test_modelmanager_gc_if_last_cppeditor_closed();
void test_modelmanager_dont_gc_opened_files();
void test_modelmanager_defines_per_project();
- void test_modelmanager_defines_per_project_pch();
void test_modelmanager_defines_per_editor();
+ void test_modelmanager_precompiled_headers();
void test_cpplocatorfilters_CppLocatorFilter();
void test_cpplocatorfilters_CppLocatorFilter_data();
diff --git a/src/plugins/cpptools/searchsymbols.cpp b/src/plugins/cpptools/searchsymbols.cpp
index 0fe83a1a41..e142d057aa 100644
--- a/src/plugins/cpptools/searchsymbols.cpp
+++ b/src/plugins/cpptools/searchsymbols.cpp
@@ -105,11 +105,7 @@ bool SearchSymbols::visit(Enum *symbol)
bool SearchSymbols::visit(Function *symbol)
{
- if (!(symbolsToSearchFor & SymbolSearcher::Functions) || !symbol->name())
- return false;
- QString name = overview.prettyName(symbol->name());
- QString type = overview.prettyType(symbol->type());
- addChildItem(name, type, _scope, IndexItem::Function, symbol);
+ processFunction(symbol);
return false;
}
@@ -130,10 +126,12 @@ bool SearchSymbols::visit(Declaration *symbol)
// if we're searching for functions, still allow signal declarations to show up.
if (symbolsToSearchFor & SymbolSearcher::Functions) {
Function *funTy = symbol->type()->asFunctionType();
- if (!funTy)
- return false;
- if (!funTy->isSignal())
+ if (!funTy) {
+ if (!symbol->type()->asObjCMethodType())
+ return false;
+ } else if (!funTy->isSignal()) {
return false;
+ }
} else {
return false;
}
@@ -153,19 +151,7 @@ bool SearchSymbols::visit(Declaration *symbol)
bool SearchSymbols::visit(Class *symbol)
{
- QString name = overview.prettyName(symbol->name());
-
- IndexItem::Ptr newParent;
- if (symbolsToSearchFor & SymbolSearcher::Classes)
- newParent = addChildItem(name, QString(), _scope, IndexItem::Class, symbol);
- if (!newParent)
- newParent = _parent;
- ScopedIndexItemPtr parentRaii(_parent, newParent);
-
- QString newScope = scopedSymbolName(name, symbol);
- ScopedScope scopeRaii(_scope, newScope);
- for (unsigned i = 0, ei = symbol->memberCount(); i != ei; ++i)
- accept(symbol->memberAt(i));
+ processClass(symbol);
return false;
}
@@ -225,8 +211,10 @@ bool SearchSymbols::visit(CPlusPlus::ObjCBaseProtocol *)
return false;
}
-bool SearchSymbols::visit(CPlusPlus::ObjCClass *)
+bool SearchSymbols::visit(CPlusPlus::ObjCClass *symbol)
{
+ processClass(symbol);
+
return false;
}
@@ -235,8 +223,10 @@ bool SearchSymbols::visit(CPlusPlus::ObjCForwardClassDeclaration *)
return false;
}
-bool SearchSymbols::visit(CPlusPlus::ObjCProtocol *)
+bool SearchSymbols::visit(CPlusPlus::ObjCProtocol *symbol)
{
+ processClass(symbol);
+
return false;
}
@@ -245,13 +235,15 @@ bool SearchSymbols::visit(CPlusPlus::ObjCForwardProtocolDeclaration *)
return false;
}
-bool SearchSymbols::visit(CPlusPlus::ObjCMethod *)
+bool SearchSymbols::visit(CPlusPlus::ObjCMethod *symbol)
{
+ processFunction(symbol);
return false;
}
-bool SearchSymbols::visit(CPlusPlus::ObjCPropertyDeclaration *)
+bool SearchSymbols::visit(CPlusPlus::ObjCPropertyDeclaration *symbol)
{
+ processFunction(symbol);
return false;
}
@@ -315,3 +307,31 @@ IndexItem::Ptr SearchSymbols::addChildItem(const QString &symbolName, const QStr
_parent->addChild(newItem);
return newItem;
}
+
+template<class T>
+void SearchSymbols::processClass(T *clazz)
+{
+ QString name = overview.prettyName(clazz->name());
+
+ IndexItem::Ptr newParent;
+ if (symbolsToSearchFor & SymbolSearcher::Classes)
+ newParent = addChildItem(name, QString(), _scope, IndexItem::Class, clazz);
+ if (!newParent)
+ newParent = _parent;
+ ScopedIndexItemPtr parentRaii(_parent, newParent);
+
+ QString newScope = scopedSymbolName(name, clazz);
+ ScopedScope scopeRaii(_scope, newScope);
+ for (unsigned i = 0, ei = clazz->memberCount(); i != ei; ++i)
+ accept(clazz->memberAt(i));
+}
+
+template<class T>
+void SearchSymbols::processFunction(T *func)
+{
+ if (!(symbolsToSearchFor & SymbolSearcher::Functions) || !func->name())
+ return;
+ QString name = overview.prettyName(func->name());
+ QString type = overview.prettyType(func->type());
+ addChildItem(name, type, _scope, IndexItem::Function, func);
+}
diff --git a/src/plugins/cpptools/searchsymbols.h b/src/plugins/cpptools/searchsymbols.h
index c4306bfb96..8aad1d701a 100644
--- a/src/plugins/cpptools/searchsymbols.h
+++ b/src/plugins/cpptools/searchsymbols.h
@@ -85,12 +85,12 @@ protected:
// Objective-C
virtual bool visit(CPlusPlus::ObjCBaseClass *);
virtual bool visit(CPlusPlus::ObjCBaseProtocol *);
- virtual bool visit(CPlusPlus::ObjCClass *);
+ virtual bool visit(CPlusPlus::ObjCClass *symbol);
virtual bool visit(CPlusPlus::ObjCForwardClassDeclaration *);
- virtual bool visit(CPlusPlus::ObjCProtocol *);
+ virtual bool visit(CPlusPlus::ObjCProtocol *symbol);
virtual bool visit(CPlusPlus::ObjCForwardProtocolDeclaration *);
- virtual bool visit(CPlusPlus::ObjCMethod *);
- virtual bool visit(CPlusPlus::ObjCPropertyDeclaration *);
+ virtual bool visit(CPlusPlus::ObjCMethod *symbol);
+ virtual bool visit(CPlusPlus::ObjCPropertyDeclaration *symbol);
QString scopedSymbolName(const QString &symbolName, const CPlusPlus::Symbol *symbol) const;
QString scopedSymbolName(const CPlusPlus::Symbol *symbol) const;
@@ -100,6 +100,10 @@ protected:
CPlusPlus::Symbol *symbol);
private:
+ template<class T> void processClass(T *clazz);
+ template<class T> void processFunction(T *func);
+
+private:
QString findOrInsert(const QString &s)
{ return strings.insert(s); }
diff --git a/src/plugins/debugger/commonoptionspage.cpp b/src/plugins/debugger/commonoptionspage.cpp
index 82a488cf8f..87f0229de1 100644
--- a/src/plugins/debugger/commonoptionspage.cpp
+++ b/src/plugins/debugger/commonoptionspage.cpp
@@ -55,6 +55,8 @@ namespace Internal {
class CommonOptionsPageWidget : public QWidget
{
+ Q_OBJECT
+
public:
explicit CommonOptionsPageWidget(const QSharedPointer<Utils::SavedActionSet> &group);
@@ -395,7 +397,7 @@ QWidget *LocalsAndExpressionsOptionsPage::widget()
layout1->addRow(checkBoxShowQtNamespace);
layout1->addItem(new QSpacerItem(10, 10));
layout1->addRow(tr("Maximum string length:"), spinBoxMaximalStringLength);
- layout1->addRow(tr("Displayh string length:"), spinBoxDisplayStringLimit);
+ layout1->addRow(tr("Display string length:"), spinBoxDisplayStringLimit);
auto lowerLayout = new QHBoxLayout;
lowerLayout->addLayout(layout1);
@@ -429,3 +431,5 @@ QWidget *LocalsAndExpressionsOptionsPage::widget()
} // namespace Internal
} // namespace Debugger
+
+#include "commonoptionspage.moc"
diff --git a/src/plugins/debugger/commonoptionspage.h b/src/plugins/debugger/commonoptionspage.h
index ea87caa9c2..e444d22f8f 100644
--- a/src/plugins/debugger/commonoptionspage.h
+++ b/src/plugins/debugger/commonoptionspage.h
@@ -86,6 +86,8 @@ private:
class LocalsAndExpressionsOptionsPage : public Core::IOptionsPage
{
+ Q_OBJECT
+
public:
LocalsAndExpressionsOptionsPage();
diff --git a/src/plugins/debugger/debuggeritem.cpp b/src/plugins/debugger/debuggeritem.cpp
index 8fbfcf53ff..f95d2e3f52 100644
--- a/src/plugins/debugger/debuggeritem.cpp
+++ b/src/plugins/debugger/debuggeritem.cpp
@@ -33,6 +33,7 @@
#include <projectexplorer/abi.h>
#include <utils/fileutils.h>
+#include <utils/hostosinfo.h>
#include <utils/qtcassert.h>
#include <QProcess>
@@ -228,7 +229,7 @@ void DebuggerItem::setAbi(const Abi &abi)
m_abis.append(abi);
}
-static DebuggerItem::MatchLevel matchSingle(const Abi &debuggerAbi, const Abi &targetAbi)
+static DebuggerItem::MatchLevel matchSingle(const Abi &debuggerAbi, const Abi &targetAbi, DebuggerEngineType engineType)
{
if (debuggerAbi.architecture() != Abi::UnknownArchitecture
&& debuggerAbi.architecture() != targetAbi.architecture())
@@ -254,14 +255,22 @@ static DebuggerItem::MatchLevel matchSingle(const Abi &debuggerAbi, const Abi &t
if (debuggerAbi.wordWidth() != 0 && debuggerAbi.wordWidth() != targetAbi.wordWidth())
return DebuggerItem::DoesNotMatch;
- return DebuggerItem::MatchesPerfectly;
+ // We have at least 'Matches well' now. Mark the combinations we really like.
+ if (HostOsInfo::isWindowsHost() && engineType == GdbEngineType && targetAbi.osFlavor() == Abi::WindowsMSysFlavor)
+ return DebuggerItem::MatchesPerfectly;
+ if (HostOsInfo::isLinuxHost() && engineType == GdbEngineType && targetAbi.os() == Abi::LinuxOS)
+ return DebuggerItem::MatchesPerfectly;
+ if (HostOsInfo::isMacHost() && engineType == LldbEngineType && targetAbi.os() == Abi::MacOS)
+ return DebuggerItem::MatchesPerfectly;
+
+ return DebuggerItem::MatchesWell;
}
DebuggerItem::MatchLevel DebuggerItem::matchTarget(const Abi &targetAbi) const
{
MatchLevel bestMatch = DoesNotMatch;
foreach (const Abi &debuggerAbi, m_abis) {
- MatchLevel currentMatch = matchSingle(debuggerAbi, targetAbi);
+ MatchLevel currentMatch = matchSingle(debuggerAbi, targetAbi, m_engineType);
if (currentMatch > bestMatch)
bestMatch = currentMatch;
}
@@ -302,11 +311,11 @@ void Debugger::DebuggerPlugin::testDebuggerMatching_data()
QTest::newRow("Fuzzy match 1")
<< (QStringList() << QLatin1String("unknown-unknown-unknown-unknown-0bit"))
<< QString::fromLatin1("x86-linux-generic-elf-32bit")
- << int(DebuggerItem::MatchesPerfectly); // Is this the expected behavior?
+ << int(DebuggerItem::MatchesWell); // Is this the expected behavior?
QTest::newRow("Fuzzy match 2")
<< (QStringList() << QLatin1String("unknown-unknown-unknown-unknown-0bit"))
<< QString::fromLatin1("arm-windows-msys-pe-64bit")
- << int(DebuggerItem::MatchesPerfectly); // Is this the expected behavior?
+ << int(DebuggerItem::MatchesWell); // Is this the expected behavior?
QTest::newRow("Architecture mismatch")
<< (QStringList() << QLatin1String("x86-linux-generic-elf-32bit"))
@@ -324,7 +333,7 @@ void Debugger::DebuggerPlugin::testDebuggerMatching_data()
QTest::newRow("Linux perfect match")
<< (QStringList() << QLatin1String("x86-linux-generic-elf-32bit"))
<< QString::fromLatin1("x86-linux-generic-elf-32bit")
- << int(DebuggerItem::MatchesPerfectly);
+ << int(DebuggerItem::MatchesWell);
QTest::newRow("Linux match")
<< (QStringList() << QLatin1String("x86-linux-generic-elf-64bit"))
<< QString::fromLatin1("x86-linux-generic-elf-32bit")
@@ -333,11 +342,11 @@ void Debugger::DebuggerPlugin::testDebuggerMatching_data()
QTest::newRow("Windows perfect match 1")
<< (QStringList() << QLatin1String("x86-windows-msvc2013-pe-64bit"))
<< QString::fromLatin1("x86-windows-msvc2013-pe-64bit")
- << int(DebuggerItem::MatchesPerfectly);
+ << int(DebuggerItem::MatchesWell);
QTest::newRow("Windows perfect match 2")
<< (QStringList() << QLatin1String("x86-windows-msvc2013-pe-64bit"))
<< QString::fromLatin1("x86-windows-msvc2012-pe-64bit")
- << int(DebuggerItem::MatchesPerfectly);
+ << int(DebuggerItem::MatchesWell);
QTest::newRow("Windows match 1")
<< (QStringList() << QLatin1String("x86-windows-msvc2013-pe-64bit"))
<< QString::fromLatin1("x86-windows-msvc2013-pe-32bit")
@@ -376,6 +385,8 @@ void Debugger::DebuggerPlugin::testDebuggerMatching()
item.setAbis(debuggerAbis);
DebuggerItem::MatchLevel level = item.matchTarget(Abi(target));
+ if (level == DebuggerItem::MatchesPerfectly)
+ level = DebuggerItem::MatchesWell;
QCOMPARE(expectedLevel, level);
}
diff --git a/src/plugins/debugger/debuggeritem.h b/src/plugins/debugger/debuggeritem.h
index a9910b0ad5..d73685d6fe 100644
--- a/src/plugins/debugger/debuggeritem.h
+++ b/src/plugins/debugger/debuggeritem.h
@@ -86,7 +86,7 @@ public:
void setAbis(const QList<ProjectExplorer::Abi> &abis);
void setAbi(const ProjectExplorer::Abi &abi);
- enum MatchLevel { DoesNotMatch, MatchesSomewhat, MatchesPerfectly };
+ enum MatchLevel { DoesNotMatch, MatchesSomewhat, MatchesWell, MatchesPerfectly };
MatchLevel matchTarget(const ProjectExplorer::Abi &targetAbi) const;
QStringList abiNames() const;
diff --git a/src/plugins/debugger/debuggerkitinformation.cpp b/src/plugins/debugger/debuggerkitinformation.cpp
index 3ffc8195a4..2013a478c8 100644
--- a/src/plugins/debugger/debuggerkitinformation.cpp
+++ b/src/plugins/debugger/debuggerkitinformation.cpp
@@ -126,6 +126,8 @@ void DebuggerKitInformation::setup(Kit *k)
goodItem = &item;
if (detection == DetectedAutomatically && item.engineType() == autoEngine)
goodItem = &item;
+ if (item.isAutoDetected())
+ goodItem = &item;
if (goodItem) {
DebuggerItem::MatchLevel level = goodItem->matchTarget(toolChainAbi);
diff --git a/src/plugins/debugger/debuggerruncontrolfactory.h b/src/plugins/debugger/debuggerruncontrolfactory.h
index 4b6ab2be34..52933f09b8 100644
--- a/src/plugins/debugger/debuggerruncontrolfactory.h
+++ b/src/plugins/debugger/debuggerruncontrolfactory.h
@@ -59,9 +59,7 @@ public:
const DebuggerStartParameters &sp,
QString *errorMessage);
- static DebuggerRunControl *createAndScheduleRun(
- const DebuggerStartParameters &sp,
- ProjectExplorer::RunConfiguration *runConfiguration = 0);
+ static DebuggerRunControl *createAndScheduleRun(const DebuggerStartParameters &sp);
static DebuggerRunControl *doCreate(const DebuggerStartParameters &sp,
ProjectExplorer::RunConfiguration *rc, QString *errorMessage);
diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp
index d9428a426c..70aa7c4e9b 100644
--- a/src/plugins/debugger/debuggerrunner.cpp
+++ b/src/plugins/debugger/debuggerrunner.cpp
@@ -310,8 +310,6 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu
QTC_ASSERT(rc, return sp);
EnvironmentAspect *environment = rc->extraAspect<ProjectExplorer::EnvironmentAspect>();
QTC_ASSERT(environment, return sp);
- if (!rc->ensureConfigured(errorMessage))
- return sp;
Target *target = runConfiguration->target();
Kit *kit = target ? target->kit() : KitManager::defaultKit();
@@ -454,14 +452,10 @@ IRunConfigurationAspect *DebuggerRunControlFactory::createRunConfigurationAspect
return new DebuggerRunConfigurationAspect(rc);
}
-DebuggerRunControl *DebuggerRunControlFactory::createAndScheduleRun
- (const DebuggerStartParameters &sp, RunConfiguration *runConfiguration)
+DebuggerRunControl *DebuggerRunControlFactory::createAndScheduleRun(const DebuggerStartParameters &sp)
{
QString errorMessage;
- if (runConfiguration && !runConfiguration->ensureConfigured(&errorMessage))
- ProjectExplorer::ProjectExplorerPlugin::showRunErrorMessage(errorMessage);
-
- DebuggerRunControl *rc = doCreate(sp, runConfiguration, &errorMessage);
+ DebuggerRunControl *rc = doCreate(sp, 0, &errorMessage);
if (!rc) {
ProjectExplorer::ProjectExplorerPlugin::showRunErrorMessage(errorMessage);
return 0;
diff --git a/src/plugins/debugger/disassembleragent.cpp b/src/plugins/debugger/disassembleragent.cpp
index 537ccf6737..3410b83e50 100644
--- a/src/plugins/debugger/disassembleragent.cpp
+++ b/src/plugins/debugger/disassembleragent.cpp
@@ -107,8 +107,6 @@ public:
QList<TextMark *> breakpointMarks;
QList<CacheEntry> cache;
QString mimeType;
- bool tryMixedInitialized;
- bool tryMixed;
bool resetLocationScheduled;
};
@@ -116,8 +114,6 @@ DisassemblerAgentPrivate::DisassemblerAgentPrivate()
: document(0),
locationMark(QString(), 0),
mimeType(_("text/x-qtcreator-generic-asm")),
- tryMixedInitialized(false),
- tryMixed(true),
resetLocationScheduled(false)
{
locationMark.setIcon(debuggerCore()->locationMarkIcon());
@@ -201,20 +197,6 @@ const Location &DisassemblerAgent::location() const
return d->location;
}
-bool DisassemblerAgent::isMixed() const
-{
- if (!d->tryMixedInitialized) {
- if (d->engine->startParameters().toolChainAbi.os() == ProjectExplorer::Abi::MacOS)
- d->tryMixed = false;
- d->tryMixedInitialized = true;
- }
-
- return d->tryMixed
- && d->location.lineNumber() > 0
- && !d->location.functionName().isEmpty()
- && d->location.functionName() != _("??");
-}
-
void DisassemblerAgent::reload()
{
d->cache.clear();
@@ -228,7 +210,7 @@ void DisassemblerAgent::setLocation(const Location &loc)
if (index != -1) {
// Refresh when not displaying a function and there is not sufficient
// context left past the address.
- if (!isMixed() && d->cache.at(index).first.endAddress - loc.address() < 24) {
+ if (d->cache.at(index).first.endAddress - loc.address() < 24) {
index = -1;
d->cache.removeAt(index);
}
@@ -314,6 +296,8 @@ void DisassemblerAgent::setContentsToDocument(const DisassemblerLines &contents)
d->document->setProperty(Debugger::Constants::OPENED_BY_DEBUGGER, true);
d->document->setProperty(Debugger::Constants::OPENED_WITH_DISASSEMBLY, true);
d->configureMimeType();
+ } else {
+ EditorManager::activateEditorForDocument(d->document);
}
d->document->setPlainText(contents.toString());
diff --git a/src/plugins/debugger/disassembleragent.h b/src/plugins/debugger/disassembleragent.h
index 414de5941f..1a2f8e600c 100644
--- a/src/plugins/debugger/disassembleragent.h
+++ b/src/plugins/debugger/disassembleragent.h
@@ -65,7 +65,6 @@ public:
quint64 address() const;
bool contentsCoversAddress(const QString &contents) const;
void cleanup();
- bool isMixed() const;
// Force reload, e.g. after changing the output flavour.
void reload();
diff --git a/src/plugins/debugger/loadcoredialog.cpp b/src/plugins/debugger/loadcoredialog.cpp
index 05c3ac1099..ee5c19980e 100644
--- a/src/plugins/debugger/loadcoredialog.cpp
+++ b/src/plugins/debugger/loadcoredialog.cpp
@@ -363,7 +363,7 @@ bool AttachCoreDialog::useLocalCoreFile() const
void AttachCoreDialog::coreFileChanged(const QString &core)
{
- if (!Utils::HostOsInfo::isWindowsHost()) {
+ if (!Utils::HostOsInfo::isWindowsHost() && QFile::exists(core)) {
Kit *k = d->kitChooser->currentKit();
QTC_ASSERT(k, return);
FileName cmd = DebuggerKitInformation::debuggerCommand(k);
diff --git a/src/plugins/diffeditor/diffeditorplugin.cpp b/src/plugins/diffeditor/diffeditorplugin.cpp
index 699b4716c1..6c6346998a 100644
--- a/src/plugins/diffeditor/diffeditorplugin.cpp
+++ b/src/plugins/diffeditor/diffeditorplugin.cpp
@@ -224,6 +224,8 @@ void DiffEditorPlugin::diff()
Q_DECLARE_METATYPE(DiffEditor::ChunkData)
Q_DECLARE_METATYPE(QList<DiffEditor::FileData>)
+static inline QString _(const char *string) { return QString::fromLatin1(string); }
+
void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data()
{
QTest::addColumn<ChunkData>("sourceChunk");
@@ -232,19 +234,17 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data()
QTest::addColumn<bool>("lastChunk");
QTest::addColumn<QString>("patchText");
- const QString fileName = QLatin1String("a.txt");
- const QString header = QLatin1String("--- ") + fileName
- + QLatin1String("\n+++ ") + fileName + QLatin1String("\n");
+ const QString fileName = _("a.txt");
+ const QString header = _("--- ") + fileName + _("\n+++ ") + fileName + _("\n");
QList<RowData> rows;
- rows << RowData(TextLineData(QLatin1String("ABCD")),
- TextLineData(TextLineData::Separator));
- rows << RowData(TextLineData(QLatin1String("EFGH")));
+ rows << RowData(_("ABCD"), TextLineData::Separator);
+ rows << RowData(_("EFGH"));
ChunkData chunk;
chunk.rows = rows;
- QString patchText = header + QLatin1String("@@ -1,2 +1,1 @@\n"
- "-ABCD\n"
- " EFGH\n");
+ QString patchText = header + _("@@ -1,2 +1,1 @@\n"
+ "-ABCD\n"
+ " EFGH\n");
QTest::newRow("Simple not a last chunk") << chunk
<< fileName
<< fileName
@@ -254,10 +254,10 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data()
///////////
// chunk the same here
- patchText = header + QLatin1String("@@ -1,2 +1,1 @@\n"
- "-ABCD\n"
- " EFGH\n"
- "\\ No newline at end of file\n");
+ patchText = header + _("@@ -1,2 +1,1 @@\n"
+ "-ABCD\n"
+ " EFGH\n"
+ "\\ No newline at end of file\n");
QTest::newRow("Simple last chunk") << chunk
<< fileName
@@ -268,14 +268,13 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data()
///////////
rows.clear();
- rows << RowData(TextLineData(QLatin1String("ABCD")));
- rows << RowData(TextLineData(QLatin1String("")),
- TextLineData(TextLineData::Separator));
+ rows << RowData(_("ABCD"));
+ rows << RowData(_(""), TextLineData::Separator);
chunk.rows = rows;
- patchText = header + QLatin1String("@@ -1,1 +1,1 @@\n"
- "-ABCD\n"
- "+ABCD\n"
- "\\ No newline at end of file\n");
+ patchText = header + _("@@ -1,1 +1,1 @@\n"
+ "-ABCD\n"
+ "+ABCD\n"
+ "\\ No newline at end of file\n");
QTest::newRow("EOL in last line removed") << chunk
<< fileName
@@ -286,9 +285,9 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data()
///////////
// chunk the same here
- patchText = header + QLatin1String("@@ -1,2 +1,1 @@\n"
- " ABCD\n"
- "-\n");
+ patchText = header + _("@@ -1,2 +1,1 @@\n"
+ " ABCD\n"
+ "-\n");
QTest::newRow("Last empty line removed") << chunk
<< fileName
@@ -299,14 +298,13 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data()
///////////
rows.clear();
- rows << RowData(TextLineData(QLatin1String("ABCD")));
- rows << RowData(TextLineData(TextLineData::Separator),
- TextLineData(QLatin1String("")));
+ rows << RowData(_("ABCD"));
+ rows << RowData(TextLineData::Separator, _(""));
chunk.rows = rows;
- patchText = header + QLatin1String("@@ -1,1 +1,1 @@\n"
- "-ABCD\n"
- "\\ No newline at end of file\n"
- "+ABCD\n");
+ patchText = header + _("@@ -1,1 +1,1 @@\n"
+ "-ABCD\n"
+ "\\ No newline at end of file\n"
+ "+ABCD\n");
QTest::newRow("EOL to last line added") << chunk
<< fileName
@@ -317,9 +315,9 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data()
///////////
// chunk the same here
- patchText = header + QLatin1String("@@ -1,1 +1,2 @@\n"
- " ABCD\n"
- "+\n");
+ patchText = header + _("@@ -1,1 +1,2 @@\n"
+ " ABCD\n"
+ "+\n");
QTest::newRow("Last empty line added") << chunk
<< fileName
@@ -330,12 +328,11 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data()
///////////
rows.clear();
- rows << RowData(TextLineData(QLatin1String("ABCD")),
- TextLineData(QLatin1String("EFGH")));
+ rows << RowData(_("ABCD"), _("EFGH"));
chunk.rows = rows;
- patchText = header + QLatin1String("@@ -1,1 +1,1 @@\n"
- "-ABCD\n"
- "+EFGH\n");
+ patchText = header + _("@@ -1,1 +1,1 @@\n"
+ "-ABCD\n"
+ "+EFGH\n");
QTest::newRow("Last line with a newline modified") << chunk
<< fileName
@@ -346,14 +343,13 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data()
///////////
rows.clear();
- rows << RowData(TextLineData(QLatin1String("ABCD")),
- TextLineData(QLatin1String("EFGH")));
- rows << RowData(TextLineData(QLatin1String("")));
+ rows << RowData(_("ABCD"), _("EFGH"));
+ rows << RowData(_(""));
chunk.rows = rows;
- patchText = header + QLatin1String("@@ -1,2 +1,2 @@\n"
- "-ABCD\n"
- "+EFGH\n"
- " \n");
+ patchText = header + _("@@ -1,2 +1,2 @@\n"
+ "-ABCD\n"
+ "+EFGH\n"
+ " \n");
QTest::newRow("Not a last line with a newline modified") << chunk
<< fileName
<< fileName
@@ -363,14 +359,13 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data()
///////////
rows.clear();
- rows << RowData(TextLineData(QLatin1String("ABCD")),
- TextLineData(QLatin1String("EFGH")));
+ rows << RowData(_("ABCD"), _("EFGH"));
chunk.rows = rows;
- patchText = header + QLatin1String("@@ -1,1 +1,1 @@\n"
- "-ABCD\n"
- "\\ No newline at end of file\n"
- "+EFGH\n"
- "\\ No newline at end of file\n");
+ patchText = header + _("@@ -1,1 +1,1 @@\n"
+ "-ABCD\n"
+ "\\ No newline at end of file\n"
+ "+EFGH\n"
+ "\\ No newline at end of file\n");
QTest::newRow("Last line without a newline modified") << chunk
<< fileName
@@ -381,9 +376,9 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data()
///////////
// chunk the same here
- patchText = header + QLatin1String("@@ -1,1 +1,1 @@\n"
- "-ABCD\n"
- "+EFGH\n");
+ patchText = header + _("@@ -1,1 +1,1 @@\n"
+ "-ABCD\n"
+ "+EFGH\n");
QTest::newRow("Not a last line without a newline modified") << chunk
<< fileName
<< fileName
@@ -393,15 +388,14 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data()
///////////
rows.clear();
- rows << RowData(TextLineData(QLatin1String("ABCD")),
- TextLineData(QLatin1String("EFGH")));
- rows << RowData(TextLineData(QLatin1String("IJKL")));
+ rows << RowData(_("ABCD"), _("EFGH"));
+ rows << RowData(_("IJKL"));
chunk.rows = rows;
- patchText = header + QLatin1String("@@ -1,2 +1,2 @@\n"
- "-ABCD\n"
- "+EFGH\n"
- " IJKL\n"
- "\\ No newline at end of file\n");
+ patchText = header + _("@@ -1,2 +1,2 @@\n"
+ "-ABCD\n"
+ "+EFGH\n"
+ " IJKL\n"
+ "\\ No newline at end of file\n");
QTest::newRow("Last but one line modified, last line without a newline")
<< chunk
@@ -413,10 +407,10 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data()
///////////
// chunk the same here
- patchText = header + QLatin1String("@@ -1,2 +1,2 @@\n"
- "-ABCD\n"
- "+EFGH\n"
- " IJKL\n");
+ patchText = header + _("@@ -1,2 +1,2 @@\n"
+ "-ABCD\n"
+ "+EFGH\n"
+ " IJKL\n");
QTest::newRow("Last but one line modified, last line with a newline")
<< chunk
@@ -472,186 +466,171 @@ void DiffEditor::Internal::DiffEditorPlugin::testReadPatch_data()
QTest::addColumn<QString>("sourcePatch");
QTest::addColumn<QList<FileData> >("fileDataList");
- QString patch = QLatin1String("diff --git a/src/plugins/diffeditor/diffeditor.cpp b/src/plugins/diffeditor/diffeditor.cpp\n"
- "index eab9e9b..082c135 100644\n"
- "--- a/src/plugins/diffeditor/diffeditor.cpp\n"
- "+++ b/src/plugins/diffeditor/diffeditor.cpp\n"
- "@@ -187,9 +187,6 @@ void DiffEditor::ctor()\n"
- " m_controller = m_document->controller();\n"
- " m_guiController = new DiffEditorGuiController(m_controller, this);\n"
- " \n"
- "-// m_sideBySideEditor->setDiffEditorGuiController(m_guiController);\n"
- "-// m_unifiedEditor->setDiffEditorGuiController(m_guiController);\n"
- "-\n"
- " connect(m_controller, SIGNAL(cleared(QString)),\n"
- " this, SLOT(slotCleared(QString)));\n"
- " connect(m_controller, SIGNAL(diffContentsChanged(QList<DiffEditorController::DiffFilesContents>,QString)),\n"
- "diff --git a/src/plugins/diffeditor/diffutils.cpp b/src/plugins/diffeditor/diffutils.cpp\n"
- "index 2f641c9..f8ff795 100644\n"
- "--- a/src/plugins/diffeditor/diffutils.cpp\n"
- "+++ b/src/plugins/diffeditor/diffutils.cpp\n"
- "@@ -464,5 +464,12 @@ QString DiffUtils::makePatch(const ChunkData &chunkData,\n"
- " return diffText;\n"
- " }\n"
- " \n"
- "+FileData DiffUtils::makeFileData(const QString &patch)\n"
- "+{\n"
- "+ FileData fileData;\n"
- "+\n"
- "+ return fileData;\n"
- "+}\n"
- "+\n"
- " } // namespace Internal\n"
- " } // namespace DiffEditor\n"
- "diff --git a/new b/new\n"
- "new file mode 100644\n"
- "index 0000000..257cc56\n"
- "--- /dev/null\n"
- "+++ b/new\n"
- "@@ -0,0 +1 @@\n"
- "+foo\n"
- "diff --git a/deleted b/deleted\n"
- "deleted file mode 100644\n"
- "index 257cc56..0000000\n"
- "--- a/deleted\n"
- "+++ /dev/null\n"
- "@@ -1 +0,0 @@\n"
- "-foo\n"
- "diff --git a/empty b/empty\n"
- "new file mode 100644\n"
- "index 0000000..e69de29\n"
- "diff --git a/empty b/empty\n"
- "deleted file mode 100644\n"
- "index e69de29..0000000\n"
- "diff --git a/file a.txt b/file b.txt\n"
- "similarity index 99%\n"
- "copy from file a.txt\n"
- "copy to file b.txt\n"
- "index 1234567..9876543\n"
- "--- a/file a.txt\n"
- "+++ b/file b.txt\n"
- "@@ -20,3 +20,3 @@\n"
- " A\n"
- "-B\n"
- "+C\n"
- " D\n"
- "diff --git a/file a.txt b/file b.txt\n"
- "similarity index 99%\n"
- "rename from file a.txt\n"
- "rename to file b.txt\n"
- );
+ QString patch = _("diff --git a/src/plugins/diffeditor/diffeditor.cpp b/src/plugins/diffeditor/diffeditor.cpp\n"
+ "index eab9e9b..082c135 100644\n"
+ "--- a/src/plugins/diffeditor/diffeditor.cpp\n"
+ "+++ b/src/plugins/diffeditor/diffeditor.cpp\n"
+ "@@ -187,9 +187,6 @@ void DiffEditor::ctor()\n"
+ " m_controller = m_document->controller();\n"
+ " m_guiController = new DiffEditorGuiController(m_controller, this);\n"
+ " \n"
+ "-// m_sideBySideEditor->setDiffEditorGuiController(m_guiController);\n"
+ "-// m_unifiedEditor->setDiffEditorGuiController(m_guiController);\n"
+ "-\n"
+ " connect(m_controller, SIGNAL(cleared(QString)),\n"
+ " this, SLOT(slotCleared(QString)));\n"
+ " connect(m_controller, SIGNAL(diffContentsChanged(QList<DiffEditorController::DiffFilesContents>,QString)),\n"
+ "diff --git a/src/plugins/diffeditor/diffutils.cpp b/src/plugins/diffeditor/diffutils.cpp\n"
+ "index 2f641c9..f8ff795 100644\n"
+ "--- a/src/plugins/diffeditor/diffutils.cpp\n"
+ "+++ b/src/plugins/diffeditor/diffutils.cpp\n"
+ "@@ -464,5 +464,12 @@ QString DiffUtils::makePatch(const ChunkData &chunkData,\n"
+ " return diffText;\n"
+ " }\n"
+ " \n"
+ "+FileData DiffUtils::makeFileData(const QString &patch)\n"
+ "+{\n"
+ "+ FileData fileData;\n"
+ "+\n"
+ "+ return fileData;\n"
+ "+}\n"
+ "+\n"
+ " } // namespace Internal\n"
+ " } // namespace DiffEditor\n"
+ "diff --git a/new b/new\n"
+ "new file mode 100644\n"
+ "index 0000000..257cc56\n"
+ "--- /dev/null\n"
+ "+++ b/new\n"
+ "@@ -0,0 +1 @@\n"
+ "+foo\n"
+ "diff --git a/deleted b/deleted\n"
+ "deleted file mode 100644\n"
+ "index 257cc56..0000000\n"
+ "--- a/deleted\n"
+ "+++ /dev/null\n"
+ "@@ -1 +0,0 @@\n"
+ "-foo\n"
+ "diff --git a/empty b/empty\n"
+ "new file mode 100644\n"
+ "index 0000000..e69de29\n"
+ "diff --git a/empty b/empty\n"
+ "deleted file mode 100644\n"
+ "index e69de29..0000000\n"
+ "diff --git a/file a.txt b/file b.txt\n"
+ "similarity index 99%\n"
+ "copy from file a.txt\n"
+ "copy to file b.txt\n"
+ "index 1234567..9876543\n"
+ "--- a/file a.txt\n"
+ "+++ b/file b.txt\n"
+ "@@ -20,3 +20,3 @@\n"
+ " A\n"
+ "-B\n"
+ "+C\n"
+ " D\n"
+ "diff --git a/file a.txt b/file b.txt\n"
+ "similarity index 99%\n"
+ "rename from file a.txt\n"
+ "rename to file b.txt\n"
+ );
FileData fileData1;
- fileData1.leftFileInfo = DiffFileInfo(QLatin1String("src/plugins/diffeditor/diffeditor.cpp"),
- QLatin1String("eab9e9b"));
- fileData1.rightFileInfo = DiffFileInfo(QLatin1String("src/plugins/diffeditor/diffeditor.cpp"),
- QLatin1String("082c135"));
+ fileData1.leftFileInfo = DiffFileInfo(_("src/plugins/diffeditor/diffeditor.cpp"), _("eab9e9b"));
+ fileData1.rightFileInfo = DiffFileInfo(_("src/plugins/diffeditor/diffeditor.cpp"), _("082c135"));
ChunkData chunkData1;
chunkData1.leftStartingLineNumber = 186;
chunkData1.rightStartingLineNumber = 186;
QList<RowData> rows1;
- rows1.append(RowData(TextLineData(QLatin1String(" m_controller = m_document->controller();"))));
- rows1.append(RowData(TextLineData(QLatin1String(" m_guiController = new DiffEditorGuiController(m_controller, this);"))));
- rows1.append(RowData(TextLineData(QLatin1String(""))));
- rows1.append(RowData(TextLineData(QLatin1String("// m_sideBySideEditor->setDiffEditorGuiController(m_guiController);")),
- TextLineData(TextLineData::Separator)));
- rows1.append(RowData(TextLineData(QLatin1String("// m_unifiedEditor->setDiffEditorGuiController(m_guiController);")),
- TextLineData(TextLineData::Separator)));
- rows1.append(RowData(TextLineData(QLatin1String("")),
- TextLineData(TextLineData::Separator)));
- rows1.append(RowData(TextLineData(QLatin1String(" connect(m_controller, SIGNAL(cleared(QString)),"))));
- rows1.append(RowData(TextLineData(QLatin1String(" this, SLOT(slotCleared(QString)));"))));
- rows1.append(RowData(TextLineData(QLatin1String(" connect(m_controller, SIGNAL(diffContentsChanged(QList<DiffEditorController::DiffFilesContents>,QString)),"))));
+ rows1 << RowData(_(" m_controller = m_document->controller();"));
+ rows1 << RowData(_(" m_guiController = new DiffEditorGuiController(m_controller, this);"));
+ rows1 << RowData(_(""));
+ rows1 << RowData(_("// m_sideBySideEditor->setDiffEditorGuiController(m_guiController);"), TextLineData::Separator);
+ rows1 << RowData(_("// m_unifiedEditor->setDiffEditorGuiController(m_guiController);"), TextLineData::Separator);
+ rows1 << RowData(_(""), TextLineData::Separator);
+ rows1 << RowData(_(" connect(m_controller, SIGNAL(cleared(QString)),"));
+ rows1 << RowData(_(" this, SLOT(slotCleared(QString)));"));
+ rows1 << RowData(_(" connect(m_controller, SIGNAL(diffContentsChanged(QList<DiffEditorController::DiffFilesContents>,QString)),"));
chunkData1.rows = rows1;
- fileData1.chunks.append(chunkData1);
+ fileData1.chunks << chunkData1;
FileData fileData2;
- fileData2.leftFileInfo = DiffFileInfo(QLatin1String("src/plugins/diffeditor/diffutils.cpp"),
- QLatin1String("2f641c9"));
- fileData2.rightFileInfo = DiffFileInfo(QLatin1String("src/plugins/diffeditor/diffutils.cpp"),
- QLatin1String("f8ff795"));
+ fileData2.leftFileInfo = DiffFileInfo(_("src/plugins/diffeditor/diffutils.cpp"), _("2f641c9"));
+ fileData2.rightFileInfo = DiffFileInfo(_("src/plugins/diffeditor/diffutils.cpp"), _("f8ff795"));
ChunkData chunkData2;
chunkData2.leftStartingLineNumber = 463;
chunkData2.rightStartingLineNumber = 463;
QList<RowData> rows2;
- rows2.append(RowData(TextLineData(QLatin1String(" return diffText;"))));
- rows2.append(RowData(TextLineData(QLatin1String("}"))));
- rows2.append(RowData(TextLineData(QLatin1String(""))));
- rows2.append(RowData(TextLineData(TextLineData::Separator),
- TextLineData(QLatin1String("FileData DiffUtils::makeFileData(const QString &patch)"))));
- rows2.append(RowData(TextLineData(TextLineData::Separator),
- TextLineData(QLatin1String("{"))));
- rows2.append(RowData(TextLineData(TextLineData::Separator),
- TextLineData(QLatin1String(" FileData fileData;"))));
- rows2.append(RowData(TextLineData(TextLineData::Separator),
- TextLineData(QLatin1String(""))));
- rows2.append(RowData(TextLineData(TextLineData::Separator),
- TextLineData(QLatin1String(" return fileData;"))));
- rows2.append(RowData(TextLineData(TextLineData::Separator),
- TextLineData(QLatin1String("}"))));
- rows2.append(RowData(TextLineData(TextLineData::Separator),
- TextLineData(QLatin1String(""))));
- rows2.append(RowData(TextLineData(QLatin1String("} // namespace Internal"))));
- rows2.append(RowData(TextLineData(QLatin1String("} // namespace DiffEditor"))));
+ rows2 << RowData(_(" return diffText;"));
+ rows2 << RowData(_("}"));
+ rows2 << RowData(_(""));
+ rows2 << RowData(TextLineData::Separator, _("FileData DiffUtils::makeFileData(const QString &patch)"));
+ rows2 << RowData(TextLineData::Separator, _("{"));
+ rows2 << RowData(TextLineData::Separator, _(" FileData fileData;"));
+ rows2 << RowData(TextLineData::Separator, _(""));
+ rows2 << RowData(TextLineData::Separator, _(" return fileData;"));
+ rows2 << RowData(TextLineData::Separator, _("}"));
+ rows2 << RowData(TextLineData::Separator, _(""));
+ rows2 << RowData(_("} // namespace Internal"));
+ rows2 << RowData(_("} // namespace DiffEditor"));
chunkData2.rows = rows2;
- fileData2.chunks.append(chunkData2);
+ fileData2.chunks << chunkData2;
FileData fileData3;
- fileData3.leftFileInfo = DiffFileInfo(QLatin1String("new"), QLatin1String("0000000"));
- fileData3.rightFileInfo = DiffFileInfo(QLatin1String("new"), QLatin1String("257cc56"));
+ fileData3.leftFileInfo = DiffFileInfo(_("new"), _("0000000"));
+ fileData3.rightFileInfo = DiffFileInfo(_("new"), _("257cc56"));
fileData3.fileOperation = FileData::NewFile;
ChunkData chunkData3;
chunkData3.leftStartingLineNumber = -1;
chunkData3.rightStartingLineNumber = 0;
QList<RowData> rows3;
- rows3.append(RowData(TextLineData::Separator, TextLineData(QLatin1String("foo"))));
+ rows3 << RowData(TextLineData::Separator, _("foo"));
TextLineData textLineData3(TextLineData::TextLine);
- rows3.append(RowData(TextLineData::Separator, textLineData3));
+ rows3 << RowData(TextLineData::Separator, textLineData3);
chunkData3.rows = rows3;
- fileData3.chunks.append(chunkData3);
+ fileData3.chunks << chunkData3;
FileData fileData4;
- fileData4.leftFileInfo = DiffFileInfo(QLatin1String("deleted"), QLatin1String("257cc56"));
- fileData4.rightFileInfo = DiffFileInfo(QLatin1String("deleted"), QLatin1String("0000000"));
+ fileData4.leftFileInfo = DiffFileInfo(_("deleted"), _("257cc56"));
+ fileData4.rightFileInfo = DiffFileInfo(_("deleted"), _("0000000"));
fileData4.fileOperation = FileData::DeleteFile;
ChunkData chunkData4;
chunkData4.leftStartingLineNumber = 0;
chunkData4.rightStartingLineNumber = -1;
QList<RowData> rows4;
- rows4.append(RowData(TextLineData(QLatin1String("foo")), TextLineData::Separator));
+ rows4 << RowData(_("foo"), TextLineData::Separator);
TextLineData textLineData4(TextLineData::TextLine);
- rows4.append(RowData(textLineData4, TextLineData::Separator));
+ rows4 << RowData(textLineData4, TextLineData::Separator);
chunkData4.rows = rows4;
- fileData4.chunks.append(chunkData4);
+ fileData4.chunks << chunkData4;
FileData fileData5;
- fileData5.leftFileInfo = DiffFileInfo(QLatin1String("empty"), QLatin1String("0000000"));
- fileData5.rightFileInfo = DiffFileInfo(QLatin1String("empty"), QLatin1String("e69de29"));
+ fileData5.leftFileInfo = DiffFileInfo(_("empty"), _("0000000"));
+ fileData5.rightFileInfo = DiffFileInfo(_("empty"), _("e69de29"));
fileData5.fileOperation = FileData::NewFile;
FileData fileData6;
- fileData6.leftFileInfo = DiffFileInfo(QLatin1String("empty"), QLatin1String("e69de29"));
- fileData6.rightFileInfo = DiffFileInfo(QLatin1String("empty"), QLatin1String("0000000"));
+ fileData6.leftFileInfo = DiffFileInfo(_("empty"), _("e69de29"));
+ fileData6.rightFileInfo = DiffFileInfo(_("empty"), _("0000000"));
fileData6.fileOperation = FileData::DeleteFile;
FileData fileData7;
- fileData7.leftFileInfo = DiffFileInfo(QLatin1String("file a.txt"), QLatin1String("1234567"));
- fileData7.rightFileInfo = DiffFileInfo(QLatin1String("file b.txt"), QLatin1String("9876543"));
+ fileData7.leftFileInfo = DiffFileInfo(_("file a.txt"), _("1234567"));
+ fileData7.rightFileInfo = DiffFileInfo(_("file b.txt"), _("9876543"));
fileData7.fileOperation = FileData::CopyFile;
ChunkData chunkData7;
chunkData7.leftStartingLineNumber = 19;
chunkData7.rightStartingLineNumber = 19;
QList<RowData> rows7;
- rows7.append(RowData(TextLineData(QLatin1String("A"))));
- rows7.append(RowData(TextLineData(QLatin1String("B")),
- TextLineData(QLatin1String("C"))));
- rows7.append(RowData(TextLineData(QLatin1String("D"))));
+ rows7 << RowData(_("A"));
+ rows7 << RowData(_("B"), _("C"));
+ rows7 << RowData(_("D"));
chunkData7.rows = rows7;
- fileData7.chunks.append(chunkData7);
+ fileData7.chunks << chunkData7;
FileData fileData8;
- fileData8.leftFileInfo = DiffFileInfo(QLatin1String("file a.txt"));
- fileData8.rightFileInfo = DiffFileInfo(QLatin1String("file b.txt"));
+ fileData8.leftFileInfo = DiffFileInfo(_("file a.txt"));
+ fileData8.rightFileInfo = DiffFileInfo(_("file b.txt"));
fileData8.fileOperation = FileData::RenameFile;
QList<FileData> fileDataList1;
@@ -662,30 +641,29 @@ void DiffEditor::Internal::DiffEditorPlugin::testReadPatch_data()
//////////////
- patch = QLatin1String("diff --git a/file foo.txt b/file foo.txt\n"
- "index 1234567..9876543 100644\n"
- "--- a/file foo.txt\n"
- "+++ b/file foo.txt\n"
- "@@ -50,4 +50,5 @@ void DiffEditor::ctor()\n"
- " A\n"
- " B\n"
- " C\n"
- "+\n");
-
- fileData1.leftFileInfo = DiffFileInfo(QLatin1String("file foo.txt"), QLatin1String("1234567"));
- fileData1.rightFileInfo = DiffFileInfo(QLatin1String("file foo.txt"), QLatin1String("9876543"));
+ patch = _("diff --git a/file foo.txt b/file foo.txt\n"
+ "index 1234567..9876543 100644\n"
+ "--- a/file foo.txt\n"
+ "+++ b/file foo.txt\n"
+ "@@ -50,4 +50,5 @@ void DiffEditor::ctor()\n"
+ " A\n"
+ " B\n"
+ " C\n"
+ "+\n");
+
+ fileData1.leftFileInfo = DiffFileInfo(_("file foo.txt"), _("1234567"));
+ fileData1.rightFileInfo = DiffFileInfo(_("file foo.txt"), _("9876543"));
fileData1.fileOperation = FileData::ChangeFile;
chunkData1.leftStartingLineNumber = 49;
chunkData1.rightStartingLineNumber = 49;
rows1.clear();
- rows1.append(RowData(TextLineData(QLatin1String("A"))));
- rows1.append(RowData(TextLineData(QLatin1String("B"))));
- rows1.append(RowData(TextLineData(QLatin1String("C"))));
- rows1.append(RowData(TextLineData(TextLineData::Separator),
- TextLineData(QLatin1String(""))));
+ rows1 << RowData(_("A"));
+ rows1 << RowData(_("B"));
+ rows1 << RowData(_("C"));
+ rows1 << RowData(TextLineData::Separator, _(""));
chunkData1.rows = rows1;
fileData1.chunks.clear();
- fileData1.chunks.append(chunkData1);
+ fileData1.chunks << chunkData1;
QList<FileData> fileDataList2;
fileDataList2 << fileData1;
@@ -695,33 +673,81 @@ void DiffEditor::Internal::DiffEditorPlugin::testReadPatch_data()
//////////////
- patch = QLatin1String("diff --git a/file foo.txt b/file foo.txt\n"
- "index 1234567..9876543 100644\n"
- "--- a/file foo.txt\n"
- "+++ b/file foo.txt\n"
- "@@ -1,1 +1,1 @@\n"
- "-ABCD\n"
- "\\ No newline at end of file\n"
- "+ABCD\n");
-
- fileData1.leftFileInfo = DiffFileInfo(QLatin1String("file foo.txt"), QLatin1String("1234567"));
- fileData1.rightFileInfo = DiffFileInfo(QLatin1String("file foo.txt"), QLatin1String("9876543"));
+ patch = _("diff --git a/file foo.txt b/file foo.txt\n"
+ "index 1234567..9876543 100644\n"
+ "--- a/file foo.txt\n"
+ "+++ b/file foo.txt\n"
+ "@@ -1,1 +1,1 @@\n"
+ "-ABCD\n"
+ "\\ No newline at end of file\n"
+ "+ABCD\n");
+
+ fileData1.leftFileInfo = DiffFileInfo(_("file foo.txt"), _("1234567"));
+ fileData1.rightFileInfo = DiffFileInfo(_("file foo.txt"), _("9876543"));
fileData1.fileOperation = FileData::ChangeFile;
chunkData1.leftStartingLineNumber = 0;
chunkData1.rightStartingLineNumber = 0;
rows1.clear();
- rows1.append(RowData(TextLineData(QLatin1String("ABCD"))));
- rows1.append(RowData(TextLineData(TextLineData::Separator),
- TextLineData(QLatin1String(""))));
+ rows1 << RowData(_("ABCD"));
+ rows1 << RowData(TextLineData::Separator, _(""));
chunkData1.rows = rows1;
fileData1.chunks.clear();
- fileData1.chunks.append(chunkData1);
+ fileData1.chunks << chunkData1;
QList<FileData> fileDataList3;
fileDataList3 << fileData1;
QTest::newRow("Last newline added to a line without newline") << patch
<< fileDataList3;
+
+ patch = _("diff --git a/difftest.txt b/difftest.txt\n"
+ "index 1234567..9876543 100644\n"
+ "--- a/difftest.txt\n"
+ "+++ b/difftest.txt\n"
+ "@@ -2,5 +2,5 @@ void func()\n"
+ " A\n"
+ " B\n"
+ "-C\n"
+ "+Z\n"
+ " D\n"
+ " \n"
+ "@@ -9,2 +9,4 @@ void OtherFunc()\n"
+ " \n"
+ " D\n"
+ "+E\n"
+ "+F\n"
+ );
+
+ fileData1.leftFileInfo = DiffFileInfo(_("difftest.txt"), _("1234567"));
+ fileData1.rightFileInfo = DiffFileInfo(_("difftest.txt"), _("9876543"));
+ fileData1.fileOperation = FileData::ChangeFile;
+ chunkData1.leftStartingLineNumber = 1;
+ chunkData1.rightStartingLineNumber = 1;
+ rows1.clear();
+ rows1 << RowData(_("A"));
+ rows1 << RowData(_("B"));
+ rows1 << RowData(_("C"), _("Z"));
+ rows1 << RowData(_("D"));
+ rows1 << RowData(_(""));
+ chunkData1.rows = rows1;
+
+ chunkData2.leftStartingLineNumber = 8;
+ chunkData2.rightStartingLineNumber = 8;
+ rows2.clear();
+ rows2 << RowData(_(""));
+ rows2 << RowData(_("D"));
+ rows2 << RowData(TextLineData::Separator, _("E"));
+ rows2 << RowData(TextLineData::Separator, _("F"));
+ chunkData2.rows = rows2;
+ fileData1.chunks.clear();
+ fileData1.chunks << chunkData1;
+ fileData1.chunks << chunkData2;
+
+ QList<FileData> fileDataList4;
+ fileDataList4 << fileData1;
+
+ QTest::newRow("2 chunks - first ends with blank line") << patch
+ << fileDataList4;
}
void DiffEditor::Internal::DiffEditorPlugin::testReadPatch()
diff --git a/src/plugins/diffeditor/diffutils.cpp b/src/plugins/diffeditor/diffutils.cpp
index f975462c47..c483eb3b89 100644
--- a/src/plugins/diffeditor/diffutils.cpp
+++ b/src/plugins/diffeditor/diffutils.cpp
@@ -604,7 +604,7 @@ static QList<RowData> readLines(const QString &patch,
} else {
if (noNewLineInEqual >= 0) {
removeNewLineFromLastEqual = true;
- } else if (lastChunk) {
+ } else {
if (lastEqual > lastDelete && lastEqual > lastInsert) {
removeNewLineFromLastEqual = true;
} else if (lastDelete > lastEqual && lastDelete > lastInsert) {
@@ -821,7 +821,7 @@ static QList<FileData> readDiffPatch(const QString &patch,
QList<FileData> fileDataList;
int pos = diffRegExp.indexIn(patch, 0);
- if (pos == 0) { // git style patch
+ if (pos >= 0) { // git style patch
readOk = true;
int lastPos = -1;
do {
@@ -1045,7 +1045,7 @@ static QList<FileData> readGitPatch(const QString &patch, bool ignoreWhitespace,
simpleGitMatched = (pos == simpleGitPos);
}
- if (pos == 0) { // git style patch
+ if (pos >= 0) { // git style patch
readOk = true;
int endOfLastHeader = 0;
QString lastLeftFileName;
@@ -1159,9 +1159,16 @@ QList<FileData> DiffUtils::readPatch(const QString &patch, bool ignoreWhitespace
QList<FileData> fileDataList;
- fileDataList = readGitPatch(patch, ignoreWhitespace, &readOk);
+ QString croppedPatch = patch;
+ // Crop e.g. "-- \n1.9.4.msysgit.0\n\n" at end of file
+ const QRegExp formatPatchEndingRegExp(QLatin1String("(\\n-- \\n\\S*\\n\\n$)"));
+ const int pos = formatPatchEndingRegExp.indexIn(patch, 0);
+ if (pos != -1)
+ croppedPatch = patch.left(pos + 1); // crop the ending for git format-patch
+
+ fileDataList = readGitPatch(croppedPatch, ignoreWhitespace, &readOk);
if (!readOk)
- fileDataList = readDiffPatch(patch, ignoreWhitespace, &readOk);
+ fileDataList = readDiffPatch(croppedPatch, ignoreWhitespace, &readOk);
if (ok)
*ok = readOk;
diff --git a/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp b/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp
index 853035a970..9e530f15c2 100644
--- a/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp
+++ b/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp
@@ -779,7 +779,8 @@ SideBySideDiffEditorWidget::SideBySideDiffEditorWidget(QWidget *parent)
connect(m_leftEditor, SIGNAL(jumpToOriginalFileRequested(int,int,int)),
this, SLOT(slotLeftJumpToOriginalFileRequested(int,int,int)));
connect(m_leftEditor, SIGNAL(contextMenuRequested(QMenu*,int,int)),
- this, SLOT(slotLeftContextMenuRequested(QMenu*,int,int)));
+ this, SLOT(slotLeftContextMenuRequested(QMenu*,int,int)),
+ Qt::DirectConnection);
m_rightEditor = new SideDiffEditorWidget(this);
m_rightEditor->setReadOnly(true);
@@ -791,7 +792,8 @@ SideBySideDiffEditorWidget::SideBySideDiffEditorWidget(QWidget *parent)
connect(m_rightEditor, SIGNAL(jumpToOriginalFileRequested(int,int,int)),
this, SLOT(slotRightJumpToOriginalFileRequested(int,int,int)));
connect(m_rightEditor, SIGNAL(contextMenuRequested(QMenu*,int,int)),
- this, SLOT(slotRightContextMenuRequested(QMenu*,int,int)));
+ this, SLOT(slotRightContextMenuRequested(QMenu*,int,int)),
+ Qt::DirectConnection);
connect(TextEditorSettings::instance(),
SIGNAL(fontSettingsChanged(TextEditor::FontSettings)),
diff --git a/src/plugins/genericprojectmanager/genericproject.cpp b/src/plugins/genericprojectmanager/genericproject.cpp
index 4fe7138c83..c3b82136e6 100644
--- a/src/plugins/genericprojectmanager/genericproject.cpp
+++ b/src/plugins/genericprojectmanager/genericproject.cpp
@@ -141,18 +141,25 @@ static QStringList readLines(const QString &absoluteFileName)
bool GenericProject::saveRawFileList(const QStringList &rawFileList)
{
+ bool result = saveRawList(rawFileList, filesFileName());
+ refresh(GenericProject::Files);
+ return result;
+}
+
+bool GenericProject::saveRawList(const QStringList &rawList, const QString &fileName)
+{
+ DocumentManager::expectFileChange(fileName);
// Make sure we can open the file for writing
- Utils::FileSaver saver(filesFileName(), QIODevice::Text);
+ Utils::FileSaver saver(fileName, QIODevice::Text);
if (!saver.hasError()) {
QTextStream stream(saver.file());
- foreach (const QString &filePath, rawFileList)
+ foreach (const QString &filePath, rawList)
stream << filePath << QLatin1Char('\n');
saver.setResult(&stream);
}
- if (!saver.finalize(ICore::mainWindow()))
- return false;
- refresh(GenericProject::Files);
- return true;
+ bool result = saver.finalize(ICore::mainWindow());
+ DocumentManager::unexpectFileChange(fileName);
+ return result;
}
bool GenericProject::addFiles(const QStringList &filePaths)
@@ -163,7 +170,30 @@ bool GenericProject::addFiles(const QStringList &filePaths)
foreach (const QString &filePath, filePaths)
newList.append(baseDir.relativeFilePath(filePath));
- return saveRawFileList(newList);
+
+ QSet<QString> includes = projectIncludePaths().toSet();
+ QSet<QString> toAdd;
+
+ foreach (const QString &filePaths, filePaths) {
+ QString directory = QFileInfo(filePaths).absolutePath();
+ if (!includes.contains(directory)
+ && !toAdd.contains(directory))
+ toAdd << directory;
+ }
+
+ const QDir dir(projectDirectory().toString());
+ foreach (const QString &path, toAdd) {
+ QString relative = dir.relativeFilePath(path);
+ if (relative.isEmpty())
+ relative = QLatin1String(".");
+ m_rawProjectIncludePaths.append(relative);
+ }
+
+ bool result = saveRawList(newList, filesFileName());
+ result &= saveRawList(m_rawProjectIncludePaths, includesFileName());
+ refresh(GenericProject::Everything);
+
+ return result;
}
bool GenericProject::removeFiles(const QStringList &filePaths)
@@ -214,7 +244,8 @@ void GenericProject::parseProject(RefreshOptions options)
}
if (options & Configuration) {
- m_projectIncludePaths = processEntries(readLines(includesFileName()));
+ m_rawProjectIncludePaths = readLines(includesFileName());
+ m_projectIncludePaths = processEntries(m_rawProjectIncludePaths);
// TODO: Possibly load some configuration from the project file
//QSettings projectInfo(m_fileName, QSettings::IniFormat);
@@ -227,7 +258,7 @@ void GenericProject::parseProject(RefreshOptions options)
void GenericProject::refresh(RefreshOptions options)
{
QSet<QString> oldFileList;
- if (!(options & Configuration))
+ if (options & Files)
oldFileList = m_files.toSet();
parseProject(options);
diff --git a/src/plugins/genericprojectmanager/genericproject.h b/src/plugins/genericprojectmanager/genericproject.h
index 297e41df15..9a4087b1c1 100644
--- a/src/plugins/genericprojectmanager/genericproject.h
+++ b/src/plugins/genericprojectmanager/genericproject.h
@@ -89,6 +89,7 @@ protected:
private:
bool saveRawFileList(const QStringList &rawFileList);
+ bool saveRawList(const QStringList &rawList, const QString &fileName);
void parseProject(RefreshOptions options);
QStringList processEntries(const QStringList &paths,
QHash<QString, QString> *map = 0) const;
@@ -106,6 +107,7 @@ private:
QStringList m_rawFileList;
QStringList m_files;
QHash<QString, QString> m_rawListEntries;
+ QStringList m_rawProjectIncludePaths;
QStringList m_projectIncludePaths;
GenericProjectNode *m_rootNode;
diff --git a/src/plugins/git/branchdialog.cpp b/src/plugins/git/branchdialog.cpp
index 2531867dcb..d3eceed608 100644
--- a/src/plugins/git/branchdialog.cpp
+++ b/src/plugins/git/branchdialog.cpp
@@ -152,12 +152,16 @@ void BranchDialog::add()
QStringList localNames = m_model->localBranchNames();
- QString suggestedNameBase = trackedBranch.mid(trackedBranch.lastIndexOf(QLatin1Char('/')) + 1);
- QString suggestedName = suggestedNameBase;
- int i = 2;
- while (localNames.contains(suggestedName)) {
- suggestedName = suggestedNameBase + QString::number(i);
- ++i;
+ QString suggestedName;
+ if (!isTag) {
+ QString suggestedNameBase;
+ suggestedNameBase = trackedBranch.mid(trackedBranch.lastIndexOf(QLatin1Char('/')) + 1);
+ suggestedName = suggestedNameBase;
+ int i = 2;
+ while (localNames.contains(suggestedName)) {
+ suggestedName = suggestedNameBase + QString::number(i);
+ ++i;
+ }
}
BranchAddDialog branchAddDialog(localNames, true, this);
diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp
index ec74918f4e..e5576ed57e 100644
--- a/src/plugins/git/gitclient.cpp
+++ b/src/plugins/git/gitclient.cpp
@@ -783,7 +783,7 @@ DiffEditor::DiffEditorDocument *GitClient::createDiffEditor(const QString &docum
VcsBasePlugin::setSource(diffEditorDocument, source);
connect(diffEditorDocument->controller(), SIGNAL(chunkActionsRequested(QMenu*,int,int)),
- this, SLOT(slotChunkActionsRequested(QMenu*,int,int)));
+ this, SLOT(slotChunkActionsRequested(QMenu*,int,int)), Qt::DirectConnection);
return diffEditorDocument;
}
@@ -1952,7 +1952,7 @@ bool GitClient::synchronousForEachRefCmd(const QString &workingDirectory, QStrin
QByteArray errorText;
const bool rc = fullySynchronousGit(workingDirectory, args, &outputText, &errorText,
VcsBasePlugin::SuppressCommandLogging);
- *output = commandOutputFromLocal8Bit(outputText);
+ *output = Utils::SynchronousProcess::normalizeNewlines(QString::fromUtf8(outputText));
if (!rc)
msgCannotRun(args, workingDirectory, errorText, errorMessage);
diff --git a/src/plugins/git/gitsubmiteditor.cpp b/src/plugins/git/gitsubmiteditor.cpp
index d7844723b3..703ef82795 100644
--- a/src/plugins/git/gitsubmiteditor.cpp
+++ b/src/plugins/git/gitsubmiteditor.cpp
@@ -229,9 +229,10 @@ void GitSubmitEditor::updateFileModel()
m_firstUpdate = false;
return;
}
- if (m_workingDirectory.isEmpty())
+ GitSubmitEditorWidget *w = submitEditorWidget();
+ if (w->updateInProgress() || m_workingDirectory.isEmpty())
return;
- submitEditorWidget()->setUpdateInProgress(true);
+ w->setUpdateInProgress(true);
resetCommitDataFetcher();
m_commitDataFetcher = new CommitDataFetcher(m_commitType, m_workingDirectory);
connect(m_commitDataFetcher, SIGNAL(finished(bool)), this, SLOT(commitDataRetrieved(bool)));
@@ -244,10 +245,9 @@ void GitSubmitEditor::updateFileModel()
void GitSubmitEditor::commitDataRetrieved(bool success)
{
GitSubmitEditorWidget *w = submitEditorWidget();
- w->setUpdateInProgress(false);
if (success) {
setCommitData(m_commitDataFetcher->commitData());
- submitEditorWidget()->refreshLog(m_workingDirectory);
+ w->refreshLog(m_workingDirectory);
w->setEnabled(true);
} else {
// Nothing to commit left!
@@ -257,6 +257,7 @@ void GitSubmitEditor::commitDataRetrieved(bool success)
}
m_commitDataFetcher->deleteLater();
m_commitDataFetcher = 0;
+ w->setUpdateInProgress(false);
}
GitSubmitEditorPanelData GitSubmitEditor::panelData() const
diff --git a/src/plugins/help/helpwidget.cpp b/src/plugins/help/helpwidget.cpp
index 8bd94adbe1..98f235a3ab 100644
--- a/src/plugins/help/helpwidget.cpp
+++ b/src/plugins/help/helpwidget.cpp
@@ -102,10 +102,10 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget
setFocusProxy(m_viewer);
- Core::IContext *icontext = new Core::IContext(this);
- icontext->setContext(context);
- icontext->setWidget(m_viewer);
- Core::ICore::addContextObject(icontext);
+ m_context = new Core::IContext(this);
+ m_context->setContext(context);
+ m_context->setWidget(m_viewer);
+ Core::ICore::addContextObject(m_context);
back->setEnabled(m_viewer->isBackwardAvailable());
connect(back, SIGNAL(triggered()), m_viewer, SLOT(backward()));
@@ -171,6 +171,7 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget
HelpWidget::~HelpWidget()
{
+ Core::ICore::removeContextObject(m_context);
Core::ActionManager::unregisterAction(m_copy, Core::Constants::COPY);
Core::ActionManager::unregisterAction(m_openHelpMode, Help::Constants::CONTEXT_HELP);
if (m_scaleUp)
diff --git a/src/plugins/help/helpwidget.h b/src/plugins/help/helpwidget.h
index 3796be59dc..73701e3348 100644
--- a/src/plugins/help/helpwidget.h
+++ b/src/plugins/help/helpwidget.h
@@ -75,6 +75,7 @@ private slots:
void updateHelpModeButtonToolTip();
private:
+ Core::IContext *m_context;
QAction *m_switchToHelp;
QMenu *m_backMenu;
QMenu *m_forwardMenu;
diff --git a/src/plugins/projectexplorer/abi.cpp b/src/plugins/projectexplorer/abi.cpp
index 30a8a132f8..f8fb18ed76 100644
--- a/src/plugins/projectexplorer/abi.cpp
+++ b/src/plugins/projectexplorer/abi.cpp
@@ -469,9 +469,9 @@ Abi Abi::abiFromTargetTriplet(const QString &triple)
} else if (p.startsWith(QLatin1String("arm"))) {
arch = Abi::ArmArchitecture;
width = 32;
- } else if (p == QLatin1String("mipsel")) {
+ } else if (p.startsWith(QLatin1String("mips"))) {
arch = Abi::MipsArchitecture;
- width = 32;
+ width = p.endsWith(QLatin1String("64")) ? 64 : 32;
} else if (p == QLatin1String("x86_64") || p == QLatin1String("amd64")) {
arch = Abi::X86Architecture;
width = 64;
@@ -817,14 +817,6 @@ QList<Abi> Abi::abisOfBinary(const Utils::FileName &path)
return result;
}
-ProjectExplorer::Abi::Endianness Abi::endianness() const
-{
- if (m_architecture == X86Architecture)
- return LittleEndian;
- // All other architectures are bi-endian:/
- return UnknownEndian; // Todo: Add a field for endianness to the Abi struct!
-}
-
} // namespace ProjectExplorer
// Unit tests:
@@ -996,92 +988,98 @@ void ProjectExplorer::ProjectExplorerPlugin::testFlavorForOs()
void ProjectExplorer::ProjectExplorerPlugin::testAbiFromTargetTriplet_data()
{
- QTest::addColumn<QString>("targetTriplet");
QTest::addColumn<int>("architecture");
QTest::addColumn<int>("os");
QTest::addColumn<int>("osFlavor");
QTest::addColumn<int>("binaryFormat");
- QTest::addColumn<unsigned char>("wordWidth");
+ QTest::addColumn<int>("wordWidth");
- QTest::newRow("x86_64-apple-darwin") << "x86_64-apple-darwin" << int(Abi::X86Architecture)
+ QTest::newRow("x86_64-apple-darwin") << int(Abi::X86Architecture)
<< int(Abi::MacOS) << int(Abi::GenericMacFlavor)
- << int(Abi::MachOFormat) << (unsigned char) 64;
+ << int(Abi::MachOFormat) << 64;
- QTest::newRow("x86_64-apple-darwin12.5.0") << "x86_64-apple-darwin12.5.0" << int(Abi::X86Architecture)
+ QTest::newRow("x86_64-apple-darwin12.5.0") << int(Abi::X86Architecture)
<< int(Abi::MacOS) << int(Abi::GenericMacFlavor)
- << int(Abi::MachOFormat) << (unsigned char) 64;
+ << int(Abi::MachOFormat) << 64;
- QTest::newRow("x86_64-linux-gnu") << "x86_64-linux-gnu" << int(Abi::X86Architecture)
+ QTest::newRow("x86_64-linux-gnu") << int(Abi::X86Architecture)
<< int(Abi::LinuxOS) << int(Abi::GenericLinuxFlavor)
- << int(Abi::ElfFormat) << (unsigned char) 64;
+ << int(Abi::ElfFormat) << 64;
- QTest::newRow("x86_64-pc-mingw32msvc") << "x86_64-pc-mingw32msvc" << int(Abi::X86Architecture)
+ QTest::newRow("x86_64-pc-mingw32msvc") << int(Abi::X86Architecture)
<< int(Abi::WindowsOS) << int(Abi::WindowsMSysFlavor)
- << int(Abi::PEFormat) << (unsigned char) 64;
+ << int(Abi::PEFormat) << 64;
- QTest::newRow("i586-pc-mingw32msvc") << "i586-pc-mingw32msvc" << int(Abi::X86Architecture)
+ QTest::newRow("i586-pc-mingw32msvc") << int(Abi::X86Architecture)
<< int(Abi::WindowsOS) << int(Abi::WindowsMSysFlavor)
- << int(Abi::PEFormat) << (unsigned char) 0;
+ << int(Abi::PEFormat) << 0;
- QTest::newRow("i686-linux-gnu") << "i686-linux-gnu" << int(Abi::X86Architecture)
+ QTest::newRow("i686-linux-gnu") << int(Abi::X86Architecture)
<< int(Abi::LinuxOS) << int(Abi::GenericLinuxFlavor)
- << int(Abi::ElfFormat) << (unsigned char) 0;
+ << int(Abi::ElfFormat) << 0;
- QTest::newRow("i686-linux-android") << "i686-linux-android" << int(Abi::X86Architecture)
+ QTest::newRow("i686-linux-android") << int(Abi::X86Architecture)
<< int(Abi::LinuxOS) << int(Abi::AndroidLinuxFlavor)
- << int(Abi::ElfFormat) << (unsigned char) 0;
+ << int(Abi::ElfFormat) << 0;
- QTest::newRow("i686-pc-linux-android") << "i686-pc-linux-android" << int(Abi::X86Architecture)
+ QTest::newRow("i686-pc-linux-android") << int(Abi::X86Architecture)
<< int(Abi::LinuxOS) << int(Abi::AndroidLinuxFlavor)
- << int(Abi::ElfFormat) << (unsigned char) 0;
+ << int(Abi::ElfFormat) << 0;
- QTest::newRow("i686-pc-mingw32") << "i686-pc-mingw32" << int(Abi::X86Architecture)
+ QTest::newRow("i686-pc-mingw32") << int(Abi::X86Architecture)
<< int(Abi::WindowsOS) << int(Abi::WindowsMSysFlavor)
- << int(Abi::PEFormat) << (unsigned char) 0;
+ << int(Abi::PEFormat) << 0;
- QTest::newRow("i686-w64-mingw32") << "i686-w64-mingw32" << int(Abi::X86Architecture)
+ QTest::newRow("i686-w64-mingw32") << int(Abi::X86Architecture)
<< int(Abi::WindowsOS) << int(Abi::WindowsMSysFlavor)
- << int(Abi::PEFormat) << (unsigned char) 0;
+ << int(Abi::PEFormat) << 0;
- QTest::newRow("mingw32") << "mingw32" << int(Abi::X86Architecture)
+ QTest::newRow("mingw32") << int(Abi::X86Architecture)
<< int(Abi::WindowsOS) << int(Abi::WindowsMSysFlavor)
- << int(Abi::PEFormat) << (unsigned char) 0;
+ << int(Abi::PEFormat) << 0;
- QTest::newRow("arm-linux-android") << "arm-linux-android" << int(Abi::ArmArchitecture)
+ QTest::newRow("arm-linux-android") << int(Abi::ArmArchitecture)
<< int(Abi::LinuxOS) << int(Abi::AndroidLinuxFlavor)
- << int(Abi::ElfFormat) << (unsigned char) 32;
+ << int(Abi::ElfFormat) << 32;
- QTest::newRow("arm-linux-androideabi") << "arm-linux-androideabi" << int(Abi::ArmArchitecture)
+ QTest::newRow("arm-linux-androideabi") << int(Abi::ArmArchitecture)
<< int(Abi::LinuxOS) << int(Abi::AndroidLinuxFlavor)
- << int(Abi::ElfFormat) << (unsigned char) 32;
+ << int(Abi::ElfFormat) << 32;
- QTest::newRow("arm-none-linux-gnueabi") << "arm-none-linux-gnueabi" << int(Abi::ArmArchitecture)
+ QTest::newRow("arm-none-linux-gnueabi") << int(Abi::ArmArchitecture)
<< int(Abi::LinuxOS) << int(Abi::GenericLinuxFlavor)
- << int(Abi::ElfFormat) << (unsigned char) 32;
+ << int(Abi::ElfFormat) << 32;
- QTest::newRow("mipsel-linux-android") << "mipsel-linux-android" << int(Abi::MipsArchitecture)
+ QTest::newRow("mipsel-linux-android") << int(Abi::MipsArchitecture)
<< int(Abi::LinuxOS) << int(Abi::AndroidLinuxFlavor)
- << int(Abi::ElfFormat) << (unsigned char) 32;
+ << int(Abi::ElfFormat) << 32;
- QTest::newRow("mipsel-unknown-linux-android") << "mipsel-unknown-linux-android" << int(Abi::MipsArchitecture)
+ QTest::newRow("mipsel-unknown-linux-android") << int(Abi::MipsArchitecture)
<< int(Abi::LinuxOS) << int(Abi::AndroidLinuxFlavor)
- << int(Abi::ElfFormat) << (unsigned char) 32;
+ << int(Abi::ElfFormat) << 32;
+
+ QTest::newRow("mips-linux-gnu") << int(Abi::MipsArchitecture)
+ << int(Abi::LinuxOS) << int(Abi::GenericLinuxFlavor)
+ << int(Abi::ElfFormat) << 32;
+
+ QTest::newRow("mips64-linux-octeon-gnu") << int(Abi::MipsArchitecture)
+ << int(Abi::LinuxOS) << int(Abi::GenericLinuxFlavor)
+ << int(Abi::ElfFormat) << 64;
}
void ProjectExplorer::ProjectExplorerPlugin::testAbiFromTargetTriplet()
{
- QFETCH(QString, targetTriplet);
QFETCH(int, architecture);
QFETCH(int, os);
QFETCH(int, osFlavor);
QFETCH(int, binaryFormat);
- QFETCH(unsigned char, wordWidth);
+ QFETCH(int, wordWidth);
const Abi expectedAbi = Abi(Abi::Architecture(architecture),
Abi::OS(os), Abi::OSFlavor(osFlavor),
- Abi::BinaryFormat(binaryFormat), wordWidth);
+ Abi::BinaryFormat(binaryFormat), (unsigned char)wordWidth);
- QCOMPARE(Abi::abiFromTargetTriplet(targetTriplet), expectedAbi);
+ QCOMPARE(Abi::abiFromTargetTriplet(QLatin1String(QTest::currentDataTag())), expectedAbi);
}
#endif
diff --git a/src/plugins/projectexplorer/abi.h b/src/plugins/projectexplorer/abi.h
index 6b4c090b0e..8b674c759c 100644
--- a/src/plugins/projectexplorer/abi.h
+++ b/src/plugins/projectexplorer/abi.h
@@ -101,12 +101,6 @@ public:
UnknownFormat
};
- enum Endianness {
- LittleEndian,
- BigEndian,
- UnknownEndian
- };
-
Abi() :
m_architecture(UnknownArchitecture), m_os(UnknownOS),
m_osFlavor(UnknownFlavor), m_binaryFormat(UnknownFormat), m_wordWidth(0)
@@ -126,7 +120,6 @@ public:
bool isNull() const;
Architecture architecture() const { return m_architecture; }
- Endianness endianness() const;
OS os() const { return m_os; }
OSFlavor osFlavor() const { return m_osFlavor; }
BinaryFormat binaryFormat() const { return m_binaryFormat; }
diff --git a/src/plugins/projectexplorer/kitchooser.cpp b/src/plugins/projectexplorer/kitchooser.cpp
index 25f082b608..34741b8840 100644
--- a/src/plugins/projectexplorer/kitchooser.cpp
+++ b/src/plugins/projectexplorer/kitchooser.cpp
@@ -56,6 +56,7 @@ KitChooser::KitChooser(QWidget *parent) :
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(m_chooser);
layout->addWidget(m_manageButton);
+ setFocusProxy(m_manageButton);
connect(m_chooser, SIGNAL(currentIndexChanged(int)), SLOT(onCurrentIndexChanged(int)));
connect(m_chooser, SIGNAL(activated(int)), SIGNAL(activated(int)));
@@ -105,8 +106,15 @@ void KitChooser::populate()
const int n = m_chooser->count();
const int index = Core::ICore::settings()->value(QLatin1String(lastKitKey)).toInt();
- m_chooser->setCurrentIndex(0 <= index && index < n ? index : -1);
+ if (0 <= index && index < n)
+ m_chooser->setCurrentIndex(index);
m_chooser->setEnabled(n > 1);
+
+ if (n > 1)
+ setFocusProxy(m_chooser);
+ else
+ setFocusProxy(m_manageButton);
+
}
Kit *KitChooser::currentKit() const
diff --git a/src/plugins/projectexplorer/localapplicationruncontrol.cpp b/src/plugins/projectexplorer/localapplicationruncontrol.cpp
index d0a78621d1..e5072117ff 100644
--- a/src/plugins/projectexplorer/localapplicationruncontrol.cpp
+++ b/src/plugins/projectexplorer/localapplicationruncontrol.cpp
@@ -54,11 +54,9 @@ bool LocalApplicationRunControlFactory::canRun(RunConfiguration *runConfiguratio
RunControl *LocalApplicationRunControlFactory::create(RunConfiguration *runConfiguration, RunMode mode, QString *errorMessage)
{
+ Q_UNUSED(errorMessage)
QTC_ASSERT(canRun(runConfiguration, mode), return 0);
LocalApplicationRunConfiguration *localRunConfiguration = qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration);
- // Force the dialog about executables at this point and fail if there is none
- if (!localRunConfiguration->ensureConfigured(errorMessage))
- return 0;
return new LocalApplicationRunControl(localRunConfiguration, mode);
}
diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp
index 5ce433f1fd..4d643e219f 100644
--- a/src/plugins/projectexplorer/projectexplorer.cpp
+++ b/src/plugins/projectexplorer/projectexplorer.cpp
@@ -250,6 +250,7 @@ struct ProjectExplorerPluginPrivate {
QString m_lastOpenDirectory;
QPointer<RunConfiguration> m_delayedRunConfiguration;
+ QList<QPair<RunConfiguration *, ProjectExplorer::RunMode>> m_delayedRunConfigurationForRun;
bool m_shouldHaveRunConfiguration;
RunMode m_runMode;
QString m_projectFilterString;
@@ -1790,14 +1791,25 @@ void ProjectExplorerPlugin::buildStateChanged(Project * pro)
void ProjectExplorerPlugin::executeRunConfiguration(RunConfiguration *runConfiguration, RunMode runMode)
{
- QString errorMessage;
- if (!runConfiguration->ensureConfigured(&errorMessage)) {
- showRunErrorMessage(errorMessage);
- return;
+ if (!runConfiguration->isConfigured()) {
+ QString errorMessage;
+ RunConfiguration::ConfigurationState state = runConfiguration->ensureConfigured(&errorMessage);
+
+ if (state == RunConfiguration::UnConfigured) {
+ showRunErrorMessage(errorMessage);
+ return;
+ } else if (state == RunConfiguration::Waiting) {
+ connect(runConfiguration, SIGNAL(configurationFinished()),
+ this, SLOT(runConfigurationConfigurationFinished()));
+ d->m_delayedRunConfigurationForRun.append(qMakePair(runConfiguration, runMode));
+ return;
+ }
}
+
if (IRunControlFactory *runControlFactory = findRunControlFactory(runConfiguration, runMode)) {
emit aboutToExecuteProject(runConfiguration->target()->project(), runMode);
+ QString errorMessage;
RunControl *control = runControlFactory->create(runConfiguration, runMode, &errorMessage);
if (!control) {
showRunErrorMessage(errorMessage);
@@ -1914,6 +1926,22 @@ void ProjectExplorerPlugin::updateContext()
ICore::updateAdditionalContexts(oldContext, newContext);
}
+void ProjectExplorerPlugin::runConfigurationConfigurationFinished()
+{
+ RunConfiguration *rc = qobject_cast<RunConfiguration *>(sender());
+ ProjectExplorer::RunMode runMode = ProjectExplorer::NoRunMode;
+ for (int i = 0; i < d->m_delayedRunConfigurationForRun.size(); ++i) {
+ if (d->m_delayedRunConfigurationForRun.at(i).first == rc) {
+ runMode = d->m_delayedRunConfigurationForRun.at(i).second;
+ d->m_delayedRunConfigurationForRun.removeAt(i);
+ break;
+ }
+ }
+ if (runMode != ProjectExplorer::NoRunMode
+ && rc->isConfigured())
+ executeRunConfiguration(rc, runMode);
+}
+
void ProjectExplorerPlugin::setCurrent(Project *project, QString filePath, Node *node)
{
if (debug)
@@ -2773,6 +2801,7 @@ void ProjectExplorerPlugin::updateContextMenuActions()
d->m_addExistingDirectoryAction->setEnabled(false);
d->m_addNewFileAction->setEnabled(false);
d->m_addNewSubprojectAction->setEnabled(false);
+ d->m_removeProjectAction->setEnabled(false);
d->m_removeFileAction->setEnabled(false);
d->m_deleteFileAction->setEnabled(false);
d->m_renameFileAction->setEnabled(false);
@@ -2781,6 +2810,7 @@ void ProjectExplorerPlugin::updateContextMenuActions()
d->m_addExistingDirectoryAction->setVisible(true);
d->m_addNewFileAction->setVisible(true);
d->m_addNewSubprojectAction->setVisible(true);
+ d->m_removeProjectAction->setVisible(true);
d->m_removeFileAction->setVisible(true);
d->m_deleteFileAction->setVisible(true);
d->m_runActionContextMenu->setVisible(false);
@@ -2823,6 +2853,8 @@ void ProjectExplorerPlugin::updateContextMenuActions()
d->m_addNewSubprojectAction->setEnabled(d->m_currentNode->nodeType() == ProjectNodeType
&& actions.contains(ProjectExplorer::AddSubProject)
&& !ICore::isNewItemDialogRunning());
+ d->m_removeProjectAction->setEnabled(d->m_currentNode->nodeType() == ProjectNodeType
+ && actions.contains(ProjectExplorer::RemoveSubProject));
d->m_addExistingFilesAction->setEnabled(actions.contains(ProjectExplorer::AddExistingFile));
d->m_addExistingDirectoryAction->setEnabled(actions.contains(ProjectExplorer::AddExistingDirectory));
d->m_renameFileAction->setEnabled(actions.contains(ProjectExplorer::Rename));
@@ -2856,6 +2888,7 @@ void ProjectExplorerPlugin::updateContextMenuActions()
if (actions.contains(ProjectExplorer::HideFolderActions)) {
d->m_addNewFileAction->setVisible(false);
d->m_addNewSubprojectAction->setVisible(false);
+ d->m_removeProjectAction->setVisible(false);
d->m_addExistingFilesAction->setVisible(false);
d->m_addExistingDirectoryAction->setVisible(false);
}
diff --git a/src/plugins/projectexplorer/projectexplorer.h b/src/plugins/projectexplorer/projectexplorer.h
index 731a1723eb..b655f2219e 100644
--- a/src/plugins/projectexplorer/projectexplorer.h
+++ b/src/plugins/projectexplorer/projectexplorer.h
@@ -232,6 +232,7 @@ private slots:
void updateExternalFileWarning();
void updateContext();
+ void runConfigurationConfigurationFinished();
#ifdef WITH_TESTS
void testAnsiFilterOutputParser_data();
diff --git a/src/plugins/projectexplorer/projectexplorersettingspage.ui b/src/plugins/projectexplorer/projectexplorersettingspage.ui
index 55bb9fad10..2b1b040750 100644
--- a/src/plugins/projectexplorer/projectexplorersettingspage.ui
+++ b/src/plugins/projectexplorer/projectexplorersettingspage.ui
@@ -200,7 +200,7 @@
<item>
<widget class="QLabel" name="jomLabel">
<property name="text">
- <string>&lt;i&gt;jom&lt;/i&gt; is a drop-in replacement for &lt;i&gt;nmake&lt;/i&gt; which distributes the compilation process to multiple CPU cores. The latest binary is available at &lt;a href=&quot;http://releases.qt-project.org/jom/&quot;&gt;http://releases.qt-project.org/jom/&lt;/a&gt;. Disable it if you experience problems with your builds.</string>
+ <string>&lt;i&gt;jom&lt;/i&gt; is a drop-in replacement for &lt;i&gt;nmake&lt;/i&gt; which distributes the compilation process to multiple CPU cores. The latest binary is available at &lt;a href=&quot;http://download.qt-project.org/official_releases/jom/&quot;&gt;http://download.qt-project.org/official_releases/jom/&lt;/a&gt;. Disable it if you experience problems with your builds.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp
index 4c848bd9f1..a7b84d3090 100644
--- a/src/plugins/projectexplorer/runconfiguration.cpp
+++ b/src/plugins/projectexplorer/runconfiguration.cpp
@@ -273,13 +273,13 @@ bool RunConfiguration::isConfigured() const
return true;
}
-bool RunConfiguration::ensureConfigured(QString *errorMessage)
+RunConfiguration::ConfigurationState RunConfiguration::ensureConfigured(QString *errorMessage)
{
if (isConfigured())
- return true;
+ return Configured;
if (errorMessage)
*errorMessage = tr("Unknown error.");
- return false;
+ return UnConfigured;
}
diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h
index eb74613f6b..f8f9e990ce 100644
--- a/src/plugins/projectexplorer/runconfiguration.h
+++ b/src/plugins/projectexplorer/runconfiguration.h
@@ -163,9 +163,12 @@ public:
virtual bool isEnabled() const;
virtual QString disabledReason() const;
virtual QWidget *createConfigurationWidget() = 0;
+
virtual bool isConfigured() const;
// Pop up configuration dialog in case for example the executable is missing.
- virtual bool ensureConfigured(QString *errorMessage = 0);
+ enum ConfigurationState { Configured, UnConfigured, Waiting };
+ // TODO rename function
+ virtual ConfigurationState ensureConfigured(QString *errorMessage = 0);
Target *target() const;
@@ -194,6 +197,7 @@ public:
signals:
void enabledChanged();
void requestRunActionsUpdate();
+ void configurationFinished();
protected:
RunConfiguration(Target *parent, Core::Id id);
diff --git a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp
index 159e364959..e5b0ac5a4d 100644
--- a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp
+++ b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp
@@ -39,6 +39,7 @@
#include <tools/hostosinfo.h>
+#include <QDir>
#include <QFileInfo>
namespace QbsProjectManager {
@@ -60,8 +61,10 @@ QVariantMap DefaultPropertyProvider::properties(const ProjectExplorer::Kit *k, c
{
QTC_ASSERT(k, return defaultData);
QVariantMap data = defaultData;
+
+ const QString sysroot = ProjectExplorer::SysRootKitInformation::sysRoot(k).toUserOutput();
if (ProjectExplorer::SysRootKitInformation::hasSysRoot(k))
- data.insert(QLatin1String(QBS_SYSROOT), ProjectExplorer::SysRootKitInformation::sysRoot(k).toUserOutput());
+ data.insert(QLatin1String(QBS_SYSROOT), sysroot);
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);
if (tc) {
@@ -91,11 +94,6 @@ QVariantMap DefaultPropertyProvider::properties(const ProjectExplorer::Kit *k, c
qbs::Internal::HostOsInfo::canonicalArchitecture(architecture));
}
- if (targetAbi.endianness() == ProjectExplorer::Abi::BigEndian)
- data.insert(QLatin1String(QBS_ENDIANNESS), QLatin1String("big"));
- else if (targetAbi.endianness() == ProjectExplorer::Abi::LittleEndian)
- data.insert(QLatin1String(QBS_ENDIANNESS), QLatin1String("little"));
-
if (targetAbi.os() == ProjectExplorer::Abi::WindowsOS) {
data.insert(QLatin1String(QBS_TARGETOS), QLatin1String("windows"));
data.insert(QLatin1String(QBS_TOOLCHAIN),
@@ -127,6 +125,14 @@ QVariantMap DefaultPropertyProvider::properties(const ProjectExplorer::Kit *k, c
<< QLatin1String("llvm")
<< QLatin1String("gcc"));
}
+
+ // Set Xcode SDK name and version - required by Qbs if a sysroot is present
+ // Ideally this would be done in a better way...
+ QRegExp re(QLatin1String("(MacOSX|iPhoneOS|iPhoneSimulator)([0-9]+\\.[0-9]+)\\.sdk"));
+ if (re.exactMatch(QDir(sysroot).dirName())) {
+ data.insert(QLatin1String(CPP_XCODESDKNAME), QString(re.cap(1).toLower() + re.cap(2)));
+ data.insert(QLatin1String(CPP_XCODESDKVERSION), re.cap(2));
+ }
} else if (targetAbi.os() == ProjectExplorer::Abi::LinuxOS) {
data.insert(QLatin1String(QBS_TARGETOS), QStringList() << QLatin1String("linux")
<< QLatin1String("unix"));
diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp
index a9ff82a8bc..00ed509aa9 100644
--- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp
+++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp
@@ -202,7 +202,7 @@ bool QbsBuildStep::fromMap(const QVariantMap &map)
setQbsConfiguration(map.value(QLatin1String(QBS_CONFIG)).toMap());
m_qbsBuildOptions.setDryRun(map.value(QLatin1String(QBS_DRY_RUN)).toBool());
m_qbsBuildOptions.setKeepGoing(map.value(QLatin1String(QBS_KEEP_GOING)).toBool());
- m_qbsBuildOptions.setForceTimestampCheck(map.value(QLatin1String(QBS_CHECK_TIMESTAMPS), true).toBool());
+ m_qbsBuildOptions.setForceTimestampCheck(map.value(QLatin1String(QBS_CHECK_TIMESTAMPS)).toBool());
m_qbsBuildOptions.setMaxJobCount(map.value(QLatin1String(QBS_MAXJOBCOUNT)).toInt());
return true;
}
diff --git a/src/plugins/qbsprojectmanager/qbsconstants.h b/src/plugins/qbsprojectmanager/qbsconstants.h
index 82d070abd5..c0af1997b0 100644
--- a/src/plugins/qbsprojectmanager/qbsconstants.h
+++ b/src/plugins/qbsprojectmanager/qbsconstants.h
@@ -44,6 +44,8 @@ const char CPP_TOOLCHAINPREFIX[] = "cpp.toolchainPrefix";
const char CPP_COMPILERNAME[] = "cpp.compilerName";
const char CPP_PLATFORMCFLAGS[] = "cpp.platformCFlags";
const char CPP_PLATFORMCXXFLAGS[] = "cpp.platformCxxFlags";
+const char CPP_XCODESDKNAME[] = "cpp.xcodeSdkName";
+const char CPP_XCODESDKVERSION[] = "cpp.xcodeSdkVersion";
} // namespace Constants
} // namespace QbsProjectManager
diff --git a/src/plugins/qbsprojectmanager/qbsnodes.cpp b/src/plugins/qbsprojectmanager/qbsnodes.cpp
index f244f23313..4a47acfdc2 100644
--- a/src/plugins/qbsprojectmanager/qbsnodes.cpp
+++ b/src/plugins/qbsprojectmanager/qbsnodes.cpp
@@ -324,6 +324,17 @@ bool QbsBaseProjectNode::renameFile(const QString &filePath, const QString &newF
return false;
}
+
+static QList<ProjectExplorer::ProjectAction> supportedNodeActions(ProjectExplorer::Node *node)
+{
+ QList<ProjectExplorer::ProjectAction> actions;
+ if (parentQbsProjectNode(node)->project()->isProjectEditable()) {
+ actions << ProjectExplorer::AddNewFile << ProjectExplorer::AddExistingFile
+ << ProjectExplorer::RemoveFile;
+ }
+ return actions;
+}
+
// --------------------------------------------------------------------
// QbsGroupNode:
// --------------------------------------------------------------------
@@ -355,9 +366,7 @@ bool QbsGroupNode::isEnabled() const
QList<ProjectExplorer::ProjectAction> QbsGroupNode::supportedActions(ProjectExplorer::Node *node) const
{
- Q_UNUSED(node);
- return QList<ProjectExplorer::ProjectAction>() << ProjectExplorer::AddNewFile << ProjectExplorer::AddExistingFile
- << ProjectExplorer::RemoveFile;
+ return supportedNodeActions(node);
}
bool QbsGroupNode::addFiles(const QStringList &filePaths, QStringList *notAdded)
@@ -437,7 +446,7 @@ void QbsGroupNode::updateQbsGroupData(const qbs::GroupData *grp, const QString &
emitNodeUpdated();
}
-void QbsGroupNode::setupFiles(QbsBaseProjectNode *root, const QStringList &files,
+void QbsGroupNode::setupFiles(ProjectExplorer::FolderNode *root, const QStringList &files,
const QString &productPath, bool updateExisting)
{
// Build up a tree of nodes:
@@ -563,9 +572,7 @@ bool QbsProductNode::showInSimpleTree() const
QList<ProjectExplorer::ProjectAction> QbsProductNode::supportedActions(ProjectExplorer::Node *node) const
{
- Q_UNUSED(node);
- return QList<ProjectExplorer::ProjectAction>() << ProjectExplorer::AddNewFile << ProjectExplorer::AddExistingFile
- << ProjectExplorer::RemoveFile;
+ return supportedNodeActions(node);
}
bool QbsProductNode::addFiles(const QStringList &filePaths, QStringList *notAdded)
@@ -745,6 +752,7 @@ void QbsProjectNode::update(const qbs::ProjectData &prjData)
removeProjectNodes(toRemove);
addProjectNodes(toAdd);
+ m_projectData = prjData;
}
QbsProject *QbsProjectNode::project() const
@@ -757,11 +765,6 @@ const qbs::Project QbsProjectNode::qbsProject() const
return project()->qbsProject();
}
-const qbs::ProjectData QbsProjectNode::qbsProjectData() const
-{
- return project()->qbsProjectData();
-}
-
bool QbsProjectNode::showInSimpleTree() const
{
return true;
@@ -797,17 +800,53 @@ QbsProjectNode *QbsProjectNode::findProjectNode(const QString &name)
return 0;
}
+// --------------------------------------------------------------------
+// QbsRootProjectNode:
+// --------------------------------------------------------------------
QbsRootProjectNode::QbsRootProjectNode(QbsProject *project) :
QbsProjectNode(project->projectFilePath().toString()),
- m_project(project)
+ m_project(project),
+ m_buildSystemFiles(new ProjectExplorer::FolderNode(project->projectDirectory().toString()))
{
+ m_buildSystemFiles->setDisplayName(tr("Qbs files"));
+ addFolderNodes(QList<FolderNode *>() << m_buildSystemFiles);
}
void QbsRootProjectNode::update()
{
+ QStringList buildSystemFiles = unreferencedBuildSystemFiles(m_project->qbsProject());
+
+ QStringList projectBuildSystemFiles;
+ Utils::FileName base = m_project->projectDirectory();
+ foreach (const QString &f, buildSystemFiles) {
+ if (Utils::FileName::fromString(f).isChildOf(base))
+ projectBuildSystemFiles.append(f);
+ }
+ QbsGroupNode::setupFiles(m_buildSystemFiles, projectBuildSystemFiles, base.toString(), false);
+
update(m_project->qbsProjectData());
}
+static QSet<QString> referencedBuildSystemFiles(const qbs::ProjectData &data)
+{
+ QSet<QString> result;
+ result.insert(data.location().fileName());
+ foreach (const qbs::ProjectData &subProject, data.subProjects())
+ result.unite(referencedBuildSystemFiles(subProject));
+ foreach (const qbs::ProductData &product, data.products()) {
+ result.insert(product.location().fileName());
+ foreach (const qbs::GroupData &group, product.groups())
+ result.insert(group.location().fileName());
+ }
+
+ return result;
+}
+
+QStringList QbsRootProjectNode::unreferencedBuildSystemFiles(const qbs::Project &p) const
+{
+ return p.buildSystemFiles().subtract(referencedBuildSystemFiles(p.projectData())).toList();
+}
+
} // namespace Internal
} // namespace QbsProjectManager
diff --git a/src/plugins/qbsprojectmanager/qbsnodes.h b/src/plugins/qbsprojectmanager/qbsnodes.h
index bc3bc56962..d2d9cb8f39 100644
--- a/src/plugins/qbsprojectmanager/qbsnodes.h
+++ b/src/plugins/qbsprojectmanager/qbsnodes.h
@@ -111,7 +111,7 @@ public:
QString productPath() const;
- static void setupFiles(QbsBaseProjectNode *root, const QStringList &files,
+ static void setupFiles(FolderNode *root, const QStringList &files,
const QString &productPath, bool updateExisting);
private:
@@ -168,7 +168,7 @@ public:
virtual QbsProject *project() const;
const qbs::Project qbsProject() const;
- const qbs::ProjectData qbsProjectData() const;
+ const qbs::ProjectData qbsProjectData() const { return m_projectData; }
bool showInSimpleTree() const;
@@ -182,8 +182,13 @@ private:
QbsProjectNode *findProjectNode(const QString &name);
static QIcon m_projectIcon;
+ qbs::ProjectData m_projectData;
};
+// --------------------------------------------------------------------
+// QbsRootProjectNode:
+// --------------------------------------------------------------------
+
class QbsRootProjectNode : public QbsProjectNode
{
Q_OBJECT
@@ -197,7 +202,10 @@ public:
QbsProject *project() const { return m_project; }
private:
+ QStringList unreferencedBuildSystemFiles(const qbs::Project &p) const;
+
QbsProject * const m_project;
+ ProjectExplorer::FolderNode *m_buildSystemFiles;
};
diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp
index 84590c3d9e..8e73b24a40 100644
--- a/src/plugins/qbsprojectmanager/qbsproject.cpp
+++ b/src/plugins/qbsprojectmanager/qbsproject.cpp
@@ -86,7 +86,9 @@ static const char CONFIG_CXXFLAGS[] = "cxxFlags";
static const char CONFIG_CFLAGS[] = "cFlags";
static const char CONFIG_DEFINES[] = "defines";
static const char CONFIG_INCLUDEPATHS[] = "includePaths";
+static const char CONFIG_SYSTEM_INCLUDEPATHS[] = "systemIncludePaths";
static const char CONFIG_FRAMEWORKPATHS[] = "frameworkPaths";
+static const char CONFIG_SYSTEM_FRAMEWORKPATHS[] = "systemFrameworkPaths";
static const char CONFIG_PRECOMPILEDHEADER[] = "precompiledHeader";
static const char CONFIGURATION_PATH[] = "<configuration>";
@@ -183,9 +185,15 @@ QStringList QbsProject::files(Project::FilesMode fileMode) const
return QStringList();
QSet<QString> result;
collectFilesForProject(m_rootProjectNode->qbsProjectData(), result);
+ result.unite(qbsProject().buildSystemFiles());
return result.toList();
}
+bool QbsProject::isProjectEditable() const
+{
+ return m_qbsProject.isValid() && !isParsing() && !ProjectExplorer::BuildManager::isBuilding();
+}
+
class ChangeExpector
{
public:
@@ -235,6 +243,7 @@ bool QbsProject::addFilesToProduct(QbsBaseProjectNode *node, const QStringList &
if (notAdded->count() != filePaths.count()) {
m_projectData = m_qbsProject.projectData();
QbsGroupNode::setupFiles(node, allPaths, QFileInfo(productFilePath).absolutePath(), true);
+ m_rootProjectNode->update();
}
return notAdded->isEmpty();
}
@@ -260,6 +269,7 @@ bool QbsProject::removeFilesFromProduct(QbsBaseProjectNode *node, const QStringL
if (notRemoved->count() != filePaths.count()) {
m_projectData = m_qbsProject.projectData();
QbsGroupNode::setupFiles(node, allPaths, QFileInfo(productFilePath).absolutePath(), true);
+ m_rootProjectNode->update();
}
return notRemoved->isEmpty();
}
@@ -494,6 +504,8 @@ void QbsProject::cancelParsing()
void QbsProject::updateAfterBuild()
{
+ QTC_ASSERT(m_qbsProject.isValid(), return);
+ m_projectData = m_qbsProject.projectData();
updateBuildTargetData();
}
@@ -654,6 +666,8 @@ void QbsProject::updateCppCodeModel(const qbs::ProjectData &prj)
list = props.getModulePropertiesAsStringList(QLatin1String(CONFIG_CPP_MODULE),
QLatin1String(CONFIG_INCLUDEPATHS));
+ list.append(props.getModulePropertiesAsStringList(QLatin1String(CONFIG_CPP_MODULE),
+ QLatin1String(CONFIG_SYSTEM_INCLUDEPATHS)));
CppTools::ProjectPart::HeaderPaths grpHeaderPaths;
foreach (const QString &p, list)
grpHeaderPaths += CppTools::ProjectPart::HeaderPath(
@@ -662,6 +676,8 @@ void QbsProject::updateCppCodeModel(const qbs::ProjectData &prj)
list = props.getModulePropertiesAsStringList(QLatin1String(CONFIG_CPP_MODULE),
QLatin1String(CONFIG_FRAMEWORKPATHS));
+ list.append(props.getModulePropertiesAsStringList(QLatin1String(CONFIG_CPP_MODULE),
+ QLatin1String(CONFIG_SYSTEM_FRAMEWORKPATHS)));
foreach (const QString &p, list)
grpHeaderPaths += CppTools::ProjectPart::HeaderPath(
FileName::fromUserInput(p).toString(),
@@ -751,7 +767,7 @@ void QbsProject::updateDeploymentInfo(const qbs::Project &project)
qbs::InstallOptions installOptions;
installOptions.setInstallRoot(QLatin1String("/"));
foreach (const qbs::InstallableFile &f,
- project.installableFilesForProject(project.projectData(), installOptions)) {
+ project.installableFilesForProject(m_projectData, installOptions)) {
deploymentData.addFile(f.sourceFilePath(), f.targetDirectory(), f.isExecutable()
? ProjectExplorer::DeployableFile::TypeExecutable
: ProjectExplorer::DeployableFile::TypeNormal);
@@ -762,7 +778,7 @@ void QbsProject::updateDeploymentInfo(const qbs::Project &project)
void QbsProject::updateBuildTargetData()
{
- updateApplicationTargets(m_qbsProject.projectData());
+ updateApplicationTargets(m_projectData);
updateDeploymentInfo(m_qbsProject);
foreach (Target *t, targets())
t->updateDefaultRunConfigurations();
diff --git a/src/plugins/qbsprojectmanager/qbsproject.h b/src/plugins/qbsprojectmanager/qbsproject.h
index 3106d819fb..75d9f42881 100644
--- a/src/plugins/qbsprojectmanager/qbsproject.h
+++ b/src/plugins/qbsprojectmanager/qbsproject.h
@@ -70,6 +70,7 @@ public:
QStringList files(FilesMode fileMode) const;
+ bool isProjectEditable() const;
bool addFilesToProduct(QbsBaseProjectNode *node, const QStringList &filePaths,
const qbs::ProductData &productData, const qbs::GroupData &groupData,
QStringList *notAdded);
diff --git a/src/plugins/qmldesigner/components/formeditor/dragtool.cpp b/src/plugins/qmldesigner/components/formeditor/dragtool.cpp
index 93f665dfb0..b7a5ff220c 100644
--- a/src/plugins/qmldesigner/components/formeditor/dragtool.cpp
+++ b/src/plugins/qmldesigner/components/formeditor/dragtool.cpp
@@ -234,11 +234,9 @@ void DragTool::dropEvent(const QList<QGraphicsItem*> &/*itemList*/, QGraphicsSce
m_rewriterTransaction.commit();
- if (m_dragNode.isValid()) {
- QList<QmlItemNode> nodeList;
- nodeList.append(m_dragNode);
- view()->setSelectedModelNodes(toModelNodeList(nodeList));
- }
+ if (m_dragNode.isValid())
+ view()->setSelectedModelNode(m_dragNode);
+
m_dragNode = QmlItemNode();
@@ -286,7 +284,6 @@ void DragTool::dragLeaveEvent(const QList<QGraphicsItem*> &/*itemList*/, QGraphi
m_rewriterTransaction.commit();
- view()->clearSelectedModelNodes();
view()->changeToSelectionTool();
}
}
diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp b/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp
index 3780005779..5b7cdca461 100644
--- a/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp
+++ b/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp
@@ -299,7 +299,7 @@ void FormEditorView::propertiesRemoved(const QList<AbstractProperty> &/*property
{
}
-void FormEditorView::customNotification(const AbstractView */*view*/, const QString &identifier, const QList<ModelNode> &/*nodeList*/, const QList<QVariant> &/*data*/)
+void FormEditorView::customNotification(const AbstractView * /*view*/, const QString &identifier, const QList<ModelNode> &/*nodeList*/, const QList<QVariant> &/*data*/)
{
if (identifier == QStringLiteral("puppet crashed"))
m_dragTool->clearMoveDelay();
diff --git a/src/plugins/qmldesigner/components/formeditor/selectiontool.cpp b/src/plugins/qmldesigner/components/formeditor/selectiontool.cpp
index 847879e8b7..3805fe07c9 100644
--- a/src/plugins/qmldesigner/components/formeditor/selectiontool.cpp
+++ b/src/plugins/qmldesigner/components/formeditor/selectiontool.cpp
@@ -251,6 +251,7 @@ void SelectionTool::clear()
m_resizeIndicator.clear();
m_anchorIndicator.clear();
m_bindingIndicator.clear();
+ m_contentNotEditableIndicator.clear();
AbstractFormEditorTool::clear();
}
diff --git a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp
index e967ad9e4c..a32f2504fa 100644
--- a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp
+++ b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp
@@ -578,10 +578,10 @@ static bool removeModelNodeFromNodeProperty(NodeAbstractProperty &parentProperty
{
if (parentProperty.isNodeProperty()) {
- bool removeNodeInPropertySucceeded = true;
+ bool removeNodeInPropertySucceeded = false;
ModelNode propertyNode = parentProperty.toNodeProperty().modelNode();
// Destruction of ancestors is not allowed
- if (!propertyNode.isAncestorOf(modelNode)) {
+ if (modelNode != propertyNode && !propertyNode.isAncestorOf(modelNode)) {
QApplication::setOverrideCursor(Qt::ArrowCursor);
QMessageBox::StandardButton selectedButton = QMessageBox::warning(Core::ICore::dialogParent(),
@@ -658,9 +658,8 @@ void NavigatorTreeModel::moveNodesInteractive(NodeAbstractProperty &parentProper
if (nodeCanBeMovedToParentProperty) {
reparentModelNodeToNodeProperty(parentProperty, modelNode);
+ slideModelNodeInList(parentProperty, modelNode, targetIndex);
}
-
- slideModelNodeInList(parentProperty, modelNode, targetIndex);
}
}
} catch (RewritingException &exception) { //better safe than sorry! There always might be cases where we fail
@@ -708,7 +707,7 @@ void NavigatorTreeModel::handleItemLibraryItemDrop(const QMimeData *mimeData, in
ItemLibraryEntry itemLibraryEntry = itemLibraryEntryFromData(mimeData->data("application/vnd.bauhaus.itemlibraryinfo"));
QmlItemNode newQmlItemNode = QmlItemNode::createQmlItemNode(m_view, itemLibraryEntry, QPointF(0., 0.), targetProperty);
- if (newQmlItemNode.isValid()) {
+ if (newQmlItemNode.isValid() && targetProperty.isNodeListProperty()) {
QList<ModelNode> newModelNodeList;
newModelNodeList.append(newQmlItemNode);
diff --git a/src/plugins/qmldesigner/components/propertyeditor/gradientmodel.cpp b/src/plugins/qmldesigner/components/propertyeditor/gradientmodel.cpp
index f7e89dae5b..7264ac8490 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/gradientmodel.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/gradientmodel.cpp
@@ -94,13 +94,13 @@ QVariant GradientModel::data(const QModelIndex &index, int role) const
return QVariant();
}
-void GradientModel::addStop(qreal position, const QColor &color)
+int GradientModel::addStop(qreal position, const QColor &color)
{
if (m_lock)
- return;
+ return -1;
if (!m_itemNode.isValid() || gradientPropertyName().isEmpty())
- return;
+ return -1;
if (m_itemNode.modelNode().hasNodeProperty(gradientPropertyName().toUtf8())) {
//QmlDesigner::RewriterTransaction transaction = m_itemNode.modelNode().view()->beginRewriterTransaction();
@@ -125,7 +125,11 @@ void GradientModel::addStop(qreal position, const QColor &color)
gradientNode.nodeListProperty("stops").slide(stopNodes.count() - 1, properPos);
setupModel();
+
+ return properPos;
}
+
+ return -1;
}
void GradientModel::addGradient()
diff --git a/src/plugins/qmldesigner/components/propertyeditor/gradientmodel.h b/src/plugins/qmldesigner/components/propertyeditor/gradientmodel.h
index 944d295667..56b6acaf3c 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/gradientmodel.h
+++ b/src/plugins/qmldesigner/components/propertyeditor/gradientmodel.h
@@ -53,7 +53,7 @@ public:
QHash<int, QByteArray> roleNames() const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
- Q_INVOKABLE void addStop(qreal position, const QColor &color);
+ Q_INVOKABLE int addStop(qreal position, const QColor &color);
Q_INVOKABLE void addGradient();
Q_INVOKABLE void setColor(int index, const QColor &color);
diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp
index c4969943a5..1207514ecf 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp
@@ -443,6 +443,11 @@ void PropertyEditorQmlBackend::emitSelectionToBeChanged()
m_backendModelNode.emitSelectionToBeChanged();
}
+void PropertyEditorQmlBackend::emitSelectionChanged()
+{
+ m_backendModelNode.emitSelectionChanged();
+}
+
QUrl PropertyEditorQmlBackend::getQmlUrlForModelNode(const ModelNode &modelNode, TypeName &className)
{
if (modelNode.isValid()) {
diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.h b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.h
index e79caab56a..7c355707c7 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.h
+++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.h
@@ -46,7 +46,12 @@ namespace QmlDesigner {
class PropertyEditorTransaction;
class PropertyEditorView;
-class PropertyEditorQmlBackend {
+class PropertyEditorQmlBackend
+{
+
+ Q_DISABLE_COPY(PropertyEditorQmlBackend)
+
+
public:
PropertyEditorQmlBackend(PropertyEditorView *propertyEditor);
~PropertyEditorQmlBackend();
@@ -75,6 +80,7 @@ public:
static bool checkIfUrlExists(const QUrl &url);
void emitSelectionToBeChanged();
+ void emitSelectionChanged();
private:
void createPropertyEditorValue(const QmlObjectNode &qmlObjectNode,
diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp
index 46e80c9238..25eed26b02 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp
@@ -347,6 +347,9 @@ void PropertyEditorView::resetView()
setupQmlBackend();
+ if (m_qmlBackEndForCurrentType)
+ m_qmlBackEndForCurrentType->emitSelectionChanged();
+
m_locked = false;
if (m_timerId)
diff --git a/src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.cpp b/src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.cpp
index 58e1d71e9e..a662970b59 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.cpp
@@ -55,6 +55,11 @@ void QmlModelNodeProxy::emitSelectionToBeChanged()
emit selectionToBeChanged();
}
+void QmlModelNodeProxy::emitSelectionChanged()
+{
+ selectionChanged();
+}
+
QmlItemNode QmlModelNodeProxy::qmlItemNode() const
{
return m_qmlItemNode;
diff --git a/src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.h b/src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.h
index 3bdb2b84c7..06cc93ba32 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.h
+++ b/src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.h
@@ -50,6 +50,7 @@ public:
static void registerDeclarativeType();
void emitSelectionToBeChanged();
+ void emitSelectionChanged();
QmlItemNode qmlItemNode() const;
@@ -58,6 +59,7 @@ public:
signals:
void modelNodeChanged();
void selectionToBeChanged();
+ void selectionChanged();
public slots:
diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditor.qrc b/src/plugins/qmldesigner/components/stateseditor/stateseditor.qrc
deleted file mode 100644
index c2e935e893..0000000000
--- a/src/plugins/qmldesigner/components/stateseditor/stateseditor.qrc
+++ /dev/null
@@ -1,6 +0,0 @@
-<RCC>
- <qresource prefix="/stateseditor">
- <file>stateslist.qml</file>
- <file>HorizontalScrollBar.qml</file>
- </qresource>
-</RCC>
diff --git a/src/plugins/qmldesigner/componentsplugin/Controls/ButtonSpecifics.qml b/src/plugins/qmldesigner/componentsplugin/Controls/ButtonSpecifics.qml
index df91e3c956..5f415ff0e4 100644
--- a/src/plugins/qmldesigner/componentsplugin/Controls/ButtonSpecifics.qml
+++ b/src/plugins/qmldesigner/componentsplugin/Controls/ButtonSpecifics.qml
@@ -129,7 +129,7 @@ Column {
SecondColumnLayout {
LineEdit {
- backendValue: backendValues.toolTip
+ backendValue: backendValues.tooltip
implicitWidth: 180
}
ExpandingSpacer {
diff --git a/src/plugins/qmldesigner/componentsplugin/Controls/ComboBoxSpecifics.qml b/src/plugins/qmldesigner/componentsplugin/Controls/ComboBoxSpecifics.qml
index a9ac70a878..0fd118c000 100644
--- a/src/plugins/qmldesigner/componentsplugin/Controls/ComboBoxSpecifics.qml
+++ b/src/plugins/qmldesigner/componentsplugin/Controls/ComboBoxSpecifics.qml
@@ -43,21 +43,6 @@ Column {
SectionLayout {
Label {
- text: qsTr("Tool tip")
- toolTip: qsTr("The tool tip shown for the combobox.")
- }
-
- SecondColumnLayout {
- LineEdit {
- backendValue: backendValues.tooltip
- implicitWidth: 180
- }
- ExpandingSpacer {
-
- }
- }
-
- Label {
text: qsTr("Focus on press")
toolTip: "Determines whether the combobox gets focus if pressed."
}
diff --git a/src/plugins/qmldesigner/componentsplugin/addtabdesigneraction.cpp b/src/plugins/qmldesigner/componentsplugin/addtabdesigneraction.cpp
index 742ddcd9d8..f607c37e87 100644
--- a/src/plugins/qmldesigner/componentsplugin/addtabdesigneraction.cpp
+++ b/src/plugins/qmldesigner/componentsplugin/addtabdesigneraction.cpp
@@ -116,7 +116,8 @@ void AddTabDesignerAction::addNewTab()
if (QFileInfo(newFilePath).exists()) {
QMessageBox::warning(Core::ICore::mainWindow(), tr("Naming Error"), tr("Component already exists."));
} else {
- bool fileCreated = DocumentManager::createFile(newFilePath, QStringLiteral("import QtQuick 2.1\nimport QtQuick.Controls 1.0\n\nItem {\n\n}"));
+ const QString sourceString = QStringLiteral("import QtQuick 2.1\nimport QtQuick.Controls 1.0\n\nItem {\n anchors.fill: parent\n}");
+ bool fileCreated = DocumentManager::createFile(newFilePath, sourceString);
if (fileCreated) {
DocumentManager::addFileToVersionControl(directoryPath, newFilePath);
diff --git a/src/plugins/qmldesigner/componentsplugin/components.metainfo b/src/plugins/qmldesigner/componentsplugin/components.metainfo
index fbbfdf13fa..93410ed01e 100644
--- a/src/plugins/qmldesigner/componentsplugin/components.metainfo
+++ b/src/plugins/qmldesigner/componentsplugin/components.metainfo
@@ -278,36 +278,6 @@ MetaInfo {
}
}
-
- Type {
- name: "QtQuick.Controls.ToolBar"
- icon: ":/componentsplugin/images/toolbar16.png"
-
- ItemLibraryEntry {
- name: "Tool Bar"
- category: "Qt Quick - Controls"
- libraryIcon: ":/componentsplugin/images/toolbar.png"
- version: "1.0"
- requiredImport: "QtQuick.Controls"
-
- Property { name: "width"; type: "int"; value: 360; }
- Property { name: "height"; type: "int"; value: 50; }
- }
- }
-
- Type {
- name: "QtQuick.Controls.StatusBar"
- icon: ":/componentsplugin/images/toolbar16.png"
-
- ItemLibraryEntry {
- name: "Status Bar"
- category: "Qt Quick - Controls"
- libraryIcon: ":/componentsplugin/images/toolbar.png"
- version: "1.0"
- requiredImport: "QtQuick.Controls"
- }
- }
-
Type {
name: "QtQuick.Controls.Dial"
//icon: ":/componentsplugin/images/progressbar16.png"
diff --git a/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp b/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp
index 44d3bc8053..fa98d5c97b 100644
--- a/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp
+++ b/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp
@@ -95,9 +95,11 @@ QDateTime PuppetCreator::puppetSourceLastModified() const
sourceDirectoryPathes.append(basePuppetSourcePath + QStringLiteral("/qml2puppet/instances"));
foreach (const QString directoryPath, sourceDirectoryPathes) {
- QDateTime directoryPathLastModified = QFileInfo(directoryPath).lastModified();
- if (lastModified < directoryPathLastModified)
- lastModified = directoryPathLastModified;
+ foreach (const QFileInfo fileEntry, QDir(directoryPath).entryInfoList()) {
+ QDateTime filePathLastModified = fileEntry.lastModified();
+ if (lastModified < filePathLastModified)
+ lastModified = filePathLastModified;
+ }
}
return lastModified;
@@ -130,7 +132,10 @@ QProcess *PuppetCreator::createPuppetProcess(PuppetCreator::QmlPuppetVersion pup
else
puppetPath = qml2PuppetPath(m_availablePuppetType);
+ const QString workingDirectory = qmlPuppetDirectory(m_availablePuppetType);
+
return puppetProcess(puppetPath,
+ workingDirectory,
puppetMode,
socketToken,
handlerObject,
@@ -140,6 +145,7 @@ QProcess *PuppetCreator::createPuppetProcess(PuppetCreator::QmlPuppetVersion pup
QProcess *PuppetCreator::puppetProcess(const QString &puppetPath,
+ const QString &workingDirectory,
const QString &puppetMode,
const QString &socketToken,
QObject *handlerObject,
@@ -156,6 +162,7 @@ QProcess *PuppetCreator::puppetProcess(const QString &puppetPath,
puppetProcess->setProcessChannelMode(QProcess::MergedChannels);
QObject::connect(puppetProcess, SIGNAL(readyRead()), handlerObject, outputSlot);
}
+ puppetProcess->setWorkingDirectory(workingDirectory);
puppetProcess->start(puppetPath, QStringList() << socketToken << puppetMode << "-graphicssystem raster");
if (!qgetenv("DEBUG_QML_PUPPET").isEmpty())
@@ -192,7 +199,9 @@ bool PuppetCreator::build(const QString &qmlPuppetProjectFilePath) const
qmakeArguments.append(QStringLiteral("-r"));
qmakeArguments.append(QStringLiteral("-after"));
qmakeArguments.append(QStringLiteral("DESTDIR=") + qmlPuppetDirectory(UserSpacePuppet));
-#ifndef QT_DEBUG
+#ifdef QT_DEBUG
+ qmakeArguments.append(QStringLiteral("CONFIG+=debug"));
+#else
qmakeArguments.append(QStringLiteral("CONFIG+=release"));
#endif
qmakeArguments.append(qmlPuppetProjectFilePath);
@@ -241,34 +250,31 @@ static void warnAboutInvalidKit()
void PuppetCreator::createQml1PuppetExecutableIfMissing()
{
+ m_availablePuppetType = FallbackPuppet;
+
if (!m_useOnlyFallbackPuppet && m_kit) {
- if (m_qml1PuppetForKitPuppetHash.contains(m_kit->id())) {
- m_availablePuppetType = m_qml1PuppetForKitPuppetHash.value(m_kit->id());
- } else if (checkQmlpuppetIsReady()) {
- m_availablePuppetType = UserSpacePuppet;
+ if (m_qml1PuppetForKitPuppetHash.contains(m_kit->id())) {
+ m_availablePuppetType = m_qml1PuppetForKitPuppetHash.value(m_kit->id());
+ } else if (checkQmlpuppetIsReady()) {
+ m_availablePuppetType = UserSpacePuppet;
+ } else {
+ if (m_kit->isValid()) {
+ bool buildSucceeded = build(qmlPuppetProjectFile());
+ if (buildSucceeded)
+ m_availablePuppetType = UserSpacePuppet;
} else {
- if (m_kit->isValid()) {
-
- bool buildSucceeded = build(qmlPuppetProjectFile());
- if (buildSucceeded)
- m_availablePuppetType = UserSpacePuppet;
- else
- m_availablePuppetType = FallbackPuppet;
- } else {
- warnAboutInvalidKit();
- m_availablePuppetType = FallbackPuppet;
- }
- m_qml1PuppetForKitPuppetHash.insert(m_kit->id(), m_availablePuppetType);
+ warnAboutInvalidKit();
}
- } else {
- m_availablePuppetType = FallbackPuppet;
+ m_qml1PuppetForKitPuppetHash.insert(m_kit->id(), m_availablePuppetType);
+ }
}
}
void PuppetCreator::createQml2PuppetExecutableIfMissing()
{
- if (!m_useOnlyFallbackPuppet && m_kit) {
+ m_availablePuppetType = FallbackPuppet;
+ if (!m_useOnlyFallbackPuppet && m_kit) {
if (m_qml2PuppetForKitPuppetHash.contains(m_kit->id())) {
m_availablePuppetType = m_qml2PuppetForKitPuppetHash.value(m_kit->id());
} else if (checkQml2PuppetIsReady()) {
@@ -278,16 +284,11 @@ void PuppetCreator::createQml2PuppetExecutableIfMissing()
bool buildSucceeded = build(qml2PuppetProjectFile());
if (buildSucceeded)
m_availablePuppetType = UserSpacePuppet;
- else
- m_availablePuppetType = FallbackPuppet;
} else {
warnAboutInvalidKit();
- m_availablePuppetType = FallbackPuppet;
}
m_qml2PuppetForKitPuppetHash.insert(m_kit->id(), m_availablePuppetType);
}
- } else {
- m_availablePuppetType = FallbackPuppet;
}
}
diff --git a/src/plugins/qmldesigner/designercore/instances/puppetcreator.h b/src/plugins/qmldesigner/designercore/instances/puppetcreator.h
index 31bc499c43..4c9b8c337b 100644
--- a/src/plugins/qmldesigner/designercore/instances/puppetcreator.h
+++ b/src/plugins/qmldesigner/designercore/instances/puppetcreator.h
@@ -94,6 +94,7 @@ protected:
bool qtIsSupported() const;
static bool checkPuppetVersion(const QString &qmlPuppetPath);
QProcess *puppetProcess(const QString &puppetPath,
+ const QString &workingDirectory,
const QString &puppetMode,
const QString &socketToken,
QObject *handlerObject,
diff --git a/src/plugins/qmldesigner/designercore/model/modelnode.cpp b/src/plugins/qmldesigner/designercore/model/modelnode.cpp
index 533b879b04..88d38d083d 100644
--- a/src/plugins/qmldesigner/designercore/model/modelnode.cpp
+++ b/src/plugins/qmldesigner/designercore/model/modelnode.cpp
@@ -1061,9 +1061,27 @@ bool ModelNode::isComponent() const
}
if (metaInfo().isSubclassOf("QtQuick.Loader", -1 , -1)) {
- if (hasNodeProperty("component")
- && nodeProperty("component").modelNode().nodeSourceType() == ModelNode::NodeWithComponentSource)
- return true;
+
+ if (hasNodeListProperty("component")) {
+
+ /*
+ * The component property should be a NodeProperty, but currently is a NodeListProperty, because
+ * the default property is always implcitly a NodeListProperty. This is something that has to be fixed.
+ */
+
+ ModelNode componentNode = nodeListProperty("component").toModelNodeList().first();
+ if (componentNode.nodeSourceType() == ModelNode::NodeWithComponentSource)
+ return true;
+ if (componentNode.metaInfo().isFileComponent())
+ return true;
+ }
+
+ if (hasNodeProperty("sourceComponent")) {
+ if (nodeProperty("sourceComponent").modelNode().nodeSourceType() == ModelNode::NodeWithComponentSource)
+ return true;
+ if (nodeProperty("sourceComponent").modelNode().metaInfo().isFileComponent())
+ return true;
+ }
if (hasVariantProperty("source"))
return true;
diff --git a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp
index 7807e91aad..64d91e80fe 100644
--- a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp
+++ b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp
@@ -65,7 +65,9 @@ namespace {
static inline QStringList supportedVersionsList()
{
QStringList list;
- list << QStringLiteral("1.0") << QStringLiteral("1.1") << QStringLiteral("2.0") << QStringLiteral("2.1") << QStringLiteral("2.2");
+ list << QStringLiteral("1.0") << QStringLiteral("1.1")
+ << QStringLiteral("2.0") << QStringLiteral("2.1")
+ << QStringLiteral("2.2") << QStringLiteral("2.3");
return list;
}
@@ -747,6 +749,10 @@ static bool isBlacklistImport(const ImportKey &importKey)
|| importPathFirst == QStringLiteral("QtQml")
|| (importPathFirst == QStringLiteral("QtQuick") && importPathLast == QStringLiteral("PrivateWidgets"))
|| importPathLast == QStringLiteral("Private")
+ || importKey.libraryQualifiedPath() == QStringLiteral("QtQuick.Particles") //Unsupported
+ || importKey.libraryQualifiedPath() == QStringLiteral("QtQuick.Dialogs") //Unsupported
+ || importKey.libraryQualifiedPath() == QStringLiteral("QtQuick.Controls.Styles") //Unsupported
+ || importKey.libraryQualifiedPath().contains(QStringLiteral("Qt.labs")) //No support for labs plugins
|| (importKey.splitPath.count() == 1 && importPathFirst == QStringLiteral("QtQuick")); // Don't show Quick X.X imports
}
diff --git a/src/plugins/qmldesigner/documentmanager.cpp b/src/plugins/qmldesigner/documentmanager.cpp
index 88ab5a4556..0ba3dfa90e 100644
--- a/src/plugins/qmldesigner/documentmanager.cpp
+++ b/src/plugins/qmldesigner/documentmanager.cpp
@@ -34,6 +34,7 @@
#include <qmlitemnode.h>
#include <nodemetainfo.h>
#include <nodeproperty.h>
+#include <nodelistproperty.h>
#include <bindingproperty.h>
#include <variantproperty.h>
@@ -120,6 +121,34 @@ static void openFileComponentForDelegate(const ModelNode &modelNode)
openFileComponent(modelNode.nodeProperty("delegate").modelNode());
}
+static void openComponentSourcePropertyOfLoader(const ModelNode &modelNode)
+{
+ QmlDesignerPlugin::instance()->viewManager().nextFileIsCalledInternally();
+
+ QHash<PropertyName, QVariant> propertyHash;
+
+ getProperties(modelNode, propertyHash);
+
+ ModelNode componentModelNode;
+
+ if (modelNode.hasNodeProperty("sourceComponent")) {
+ componentModelNode = modelNode.nodeProperty("sourceComponent").modelNode();
+ } else if (modelNode.hasNodeListProperty("component")) {
+
+ /*
+ * The component property should be a NodeProperty, but currently is a NodeListProperty, because
+ * the default property is always implcitly a NodeListProperty. This is something that has to be fixed.
+ */
+
+ componentModelNode = modelNode.nodeListProperty("component").toModelNodeList().first();
+ }
+
+ Core::EditorManager::openEditor(componentModelNode.metaInfo().componentFileName(), Core::Id(), Core::EditorManager::DoNotMakeVisible);
+
+ ModelNode rootModelNode = currentDesignDocument()->rewriterView()->rootModelNode();
+ applyProperties(rootModelNode, propertyHash);
+}
+
static void openSourcePropertyOfLoader(const ModelNode &modelNode)
{
QmlDesignerPlugin::instance()->viewManager().nextFileIsCalledInternally();
@@ -202,6 +231,22 @@ static bool hasDelegateWithFileComponent(const ModelNode &node)
return false;
}
+static bool isLoaderWithSourceComponent(const ModelNode &modelNode)
+{
+ if (modelNode.isValid()
+ && modelNode.metaInfo().isValid()
+ && modelNode.metaInfo().isSubclassOf("QtQuick.Loader", -1, -1)) {
+
+ if (modelNode.hasNodeProperty("sourceComponent"))
+ return true;
+ if (modelNode.hasNodeListProperty("component"))
+ return true;
+ }
+
+ return false;
+
+}
+
static bool hasSourceWithFileComponent(const ModelNode &modelNode)
{
if (modelNode.isValid()
@@ -265,6 +310,8 @@ void DocumentManager::goIntoComponent(const ModelNode &modelNode)
openFileComponentForDelegate(modelNode);
else if (hasSourceWithFileComponent(modelNode))
openSourcePropertyOfLoader(modelNode);
+ else if (isLoaderWithSourceComponent(modelNode))
+ openComponentSourcePropertyOfLoader(modelNode);
else
openInlineComponent(modelNode);
}
diff --git a/src/plugins/qmldesigner/qmldesignerplugin.pro b/src/plugins/qmldesigner/qmldesignerplugin.pro
index c2512a171d..190a8d6582 100644
--- a/src/plugins/qmldesigner/qmldesignerplugin.pro
+++ b/src/plugins/qmldesigner/qmldesignerplugin.pro
@@ -3,6 +3,8 @@ CONFIG += exceptions
INCLUDEPATH += $$PWD
+unix:!osx:LIBS += -lrt # posix shared memory
+
include(../../qtcreatorplugin.pri)
include(designercore/designercore-lib.pri)
diff --git a/src/plugins/qmldesigner/qtquickplugin/quick.metainfo b/src/plugins/qmldesigner/qtquickplugin/quick.metainfo
index bd8a6b2dc1..6aeb725db7 100644
--- a/src/plugins/qmldesigner/qtquickplugin/quick.metainfo
+++ b/src/plugins/qmldesigner/qtquickplugin/quick.metainfo
@@ -243,31 +243,6 @@ MetaInfo {
}
Type {
- name: "QtQuick.Flipable"
- icon: ":/qtquickplugin/images/flipable-icon16.png"
-
- ItemLibraryEntry {
- name: "Flipable"
- category: "Qt Quick - Basic"
- libraryIcon: ":/qtquickplugin/images/flipable-icon.png"
- version: "1.0"
-
- Property { name: "width"; type: "int"; value: 200; }
- Property { name: "height"; type: "int"; value: 200; }
- }
-
- ItemLibraryEntry {
- name: "Flipable"
- category: "Qt Quick - Basic"
- libraryIcon: ":/qtquickplugin/images/flipable-icon.png"
- version: "2.0"
-
- Property { name: "width"; type: "int"; value: 200; }
- Property { name: "height"; type: "int"; value: 200; }
- }
- }
-
- Type {
name: "QtQuick.GridView"
icon: ":/qtquickplugin/images/gridview-icon16.png"
diff --git a/src/plugins/qmldesigner/shortcutmanager.cpp b/src/plugins/qmldesigner/shortcutmanager.cpp
index f562bee2c3..a5852a4f84 100644
--- a/src/plugins/qmldesigner/shortcutmanager.cpp
+++ b/src/plugins/qmldesigner/shortcutmanager.cpp
@@ -115,36 +115,36 @@ void ShortCutManager::registerActions(const Core::Context &qmlDesignerMainContex
//Edit Menu
- command = Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_BACKSPACE, qmlDesignerFormEditorContext);
+ Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_BACKSPACE, qmlDesignerFormEditorContext);
command = Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_BACKSPACE, qmlDesignerNavigatorContext);
command->setDefaultKeySequence(QKeySequence(Qt::Key_Backspace));
command->setAttribute(Core::Command::CA_Hide); // don't show delete in other modes
if (Utils::HostOsInfo::isMacHost())
editMenu->addAction(command, Core::Constants::G_EDIT_COPYPASTE);
- command = Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_DELETE, qmlDesignerFormEditorContext);
+ Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_DELETE, qmlDesignerFormEditorContext);
command = Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_DELETE, qmlDesignerNavigatorContext);
command->setDefaultKeySequence(QKeySequence::Delete);
command->setAttribute(Core::Command::CA_Hide); // don't show delete in other modes
if (!Utils::HostOsInfo::isMacHost())
editMenu->addAction(command, Core::Constants::G_EDIT_COPYPASTE);
- command = Core::ActionManager::registerAction(&m_cutAction, Core::Constants::CUT, qmlDesignerFormEditorContext);
+ Core::ActionManager::registerAction(&m_cutAction, Core::Constants::CUT, qmlDesignerFormEditorContext);
command = Core::ActionManager::registerAction(&m_cutAction, Core::Constants::CUT, qmlDesignerNavigatorContext);
command->setDefaultKeySequence(QKeySequence::Cut);
editMenu->addAction(command, Core::Constants::G_EDIT_COPYPASTE);
- command = Core::ActionManager::registerAction(&m_copyAction, Core::Constants::COPY, qmlDesignerFormEditorContext);
+ Core::ActionManager::registerAction(&m_copyAction, Core::Constants::COPY, qmlDesignerFormEditorContext);
command = Core::ActionManager::registerAction(&m_copyAction, Core::Constants::COPY, qmlDesignerNavigatorContext);
command->setDefaultKeySequence(QKeySequence::Copy);
editMenu->addAction(command, Core::Constants::G_EDIT_COPYPASTE);
- command = Core::ActionManager::registerAction(&m_pasteAction, Core::Constants::PASTE, qmlDesignerFormEditorContext);
+ Core::ActionManager::registerAction(&m_pasteAction, Core::Constants::PASTE, qmlDesignerFormEditorContext);
command = Core::ActionManager::registerAction(&m_pasteAction, Core::Constants::PASTE, qmlDesignerNavigatorContext);
command->setDefaultKeySequence(QKeySequence::Paste);
editMenu->addAction(command, Core::Constants::G_EDIT_COPYPASTE);
- command = Core::ActionManager::registerAction(&m_selectAllAction, Core::Constants::SELECTALL, qmlDesignerFormEditorContext);
+ Core::ActionManager::registerAction(&m_selectAllAction, Core::Constants::SELECTALL, qmlDesignerFormEditorContext);
command = Core::ActionManager::registerAction(&m_selectAllAction, Core::Constants::SELECTALL, qmlDesignerNavigatorContext);
command->setDefaultKeySequence(QKeySequence::SelectAll);
@@ -166,7 +166,7 @@ void ShortCutManager::registerActions(const Core::Context &qmlDesignerMainContex
command->setAttribute(Core::Command::CA_Hide);
viewsMenu->addAction(command);
- command = Core::ActionManager::registerAction(&m_hideSidebarsAction, Core::Constants::TOGGLE_SIDEBAR, qmlDesignerMainContext);
+ Core::ActionManager::registerAction(&m_hideSidebarsAction, Core::Constants::TOGGLE_SIDEBAR, qmlDesignerMainContext);
}
void ShortCutManager::updateActions(Core::IEditor* currentEditor)
diff --git a/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp b/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp
index b4c59360b2..ec2a9819d5 100644
--- a/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp
@@ -96,6 +96,7 @@ void QmlProfilerViewManager::createViews()
this,
d->profilerModelManager,
d->profilerState);
+ d->traceView->setWindowTitle(tr("Timeline"));
connect(d->traceView, SIGNAL(gotoSourceLocation(QString,int,int)),
this, SIGNAL(gotoSourceLocation(QString,int,int)));
d->traceView->reset();
@@ -103,6 +104,7 @@ void QmlProfilerViewManager::createViews()
d->eventsView = new QmlProfilerEventsWidget(mw, d->profilerTool, this,
d->profilerModelManager);
+ d->eventsView->setWindowTitle(tr("Events"));
connect(d->eventsView, SIGNAL(gotoSourceLocation(QString,int,int)), this,
SIGNAL(gotoSourceLocation(QString,int,int)));
connect(d->eventsView, SIGNAL(eventSelectedByTypeIndex(int)),
@@ -112,6 +114,7 @@ void QmlProfilerViewManager::createViews()
d->v8profilerView = new QV8ProfilerEventsWidget(mw, d->profilerTool, this,
d->profilerModelManager);
+ d->v8profilerView->setWindowTitle(tr("JavaScript"));
connect(d->v8profilerView, SIGNAL(gotoSourceLocation(QString,int,int)), this,
SIGNAL(gotoSourceLocation(QString,int,int)));
connect(d->traceView, SIGNAL(gotoSourceLocation(QString,int,int)),
@@ -124,11 +127,11 @@ void QmlProfilerViewManager::createViews()
d->v8profilerView, SLOT(selectBySourceLocation(QString,int,int)));
QDockWidget *eventsDock = AnalyzerManager::createDockWidget
- (d->profilerTool, tr("Events"), d->eventsView, Qt::BottomDockWidgetArea);
+ (d->profilerTool, d->eventsView);
QDockWidget *timelineDock = AnalyzerManager::createDockWidget
- (d->profilerTool, tr("Timeline"), d->traceView, Qt::BottomDockWidgetArea);
- QDockWidget *v8profilerDock = AnalyzerManager::createDockWidget(
- d->profilerTool, tr("JavaScript"), d->v8profilerView, Qt::BottomDockWidgetArea);
+ (d->profilerTool, d->traceView);
+ QDockWidget *v8profilerDock = AnalyzerManager::createDockWidget
+ (d->profilerTool, d->v8profilerView);
eventsDock->show();
timelineDock->show();
diff --git a/src/plugins/qtsupport/customexecutableconfigurationwidget.cpp b/src/plugins/qtsupport/customexecutableconfigurationwidget.cpp
index 7202a7b650..be0a4c5e2a 100644
--- a/src/plugins/qtsupport/customexecutableconfigurationwidget.cpp
+++ b/src/plugins/qtsupport/customexecutableconfigurationwidget.cpp
@@ -47,7 +47,7 @@
namespace QtSupport {
namespace Internal {
-CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomExecutableRunConfiguration *rc)
+CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomExecutableRunConfiguration *rc, ApplyMode mode)
: m_ignoreChange(false), m_runConfiguration(rc)
{
QFormLayout *layout = new QFormLayout;
@@ -86,14 +86,25 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE
changed();
- connect(m_executableChooser, SIGNAL(changed(QString)),
- this, SLOT(executableEdited()));
- connect(m_commandLineArgumentsLineEdit, SIGNAL(textEdited(QString)),
- this, SLOT(argumentsEdited(QString)));
- connect(m_workingDirectory, SIGNAL(changed(QString)),
- this, SLOT(workingDirectoryEdited()));
- connect(m_useTerminalCheck, SIGNAL(toggled(bool)),
- this, SLOT(termToggled(bool)));
+ if (mode == InstantApply) {
+ connect(m_executableChooser, SIGNAL(changed(QString)),
+ this, SLOT(executableEdited()));
+ connect(m_commandLineArgumentsLineEdit, SIGNAL(textEdited(QString)),
+ this, SLOT(argumentsEdited(QString)));
+ connect(m_workingDirectory, SIGNAL(changed(QString)),
+ this, SLOT(workingDirectoryEdited()));
+ connect(m_useTerminalCheck, SIGNAL(toggled(bool)),
+ this, SLOT(termToggled(bool)));
+ } else {
+ connect(m_executableChooser, SIGNAL(changed(QString)),
+ this, SIGNAL(validChanged()));
+ connect(m_commandLineArgumentsLineEdit, SIGNAL(textEdited(QString)),
+ this, SIGNAL(validChanged()));
+ connect(m_workingDirectory, SIGNAL(changed(QString)),
+ this, SIGNAL(validChanged()));
+ connect(m_useTerminalCheck, SIGNAL(toggled(bool)),
+ this, SIGNAL(validChanged()));
+ }
ProjectExplorer::EnvironmentAspect *aspect = rc->extraAspect<ProjectExplorer::EnvironmentAspect>();
if (aspect) {
@@ -101,7 +112,11 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE
environmentWasChanged();
}
- connect(m_runConfiguration, SIGNAL(changed()), this, SLOT(changed()));
+ // If we are in mode InstantApply, we keep us in sync with the rc
+ // otherwise we ignore changes to the rc and override them on apply,
+ // or keep them on cancel
+ if (mode == InstantApply)
+ connect(m_runConfiguration, SIGNAL(changed()), this, SLOT(changed()));
}
void CustomExecutableConfigurationWidget::environmentWasChanged()
@@ -153,5 +168,21 @@ void CustomExecutableConfigurationWidget::changed()
== ProjectExplorer::ApplicationLauncher::Console);
}
+void CustomExecutableConfigurationWidget::apply()
+{
+ m_ignoreChange = true;
+ m_runConfiguration->setExecutable(m_executableChooser->rawPath());
+ m_runConfiguration->setCommandLineArguments(m_commandLineArgumentsLineEdit->text());
+ m_runConfiguration->setBaseWorkingDirectory(m_workingDirectory->rawPath());
+ m_runConfiguration->setRunMode(m_useTerminalCheck->isChecked() ? ProjectExplorer::ApplicationLauncher::Console
+ : ProjectExplorer::ApplicationLauncher::Gui);
+ m_ignoreChange = false;
+}
+
+bool CustomExecutableConfigurationWidget::isValid() const
+{
+ return !m_executableChooser->rawPath().isEmpty();
+}
+
} // namespace Internal
} // namespace QtSupport
diff --git a/src/plugins/qtsupport/customexecutableconfigurationwidget.h b/src/plugins/qtsupport/customexecutableconfigurationwidget.h
index b0990a1e8b..568a13852d 100644
--- a/src/plugins/qtsupport/customexecutableconfigurationwidget.h
+++ b/src/plugins/qtsupport/customexecutableconfigurationwidget.h
@@ -55,7 +55,13 @@ class CustomExecutableConfigurationWidget : public QWidget
Q_OBJECT
public:
- CustomExecutableConfigurationWidget(CustomExecutableRunConfiguration *rc);
+ enum ApplyMode { InstantApply, DelayedApply};
+ CustomExecutableConfigurationWidget(CustomExecutableRunConfiguration *rc, ApplyMode mode);
+ void apply(); // only used for DelayedApply
+
+ bool isValid() const;
+signals:
+ void validChanged();
private slots:
void changed();
diff --git a/src/plugins/qtsupport/customexecutablerunconfiguration.cpp b/src/plugins/qtsupport/customexecutablerunconfiguration.cpp
index 8de9ce2ae2..e134ff83d6 100644
--- a/src/plugins/qtsupport/customexecutablerunconfiguration.cpp
+++ b/src/plugins/qtsupport/customexecutablerunconfiguration.cpp
@@ -71,7 +71,8 @@ void CustomExecutableRunConfiguration::ctor()
CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Target *parent) :
LocalApplicationRunConfiguration(parent, Core::Id(CUSTOM_EXECUTABLE_ID)),
m_workingDirectory(QLatin1String(Constants::DEFAULT_WORKING_DIR)),
- m_runMode(ProjectExplorer::ApplicationLauncher::Gui)
+ m_runMode(ProjectExplorer::ApplicationLauncher::Gui),
+ m_dialog(0)
{
addExtraAspect(new LocalEnvironmentAspect(this));
@@ -86,7 +87,8 @@ CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Target *paren
m_executable(source->m_executable),
m_workingDirectory(source->m_workingDirectory),
m_cmdArguments(source->m_cmdArguments),
- m_runMode(source->m_runMode)
+ m_runMode(source->m_runMode),
+ m_dialog(0)
{
ctor();
}
@@ -94,6 +96,12 @@ CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Target *paren
// Note: Qt4Project deletes all empty customexecrunconfigs for which isConfigured() == false.
CustomExecutableRunConfiguration::~CustomExecutableRunConfiguration()
{
+ if (m_dialog) {
+ emit configurationFinished();
+ disconnect(m_dialog, SIGNAL(finished(int)),
+ this, SLOT(configurationDialogFinished()));
+ delete m_dialog;
+ }
}
// Dialog embedding the CustomExecutableConfigurationWidget
@@ -104,10 +112,12 @@ class CustomExecutableDialog : public QDialog
public:
explicit CustomExecutableDialog(CustomExecutableRunConfiguration *rc, QWidget *parent = 0);
+ void accept();
+
private slots:
void changed()
{
- setOkButtonEnabled(m_runConfiguration->isConfigured());
+ setOkButtonEnabled(m_widget->isValid());
}
private:
@@ -117,6 +127,7 @@ private:
}
QDialogButtonBox *m_dialogButtonBox;
+ CustomExecutableConfigurationWidget *m_widget;
CustomExecutableRunConfiguration *m_runConfiguration;
};
@@ -125,15 +136,15 @@ CustomExecutableDialog::CustomExecutableDialog(CustomExecutableRunConfiguration
, m_dialogButtonBox(new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel))
, m_runConfiguration(rc)
{
- connect(rc, SIGNAL(changed()), this, SLOT(changed()));
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
QVBoxLayout *layout = new QVBoxLayout(this);
QLabel *label = new QLabel(tr("Could not find the executable, please specify one."));
label->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
layout->addWidget(label);
- QWidget *configWidget = rc->createConfigurationWidget();
- configWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
- layout->addWidget(configWidget);
+ m_widget = new CustomExecutableConfigurationWidget(rc, CustomExecutableConfigurationWidget::DelayedApply);
+ m_widget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
+ connect(m_widget, SIGNAL(validChanged()), this, SLOT(changed()));
+ layout->addWidget(m_widget);
setOkButtonEnabled(false);
connect(m_dialogButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(m_dialogButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
@@ -141,30 +152,39 @@ CustomExecutableDialog::CustomExecutableDialog(CustomExecutableRunConfiguration
layout->setSizeConstraint(QLayout::SetMinAndMaxSize);
}
-bool CustomExecutableRunConfiguration::ensureConfigured(QString *errorMessage)
-{
- if (isConfigured())
- return validateExecutable(0, errorMessage);
- CustomExecutableDialog dialog(this, Core::ICore::mainWindow());
- dialog.setWindowTitle(displayName());
- const QString oldExecutable = m_executable;
- const QString oldWorkingDirectory = m_workingDirectory;
- const QString oldCmdArguments = m_cmdArguments;
- if (dialog.exec() == QDialog::Accepted)
- return validateExecutable(0, errorMessage);
- // User canceled: Hack: Silence the error dialog.
- if (errorMessage)
- *errorMessage = QLatin1String("");
- // Restore values changed by the configuration widget.
- if (m_executable != oldExecutable
- || m_workingDirectory != oldWorkingDirectory
- || m_cmdArguments != oldCmdArguments) {
- m_executable = oldExecutable;
- m_workingDirectory = oldWorkingDirectory;
- m_cmdArguments = oldCmdArguments;
- emit changed();
+void CustomExecutableDialog::accept()
+{
+ m_widget->apply();
+ QDialog::accept();
+}
+
+// CustomExecutableRunConfiguration
+
+RunConfiguration::ConfigurationState CustomExecutableRunConfiguration::ensureConfigured(QString *errorMessage)
+{
+ Q_UNUSED(errorMessage)
+ if (m_dialog) {// uhm already shown
+ *errorMessage = QLatin1String(""); // no error dialog
+ m_dialog->activateWindow();
+ m_dialog->raise();
+ return UnConfigured;
}
- return false;
+
+ m_dialog = new CustomExecutableDialog(this, Core::ICore::mainWindow());
+ connect(m_dialog, SIGNAL(finished(int)),
+ this, SLOT(configurationDialogFinished()));
+ m_dialog->setWindowTitle(displayName()); // pretty pointless
+ m_dialog->show();
+ return Waiting;
+}
+
+void CustomExecutableRunConfiguration::configurationDialogFinished()
+{
+ disconnect(m_dialog, SIGNAL(finished(int)),
+ this, SLOT(configurationDialogFinished()));
+ m_dialog->deleteLater();
+ m_dialog = 0;
+ emit configurationFinished();
}
// Search the executable in the path.
@@ -301,7 +321,7 @@ void CustomExecutableRunConfiguration::setRunMode(ApplicationLauncher::Mode runM
QWidget *CustomExecutableRunConfiguration::createConfigurationWidget()
{
- return new CustomExecutableConfigurationWidget(this);
+ return new CustomExecutableConfigurationWidget(this, CustomExecutableConfigurationWidget::InstantApply);
}
Abi CustomExecutableRunConfiguration::abi() const
diff --git a/src/plugins/qtsupport/customexecutablerunconfiguration.h b/src/plugins/qtsupport/customexecutablerunconfiguration.h
index 38c5f2efeb..314291f1eb 100644
--- a/src/plugins/qtsupport/customexecutablerunconfiguration.h
+++ b/src/plugins/qtsupport/customexecutablerunconfiguration.h
@@ -74,7 +74,7 @@ public:
QVariantMap toMap() const;
- bool ensureConfigured(QString *errorMessage);
+ ConfigurationState ensureConfigured(QString *errorMessage);
signals:
void changed();
@@ -85,6 +85,8 @@ protected:
virtual bool fromMap(const QVariantMap &map);
QString defaultDisplayName() const;
+private slots:
+ void configurationDialogFinished();
private:
void ctor();
@@ -102,6 +104,7 @@ private:
QString m_workingDirectory;
QString m_cmdArguments;
ProjectExplorer::ApplicationLauncher::Mode m_runMode;
+ QWidget *m_dialog;
};
class CustomExecutableRunConfigurationFactory : public ProjectExplorer::IRunConfigurationFactory
diff --git a/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp b/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp
index e046be1986..2d49f4f36b 100644
--- a/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp
+++ b/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.cpp
@@ -119,16 +119,17 @@ bool RemoteLinuxCustomRunConfiguration::isConfigured() const
return !m_remoteExecutable.isEmpty();
}
-bool RemoteLinuxCustomRunConfiguration::ensureConfigured(QString *errorMessage)
+ProjectExplorer::RunConfiguration::ConfigurationState
+RemoteLinuxCustomRunConfiguration::ensureConfigured(QString *errorMessage)
{
if (!isConfigured()) {
if (errorMessage) {
*errorMessage = tr("The remote executable must be set "
"in order to run a custom remote run configuration.");
}
- return false;
+ return UnConfigured;
}
- return true;
+ return Configured;
}
QWidget *RemoteLinuxCustomRunConfiguration::createConfigurationWidget()
diff --git a/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.h b/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.h
index 97867ad871..87c18b0026 100644
--- a/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.h
+++ b/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.h
@@ -48,7 +48,7 @@ public:
bool isEnabled() const { return true; }
bool isConfigured() const;
- bool ensureConfigured(QString *errorMessage);
+ ConfigurationState ensureConfigured(QString *errorMessage);
QWidget *createConfigurationWidget();
Utils::OutputFormatter *createOutputFormatter() const;
diff --git a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
index 11a5f0df52..58cd4e5c13 100644
--- a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
+++ b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
@@ -178,9 +178,10 @@ void LinuxDeviceDebugSupport::startExecution()
command = device()->debugServerPath();
if (command.isEmpty())
command = QLatin1String("gdbserver");
- args.prepend(QString::fromLatin1(":%1").arg(d->gdbServerPort));
- args.prepend(QString::fromLatin1("--multi"));
- args.prepend(QString::fromLatin1("--once"));
+ args.clear();
+ args.append(QString::fromLatin1("--once"));
+ args.append(QString::fromLatin1("--multi"));
+ args.append(QString::fromLatin1(":%1").arg(d->gdbServerPort));
}
connect(runner, SIGNAL(finished(bool)), SLOT(handleAppRunnerFinished(bool)));
diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp
index 5fc046b03e..81f6036a26 100644
--- a/src/plugins/valgrind/callgrindtool.cpp
+++ b/src/plugins/valgrind/callgrindtool.cpp
@@ -588,12 +588,14 @@ QWidget *CallgrindToolPrivate::createWidgets()
m_visualisation = new Visualisation(mw);
m_visualisation->setFrameStyle(QFrame::NoFrame);
m_visualisation->setObjectName(QLatin1String("Valgrind.CallgrindTool.Visualisation"));
+ m_visualisation->setWindowTitle(tr("Visualization"));
m_visualisation->setModel(m_dataModel);
connect(m_visualisation, SIGNAL(functionActivated(const Valgrind::Callgrind::Function*)),
this, SLOT(visualisationFunctionSelected(const Valgrind::Callgrind::Function*)));
m_callersView = new CostView(mw);
m_callersView->setObjectName(QLatin1String("Valgrind.CallgrindTool.CallersView"));
+ m_callersView->setWindowTitle(tr("Callers"));
m_callersView->setSettings(coreSettings, "Valgrind.CallgrindTool.CallersView");
m_callersView->sortByColumn(CallModel::CostColumn);
m_callersView->setFrameStyle(QFrame::NoFrame);
@@ -607,6 +609,7 @@ QWidget *CallgrindToolPrivate::createWidgets()
m_calleesView = new CostView(mw);
m_calleesView->setObjectName(QLatin1String("Valgrind.CallgrindTool.CalleesView"));
+ m_calleesView->setWindowTitle(tr("Callees"));
m_calleesView->setSettings(coreSettings, "Valgrind.CallgrindTool.CalleesView");
m_calleesView->sortByColumn(CallModel::CostColumn);
m_calleesView->setFrameStyle(QFrame::NoFrame);
@@ -620,6 +623,7 @@ QWidget *CallgrindToolPrivate::createWidgets()
m_flatView = new CostView(mw);
m_flatView->setObjectName(QLatin1String("Valgrind.CallgrindTool.FlatView"));
+ m_flatView->setWindowTitle(tr("Functions"));
m_flatView->setSettings(coreSettings, "Valgrind.CallgrindTool.FlatView");
m_flatView->sortByColumn(DataModel::SelfCostColumn);
m_flatView->setFrameStyle(QFrame::NoFrame);
@@ -630,17 +634,11 @@ QWidget *CallgrindToolPrivate::createWidgets()
updateCostFormat();
- QDockWidget *callersDock = AnalyzerManager::createDockWidget
- (q, tr("Callers"), m_callersView, Qt::BottomDockWidgetArea);
-
- QDockWidget *flatDock = AnalyzerManager::createDockWidget
- (q, tr("Functions"), m_flatView, Qt::BottomDockWidgetArea);
-
- QDockWidget *calleesDock = AnalyzerManager::createDockWidget
- (q, tr("Callees"), m_calleesView, Qt::BottomDockWidgetArea);
-
+ QDockWidget *callersDock = AnalyzerManager::createDockWidget(q, m_callersView);
+ QDockWidget *flatDock = AnalyzerManager::createDockWidget(q, m_flatView);
+ QDockWidget *calleesDock = AnalyzerManager::createDockWidget(q, m_calleesView);
QDockWidget *visualizationDock = AnalyzerManager::createDockWidget
- (q, tr("Visualization"), m_visualisation, Qt::RightDockWidgetArea);
+ (q, m_visualisation, Qt::RightDockWidgetArea);
callersDock->show();
calleesDock->show();
diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp
index 9d7197db7a..67a40c38f3 100644
--- a/src/plugins/valgrind/memchecktool.cpp
+++ b/src/plugins/valgrind/memchecktool.cpp
@@ -357,9 +357,9 @@ QWidget *MemcheckTool::createWidgets()
m_errorView->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
m_errorView->setAutoScroll(false);
m_errorView->setObjectName(QLatin1String("Valgrind.MemcheckTool.ErrorView"));
+ m_errorView->setWindowTitle(tr("Memory Issues"));
- QDockWidget *errorDock = AnalyzerManager::createDockWidget
- (this, tr("Memory Issues"), m_errorView, Qt::BottomDockWidgetArea);
+ QDockWidget *errorDock = AnalyzerManager::createDockWidget(this, m_errorView);
errorDock->show();
mw->splitDockWidget(mw->toolBarDockWidget(), errorDock, Qt::Vertical);
diff --git a/src/plugins/vcsbase/commonsettingspage.ui b/src/plugins/vcsbase/commonsettingspage.ui
index b0c2d6f07b..c8b894c8d3 100644
--- a/src/plugins/vcsbase/commonsettingspage.ui
+++ b/src/plugins/vcsbase/commonsettingspage.ui
@@ -72,7 +72,7 @@
<item row="3" column="0">
<widget class="QLabel" name="nickNameMailMapLabel">
<property name="toolTip">
- <string>A file listing user names and email addresses in a 4-column mailmap format:
+ <string>A file listing nicknames in a 4-column mailmap format:
'name &lt;email&gt; alias &lt;email&gt;'.</string>
</property>
<property name="text">
diff --git a/src/plugins/vcsbase/nicknamedialog.cpp b/src/plugins/vcsbase/nicknamedialog.cpp
index 1aba9261a1..f4533b44aa 100644
--- a/src/plugins/vcsbase/nicknamedialog.cpp
+++ b/src/plugins/vcsbase/nicknamedialog.cpp
@@ -187,6 +187,7 @@ NickNameDialog::NickNameDialog(QStandardItemModel *model, QWidget *parent) :
treeWidth += m_ui->filterTreeView->columnWidth(c);
}
m_ui->filterTreeView->setMinimumWidth(treeWidth + 20);
+ m_ui->filterLineEdit->setFiltering(true);
connect(m_ui->filterTreeView, SIGNAL(activated(QModelIndex)), this,
SLOT(slotActivated(QModelIndex)));
connect(m_ui->filterTreeView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
diff --git a/src/plugins/vcsbase/submiteditorwidget.cpp b/src/plugins/vcsbase/submiteditorwidget.cpp
index efbc5d40c0..2568c4f532 100644
--- a/src/plugins/vcsbase/submiteditorwidget.cpp
+++ b/src/plugins/vcsbase/submiteditorwidget.cpp
@@ -583,6 +583,11 @@ void SubmitEditorWidget::setUpdateInProgress(bool value)
updateSubmitAction();
}
+bool SubmitEditorWidget::updateInProgress() const
+{
+ return d->m_updateInProgress;
+}
+
QString SubmitEditorWidget::commitName() const
{
return tr("&Commit");
diff --git a/src/plugins/vcsbase/submiteditorwidget.h b/src/plugins/vcsbase/submiteditorwidget.h
index 6d84197735..06a5a54a50 100644
--- a/src/plugins/vcsbase/submiteditorwidget.h
+++ b/src/plugins/vcsbase/submiteditorwidget.h
@@ -105,6 +105,7 @@ public:
virtual bool canSubmit() const;
void setUpdateInProgress(bool value);
+ bool updateInProgress() const;
signals:
void diffSelected(const QList<int> &);
diff --git a/src/plugins/winrt/winrt.qbs b/src/plugins/winrt/winrt.qbs
index c3168b2b2b..67b8e0e4bf 100644
--- a/src/plugins/winrt/winrt.qbs
+++ b/src/plugins/winrt/winrt.qbs
@@ -10,6 +10,7 @@ QtcPlugin {
Depends { name: "Debugger" }
Depends { name: "ProjectExplorer" }
Depends { name: "QtSupport" }
+ Depends { name: "QmakeProjectManager" }
Depends { name: "Qt.gui" }
files: [
diff --git a/src/plugins/winrt/winrt_dependencies.pri b/src/plugins/winrt/winrt_dependencies.pri
index 8ba3491bc2..de1f7ec435 100644
--- a/src/plugins/winrt/winrt_dependencies.pri
+++ b/src/plugins/winrt/winrt_dependencies.pri
@@ -3,4 +3,5 @@ QTC_PLUGIN_DEPENDS += \
coreplugin \
debugger \
projectexplorer \
+ qmakeprojectmanager \
qtsupport
diff --git a/src/plugins/winrt/winrtconstants.h b/src/plugins/winrt/winrtconstants.h
index 3704603cff..b7b09daa6a 100644
--- a/src/plugins/winrt/winrtconstants.h
+++ b/src/plugins/winrt/winrtconstants.h
@@ -33,6 +33,7 @@
namespace WinRt {
namespace Internal {
namespace Constants {
+
const char WINRT_DEVICE_TYPE_LOCAL[] = "WinRt.Device.Local";
const char WINRT_DEVICE_TYPE_EMULATOR[] = "WinRt.Device.Emulator";
const char WINRT_DEVICE_TYPE_PHONE[] = "WinRt.Device.Phone";
@@ -43,7 +44,9 @@ const char WINRT_WINPHONEQT[] = "WinRt.QtVersion.WindowsPhone";
const char WINRT_QTMAP_SUBKEYNAME[] = "WinRt";
const char WINRT_QTMAP_OSFLAVOR[] = "OsFlavor";
const char WINRT_MANIFEST_EDITOR_ID[] = "WinRTManifestEditorID";
-}
+const char WINRT_RC_PREFIX[] = "WinRt.WinRtRunConfiguration:";
+
+} // Constants
} // Internal
} // WinRt
diff --git a/src/plugins/winrt/winrtrunconfiguration.cpp b/src/plugins/winrt/winrtrunconfiguration.cpp
index 2fb121ecc7..3cec89026f 100644
--- a/src/plugins/winrt/winrtrunconfiguration.cpp
+++ b/src/plugins/winrt/winrtrunconfiguration.cpp
@@ -29,6 +29,7 @@
#include "winrtrunconfiguration.h"
#include "winrtrunconfigurationwidget.h"
+#include "winrtconstants.h"
#include <coreplugin/icore.h>
#include <projectexplorer/target.h>
@@ -40,8 +41,14 @@ namespace Internal {
static const char argumentsIdC[] = "WinRtRunConfigurationArgumentsId";
static const char uninstallAfterStopIdC[] = "WinRtRunConfigurationUninstallAfterStopId";
+static QString pathFromId(Core::Id id)
+{
+ return id.suffixAfter(Constants::WINRT_RC_PREFIX);
+}
+
WinRtRunConfiguration::WinRtRunConfiguration(ProjectExplorer::Target *parent, Core::Id id)
: RunConfiguration(parent, id)
+ , m_proFilePath(pathFromId(id))
, m_uninstallAfterStop(false)
{
setDisplayName(tr("Run App Package"));
diff --git a/src/plugins/winrt/winrtrunconfiguration.h b/src/plugins/winrt/winrtrunconfiguration.h
index af2e1850d5..f010580f29 100644
--- a/src/plugins/winrt/winrtrunconfiguration.h
+++ b/src/plugins/winrt/winrtrunconfiguration.h
@@ -47,6 +47,7 @@ public:
QVariantMap toMap() const;
bool fromMap(const QVariantMap &map);
+ const QString &proFilePath() const { return m_proFilePath; }
const QString &arguments() const { return m_arguments; }
bool uninstallAfterStop() const { return m_uninstallAfterStop; }
@@ -59,6 +60,7 @@ public slots:
void setUninstallAfterStop(bool b);
private:
+ QString m_proFilePath;
QString m_arguments;
bool m_uninstallAfterStop;
};
diff --git a/src/plugins/winrt/winrtruncontrol.cpp b/src/plugins/winrt/winrtruncontrol.cpp
index ae0635ae93..af066f3171 100644
--- a/src/plugins/winrt/winrtruncontrol.cpp
+++ b/src/plugins/winrt/winrtruncontrol.cpp
@@ -49,7 +49,6 @@ using ProjectExplorer::IDevice;
using ProjectExplorer::RunControl;
using ProjectExplorer::RunMode;
using ProjectExplorer::Target;
-using Utils::QtcProcess;
namespace WinRt {
namespace Internal {
diff --git a/src/plugins/winrt/winrtrunfactories.cpp b/src/plugins/winrt/winrtrunfactories.cpp
index c49f41b0b3..fda57eb5b2 100644
--- a/src/plugins/winrt/winrtrunfactories.cpp
+++ b/src/plugins/winrt/winrtrunfactories.cpp
@@ -37,25 +37,16 @@
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/project.h>
#include <projectexplorer/target.h>
-#include <projectexplorer/toolchain.h>
-
-#include <debugger/debuggerkitinformation.h>
-#include <debugger/debuggerplugin.h>
-#include <debugger/debuggerrunner.h>
-#include <debugger/debuggerstartparameters.h>
-
+#include <qmakeprojectmanager/qmakeproject.h>
#include <utils/qtcassert.h>
-#include <QLocalServer>
-#include <QLocalSocket>
-
using namespace ProjectExplorer;
+using QmakeProjectManager::QmakeProject;
+using QmakeProjectManager::QmakeProFileNode;
namespace WinRt {
namespace Internal {
-static const char winrtConfigurationIdC[] = "WinRTConfigurationID";
-
static bool isKitCompatible(Kit *kit)
{
IDevice::ConstPtr device = DeviceKitInformation::device(kit);
@@ -72,13 +63,17 @@ WinRtRunConfigurationFactory::WinRtRunConfigurationFactory()
{
}
-QList<Core::Id> WinRtRunConfigurationFactory::availableCreationIds(Target *parent, CreationMode mode) const
+QList<Core::Id> WinRtRunConfigurationFactory::availableCreationIds(Target *parent,
+ CreationMode mode) const
{
- Q_UNUSED(mode)
- QList<Core::Id> result;
- if (isKitCompatible(parent->kit()))
- result.append(Core::Id(winrtConfigurationIdC));
- return result;
+ if (!canHandle(parent))
+ return QList<Core::Id>();
+
+ QmakeProject *project = static_cast<QmakeProject *>(parent->project());
+ QList<QmakeProFileNode *> nodes = project->applicationProFiles();
+ if (mode == AutoCreate)
+ nodes = QmakeProject::nodesWithQtcRunnable(nodes);
+ return QmakeProject::idsForNodes(Core::Id(Constants::WINRT_RC_PREFIX), nodes);
}
QString WinRtRunConfigurationFactory::displayNameForId(Core::Id id) const
@@ -89,7 +84,8 @@ QString WinRtRunConfigurationFactory::displayNameForId(Core::Id id) const
bool WinRtRunConfigurationFactory::canCreate(Target *parent, Core::Id id) const
{
- return id == winrtConfigurationIdC && isKitCompatible(parent->kit());
+ Q_UNUSED(id);
+ return canHandle(parent);
}
RunConfiguration *WinRtRunConfigurationFactory::doCreate(Target *parent, Core::Id id)
@@ -99,12 +95,15 @@ RunConfiguration *WinRtRunConfigurationFactory::doCreate(Target *parent, Core::I
bool WinRtRunConfigurationFactory::canRestore(Target *parent, const QVariantMap &map) const
{
- return ProjectExplorer::idFromMap(map) == winrtConfigurationIdC && isKitCompatible(parent->kit());
+ if (!canHandle(parent))
+ return false;
+
+ return idFromMap(map).toString().startsWith(QLatin1String(Constants::WINRT_RC_PREFIX));
}
RunConfiguration *WinRtRunConfigurationFactory::doRestore(Target *parent, const QVariantMap &map)
{
- RunConfiguration *config = new WinRtRunConfiguration(parent, winrtConfigurationIdC);
+ RunConfiguration *config = new WinRtRunConfiguration(parent, idFromMap(map));
config->fromMap(map);
return config;
}
@@ -123,6 +122,15 @@ RunConfiguration *WinRtRunConfigurationFactory::clone(Target *parent, RunConfigu
return 0;
}
+bool WinRtRunConfigurationFactory::canHandle(Target *parent) const
+{
+ if (!isKitCompatible(parent->kit()))
+ return false;
+ if (!qobject_cast<QmakeProject *>(parent->project()))
+ return false;
+ return true;
+}
+
WinRtRunControlFactory::WinRtRunControlFactory()
{
}
diff --git a/src/plugins/winrt/winrtrunfactories.h b/src/plugins/winrt/winrtrunfactories.h
index 2df07f6e7f..be4b26e334 100644
--- a/src/plugins/winrt/winrtrunfactories.h
+++ b/src/plugins/winrt/winrtrunfactories.h
@@ -52,6 +52,7 @@ public:
ProjectExplorer::RunConfiguration *product);
private:
+ bool canHandle(ProjectExplorer::Target *parent) const;
virtual ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, Core::Id id);
virtual ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent, const QVariantMap &map);
};
diff --git a/src/plugins/winrt/winrtrunnerhelper.cpp b/src/plugins/winrt/winrtrunnerhelper.cpp
index d9919fa821..19f935d0ce 100644
--- a/src/plugins/winrt/winrtrunnerhelper.cpp
+++ b/src/plugins/winrt/winrtrunnerhelper.cpp
@@ -90,8 +90,7 @@ bool WinRtRunnerHelper::init(WinRtRunConfiguration *runConfiguration, QString *e
return false;
}
- const Utils::FileName proFile = Utils::FileName::fromString(
- target->project()->document()->filePath());
+ const QString &proFile = m_runConfiguration->proFilePath();
m_executableFilePath = target->applicationTargets().targetForProject(proFile).toString()
+ QStringLiteral(".exe"); // ### we should not need to append ".exe" here.
diff --git a/src/shared/qbs b/src/shared/qbs
-Subproject 4d0a76fafebf11af4ab948e60f9f8eae7097fca
+Subproject 48225ceaa6d7f51281cdff871acf3dce1b80e94
diff --git a/src/src.qbs b/src/src.qbs
index 3680e8d006..08562c12fb 100644
--- a/src/src.qbs
+++ b/src/src.qbs
@@ -23,6 +23,7 @@ Project {
condition: qbsSubModuleExists && !useExternalQbs
property bool enableUnitTests: false
+ property bool enableProjectFileUpdates: true
property bool installApiHeaders: false
property string libInstallDir: project.ide_library_path
property stringList libRPaths: qbs.targetOS.contains("osx")
diff --git a/src/tools/sdktool/addkitoperation.cpp b/src/tools/sdktool/addkitoperation.cpp
index 110be9951b..cd395674cf 100644
--- a/src/tools/sdktool/addkitoperation.cpp
+++ b/src/tools/sdktool/addkitoperation.cpp
@@ -247,7 +247,7 @@ int AddKitOperation::execute() const
map = initializeKits();
QVariantMap result = addKit(map, m_id, m_displayName, m_icon, m_debuggerId, m_debuggerEngine,
- m_debugger, m_deviceType.toUtf8(), m_device, m_sysRoot, m_tc, m_qt,
+ m_debugger, m_deviceType, m_device, m_sysRoot, m_tc, m_qt,
m_mkspec, m_extra);
if (result.isEmpty() || map == result)
@@ -295,7 +295,7 @@ bool AddKitOperation::test() const
QVariantMap empty = addKit(map, tcMap, qtMap, devMap,
QLatin1String("testId"), QLatin1String("Test Kit"), QLatin1String("/tmp/icon.png"),
QString(), 1, QLatin1String("/usr/bin/gdb-test"),
- QByteArray("Desktop"), QLatin1String("{dev-id}"), QString(),
+ QLatin1String("Desktop"), QLatin1String("{dev-id}"), QString(),
QLatin1String("{tcXX-id}"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"),
KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue"))));
if (!empty.isEmpty())
@@ -304,7 +304,7 @@ bool AddKitOperation::test() const
empty = addKit(map, tcMap, qtMap, devMap,
QLatin1String("testId"), QLatin1String("Test Kit"), QLatin1String("/tmp/icon.png"),
QString(), 1, QLatin1String("/usr/bin/gdb-test"),
- QByteArray("Desktop"), QLatin1String("{dev-id}"), QString(),
+ QLatin1String("Desktop"), QLatin1String("{dev-id}"), QString(),
QLatin1String("x86-linux-generic-elf-64bit"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"),
KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue"))));
if (empty.isEmpty())
@@ -313,7 +313,7 @@ bool AddKitOperation::test() const
empty = addKit(map, tcMap, qtMap, devMap,
QLatin1String("testId"), QLatin1String("Test Kit"), QLatin1String("/tmp/icon.png"),
QString(), 1, QLatin1String("/usr/bin/gdb-test"),
- QByteArray("Desktop"), QLatin1String("{dev-id}"), QString(),
+ QLatin1String("Desktop"), QLatin1String("{dev-id}"), QString(),
QLatin1String("x86-macos-generic-mach_o-64bit"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"),
KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue"))));
if (empty.isEmpty())
@@ -323,7 +323,7 @@ bool AddKitOperation::test() const
empty = addKit(map, tcMap, qtMap, devMap,
QLatin1String("testId"), QLatin1String("Test Kit"), QLatin1String("/tmp/icon.png"),
QString(), 1, QLatin1String("/usr/bin/gdb-test"),
- QByteArray("Desktop"), QLatin1String("{dev-id}"), QString(),
+ QLatin1String("Desktop"), QLatin1String("{dev-id}"), QString(),
QLatin1String("{tc-id}"), QLatin1String("{qtXX-id}"), QLatin1String("unsupported/mkspec"),
KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue"))));
if (!empty.isEmpty())
@@ -332,7 +332,7 @@ bool AddKitOperation::test() const
empty = addKit(map, tcMap, qtMap, devMap,
QLatin1String("testId"), QLatin1String("Test Kit"), QLatin1String("/tmp/icon.png"),
QString(), 1, QLatin1String("/usr/bin/gdb-test"),
- QByteArray("Desktop"), QLatin1String("{devXX-id}"), QString(),
+ QLatin1String("Desktop"), QLatin1String("{devXX-id}"), QString(),
QLatin1String("{tc-id}"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"),
KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue"))));
if (!empty.isEmpty())
@@ -341,7 +341,7 @@ bool AddKitOperation::test() const
map = addKit(map, tcMap, qtMap, devMap,
QLatin1String("testId"), QLatin1String("Test Kit"), QLatin1String("/tmp/icon.png"),
QString(), 1, QLatin1String("/usr/bin/gdb-test"),
- QByteArray("Desktop"), QString(), QString(),
+ QLatin1String("Desktop"), QString(), QString(),
QLatin1String("{tc-id}"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"),
KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue"))));
@@ -391,7 +391,7 @@ bool AddKitOperation::test() const
QVariantMap result = addKit(map, tcMap, qtMap, devMap,
QLatin1String("testId"), QLatin1String("Test Qt Version X"), QLatin1String("/tmp/icon3.png"),
QString(), 1, QLatin1String("/usr/bin/gdb-test3"),
- QByteArray("Desktop"), QString(), QString(),
+ QLatin1String("Desktop"), QString(), QString(),
QLatin1String("{tc-id}"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"),
KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue"))));
if (!result.isEmpty())
@@ -401,7 +401,7 @@ bool AddKitOperation::test() const
map = addKit(map, tcMap, qtMap, devMap,
QLatin1String("testId2"), QLatin1String("Test Kit2"), QLatin1String("/tmp/icon2.png"),
QString(), 1, QLatin1String("/usr/bin/gdb-test2"),
- QByteArray("Desktop"), QLatin1String("{dev-id}"), QLatin1String("/sys/root\\\\"),
+ QLatin1String("Desktop"), QLatin1String("{dev-id}"), QLatin1String("/sys/root\\\\"),
QLatin1String("{tc-id}"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"),
KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue"))));
if (map.count() != 5
@@ -457,7 +457,7 @@ bool AddKitOperation::test() const
map = addKit(map, tcMap, qtMap, devMap,
QLatin1String("test with debugger Id"), QLatin1String("Test debugger Id"), QLatin1String("/tmp/icon2.png"),
QString::fromLatin1("debugger Id"), 0, QString(),
- QByteArray("Desktop"), QString(), QString(),
+ QLatin1String("Desktop"), QString(), QString(),
QLatin1String("{tc-id}"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"),
KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue"))));
if (map.count() != 6
@@ -506,7 +506,7 @@ QVariantMap AddKitOperation::addKit(const QVariantMap &map,
const QString &id, const QString &displayName,
const QString &icon, const QString &debuggerId,
const quint32 &debuggerType, const QString &debugger,
- const QByteArray &deviceType, const QString &device,
+ const QString &deviceType, const QString &device,
const QString &sysRoot, const QString &tc, const QString &qt,
const QString &mkspec, const KeyValuePairList &extra)
{
@@ -523,7 +523,7 @@ QVariantMap AddKitOperation::addKit(const QVariantMap &map, const QVariantMap &t
const QString &id, const QString &displayName,
const QString &icon, const QString &debuggerId,
const quint32 &debuggerType, const QString &debugger,
- const QByteArray &deviceType, const QString &device,
+ const QString &deviceType, const QString &device,
const QString &sysRoot, const QString &tc, const QString &qt,
const QString &mkspec, const KeyValuePairList &extra)
{
diff --git a/src/tools/sdktool/addkitoperation.h b/src/tools/sdktool/addkitoperation.h
index f5f6256920..57d4b0e298 100644
--- a/src/tools/sdktool/addkitoperation.h
+++ b/src/tools/sdktool/addkitoperation.h
@@ -54,7 +54,7 @@ public:
static QVariantMap addKit(const QVariantMap &map, const QString &id, const QString &displayName,
const QString &icon, const QString &debuggerId,
const quint32 &debuggerType, const QString &debugger,
- const QByteArray &deviceType, const QString &device,
+ const QString &deviceType, const QString &device,
const QString &sysRoot, const QString &tc, const QString &qt,
const QString &mkspec, const KeyValuePairList &extra);
@@ -66,7 +66,7 @@ public:
const QString &id, const QString &displayName,
const QString &icon, const QString &debuggerId,
const quint32 &debuggerType, const QString &debugger,
- const QByteArray &deviceType, const QString &device,
+ const QString &deviceType, const QString &device,
const QString &sysRoot, const QString &tc, const QString &qt,
const QString &mkspec, const KeyValuePairList &extra);
diff --git a/src/tools/sdktool/rmkitoperation.cpp b/src/tools/sdktool/rmkitoperation.cpp
index 5243939739..df788a34e4 100644
--- a/src/tools/sdktool/rmkitoperation.cpp
+++ b/src/tools/sdktool/rmkitoperation.cpp
@@ -127,7 +127,7 @@ bool RmKitOperation::test() const
QLatin1String("testId"), QLatin1String("Test Qt Version"),
QLatin1String("/tmp/icon.png"),
QString(), 1, QLatin1String("/usr/bin/gdb-test"),
- QByteArray("Desktop"), QString(), QString(),
+ QLatin1String("Desktop"), QString(), QString(),
QLatin1String("{tc-id}"), QLatin1String("{qt-id}"),
QLatin1String("unsupported/mkspec"),
KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue"))));
@@ -136,7 +136,7 @@ bool RmKitOperation::test() const
QLatin1String("testId2"), QLatin1String("Test Qt Version"),
QLatin1String("/tmp/icon2.png"),
QString(), 1, QLatin1String("/usr/bin/gdb-test2"),
- QByteArray("Desktop"), QString(), QString(),
+ QLatin1String("Desktop"), QString(), QString(),
QLatin1String("{tc-id}"), QLatin1String("{qt-id}"),
QLatin1String("unsupported/mkspec2"),
KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue2"))));
diff --git a/tests/auto/cplusplus/ast/tst_ast.cpp b/tests/auto/cplusplus/ast/tst_ast.cpp
index 05712ce5f3..ebd9e468e1 100644
--- a/tests/auto/cplusplus/ast/tst_ast.cpp
+++ b/tests/auto/cplusplus/ast/tst_ast.cpp
@@ -30,6 +30,7 @@
#include <QtTest>
#include <QDebug>
+#include <cplusplus/ASTVisitor.h>
#include <cplusplus/Control.h>
#include <cplusplus/Literals.h>
#include <cplusplus/Parser.h>
@@ -61,6 +62,13 @@ public:
unit->setSource(source.constData(), source.length());
unit->blockErrors(blockErrors);
unit->parse(mode);
+
+ // Sanity check: Visit all AST nodes
+ if (AST *ast = unit->ast()) {
+ ASTVisitor visitor(unit);
+ visitor.accept(ast);
+ }
+
return unit;
}
@@ -185,6 +193,7 @@ private slots:
void incomplete_ast();
void unnamed_class();
void unnamed_class_data();
+ void expensiveExpression();
};
void tst_AST::gcc_attributes_1()
@@ -207,12 +216,12 @@ void tst_AST::gcc_attributes_2()
QVERIFY(ns->attribute_list);
QVERIFY(!ns->attribute_list->next);
QVERIFY(ns->attribute_list->value);
- AttributeSpecifierAST *attrSpec = ns->attribute_list->value->asAttributeSpecifier();
+ GnuAttributeSpecifierAST *attrSpec = ns->attribute_list->value->asGnuAttributeSpecifier();
QVERIFY(attrSpec);
QVERIFY(attrSpec->attribute_list);
QVERIFY(!attrSpec->attribute_list->next);
QVERIFY(attrSpec->attribute_list->value);
- AttributeAST *attr = attrSpec->attribute_list->value->asAttribute();
+ GnuAttributeAST *attr = attrSpec->attribute_list->value->asGnuAttribute();
QVERIFY(attr);
QCOMPARE(unit->spell(attr->identifier_token), "__visibility__");
QVERIFY(attr->expression_list);
@@ -1371,13 +1380,13 @@ void tst_AST::objc_method_attributes_1()
QVERIFY(foo->attribute_list);
QVERIFY(foo->attribute_list->value);
QVERIFY(! (foo->attribute_list->next));
- AttributeSpecifierAST *deprecatedSpec = foo->attribute_list->value->asAttributeSpecifier();
+ GnuAttributeSpecifierAST *deprecatedSpec = foo->attribute_list->value->asGnuAttributeSpecifier();
QVERIFY(deprecatedSpec);
QCOMPARE(unit->tokenKind(deprecatedSpec->attribute_token), (int) T___ATTRIBUTE__);
QVERIFY(deprecatedSpec->attribute_list);
QVERIFY(deprecatedSpec->attribute_list->value);
QVERIFY(! (deprecatedSpec->attribute_list->next));
- AttributeAST *deprecatedAttr = deprecatedSpec->attribute_list->value->asAttribute();
+ GnuAttributeAST *deprecatedAttr = deprecatedSpec->attribute_list->value->asGnuAttribute();
QVERIFY(deprecatedAttr);
QVERIFY(! deprecatedAttr->expression_list);
QCOMPARE(unit->spell(deprecatedAttr->identifier_token), "deprecated");
@@ -1399,13 +1408,13 @@ void tst_AST::objc_method_attributes_1()
QVERIFY(bar->attribute_list);
QVERIFY(bar->attribute_list->value);
QVERIFY(! (bar->attribute_list->next));
- AttributeSpecifierAST *unavailableSpec = bar->attribute_list->value->asAttributeSpecifier();
+ GnuAttributeSpecifierAST *unavailableSpec = bar->attribute_list->value->asGnuAttributeSpecifier();
QVERIFY(unavailableSpec);
QCOMPARE(unit->tokenKind(unavailableSpec->attribute_token), (int) T___ATTRIBUTE__);
QVERIFY(unavailableSpec->attribute_list);
QVERIFY(unavailableSpec->attribute_list->value);
QVERIFY(! (unavailableSpec->attribute_list->next));
- AttributeAST *unavailableAttr = unavailableSpec->attribute_list->value->asAttribute();
+ GnuAttributeAST *unavailableAttr = unavailableSpec->attribute_list->value->asGnuAttribute();
QVERIFY(unavailableAttr);
QVERIFY(! unavailableAttr->expression_list);
QCOMPARE(unit->spell(unavailableAttr->identifier_token), "unavailable");
@@ -1782,6 +1791,46 @@ void tst_AST::unnamed_class_data()
QTest::newRow("unnamed-__attribute__") << _("class __attribute__((aligned(8))){};");
}
+void tst_AST::expensiveExpression()
+{
+ QSharedPointer<TranslationUnit> unit(parseStatement(
+ "void f()\n"
+ "{\n"
+ "(g1\n"
+ "(g2\n"
+ "(g3\n"
+ "(g4\n"
+ "(g5\n"
+ "(g6\n"
+ "(g7\n"
+ "(g8\n"
+ "(g9\n"
+ "(g10\n"
+ "(g11\n"
+ "(g12\n"
+ "(g13\n"
+ "(g14\n"
+ "(g15\n"
+ "(g16\n"
+ "(g17\n"
+ "(g18\n"
+ "(g19\n"
+ "(g20\n"
+ "(g21\n"
+ "(g22\n"
+ "(g23\n"
+ "(g24\n"
+ "(g25\n"
+ "(g26\n"
+ "(g27\n"
+ "(g28\n"
+ "(g29\n"
+ "(g30\n"
+ "(g31(0))))))))))))))))))))))))))))))));\n"
+ "}\n"));
+ QVERIFY(unit->ast());
+}
+
void tst_AST::initTestCase()
{
control.setDiagnosticClient(&diag);
diff --git a/tests/auto/cplusplus/cxx11/data/alignofAlignas.1.cpp b/tests/auto/cplusplus/cxx11/data/alignofAlignas.1.cpp
index 5ba43661ed..05768769f6 100644
--- a/tests/auto/cplusplus/cxx11/data/alignofAlignas.1.cpp
+++ b/tests/auto/cplusplus/cxx11/data/alignofAlignas.1.cpp
@@ -1,2 +1,8 @@
int i = alignof(int);
int t = alignof(C::foo) * 7 + alignof(Foo *);
+
+struct alignas(f()) Foo {};
+struct alignas(42) Foo {};
+struct alignas(double) Bar {};
+alignas(Foo) alignas(Bar) Foo *buffer;
+struct alignas(Mooze...) Gnarf {};
diff --git a/tests/auto/cplusplus/findusages/tst_findusages.cpp b/tests/auto/cplusplus/findusages/tst_findusages.cpp
index 2235034c31..97162be99a 100644
--- a/tests/auto/cplusplus/findusages/tst_findusages.cpp
+++ b/tests/auto/cplusplus/findusages/tst_findusages.cpp
@@ -115,6 +115,8 @@ private Q_SLOTS:
void usingInDifferentNamespace_QTCREATORBUG7978();
void unicodeIdentifier();
+
+ void inAlignas();
};
void tst_FindUsages::dump(const QList<Usage> &usages) const
@@ -984,5 +986,36 @@ void tst_FindUsages::unicodeIdentifier()
QCOMPARE(usages.at(1).len, 7);
}
+void tst_FindUsages::inAlignas()
+{
+ const QByteArray src = "\n"
+ "struct One {};\n"
+ "struct alignas(One) Two {};\n"
+ ;
+
+ Document::Ptr doc = Document::create("inAlignas");
+ doc->setUtf8Source(src);
+ doc->parse();
+ doc->check();
+
+ QVERIFY(doc->diagnosticMessages().isEmpty());
+ QCOMPARE(doc->globalSymbolCount(), 2U);
+
+ Snapshot snapshot;
+ snapshot.insert(doc);
+
+ Class *c = doc->globalSymbolAt(0)->asClass();
+ QVERIFY(c);
+ QCOMPARE(c->name()->identifier()->chars(), "One");
+
+ FindUsages find(src, doc, snapshot);
+ find(c);
+ QCOMPARE(find.usages().size(), 2);
+ QCOMPARE(find.usages()[0].line, 1);
+ QCOMPARE(find.usages()[0].col, 7);
+ QCOMPARE(find.usages()[1].line, 2);
+ QCOMPARE(find.usages()[1].col, 15);
+}
+
QTEST_APPLESS_MAIN(tst_FindUsages)
#include "tst_findusages.moc"
diff --git a/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp b/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp
index a7d4287dac..6b8dad6488 100644
--- a/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp
+++ b/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp
@@ -159,8 +159,10 @@ public:
virtual void stopSkippingBlocks(unsigned utf16charsOffset)
{ m_skippedBlocks.last().end = utf16charsOffset; }
- virtual void sourceNeeded(unsigned line, const QString &includedFileName, IncludeType mode)
+ virtual void sourceNeeded(unsigned line, const QString &includedFileName, IncludeType mode,
+ const QStringList &initialIncludes = QStringList())
{
+ Q_UNUSED(initialIncludes)
#if 1
m_recordedIncludes.append(Include(includedFileName, mode, line));
Q_UNUSED(m_env);
diff --git a/tests/cpplocators/testdata_basic/file1.mm b/tests/cpplocators/testdata_basic/file1.mm
new file mode 100644
index 0000000000..841a31051c
--- /dev/null
+++ b/tests/cpplocators/testdata_basic/file1.mm
@@ -0,0 +1,23 @@
+// Copyright header to keep the Qt Insanity Bot happy.
+
+@protocol NSObject
+@end
+
+@interface NSObject<NSObject>
+@end
+
+@protocol MyProtocol <NSObject>
+- (void) someMethod;
+@end
+
+@interface MyClass: NSObject <MyProtocol>
+@end
+
+@implementation MyClass
+- (void) someMethod {}
+@end
+
+@implementation MyClass(MyCategory)
+- (void) anotherMethod;{}
+- (void) anotherMethod:(NSObject*)withAnObject{}
+@end
diff --git a/tests/cppmodelmanager/testdata_defines/pch1.h b/tests/cppmodelmanager/testdata_defines/pch1.h
index a5a8cae412..b76608a772 100644
--- a/tests/cppmodelmanager/testdata_defines/pch1.h
+++ b/tests/cppmodelmanager/testdata_defines/pch1.h
@@ -1 +1,2 @@
#define SUB1
+class ClassInPch1{};
diff --git a/tests/cppmodelmanager/testdata_defines/pch2.h b/tests/cppmodelmanager/testdata_defines/pch2.h
index 2b715eaec1..289da5b927 100644
--- a/tests/cppmodelmanager/testdata_defines/pch2.h
+++ b/tests/cppmodelmanager/testdata_defines/pch2.h
@@ -1 +1,2 @@
#define SUB2
+class ClassInPch2{};
diff --git a/tests/manual/manual.pro b/tests/manual/manual.pro
index 3069364b82..a495851359 100644
--- a/tests/manual/manual.pro
+++ b/tests/manual/manual.pro
@@ -10,7 +10,6 @@ utils
unix {
# Uses popen
SUBDIRS += \
- plain-cplusplus \
# Profile library paths issues
process \
ssh
diff --git a/tests/manual/plain-cplusplus/Preprocessor.cpp b/tests/manual/plain-cplusplus/Preprocessor.cpp
deleted file mode 100644
index 876f18ae9b..0000000000
--- a/tests/manual/plain-cplusplus/Preprocessor.cpp
+++ /dev/null
@@ -1,339 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-#include "Preprocessor.h"
-#include "Lexer.h"
-#include <list>
-#include <iostream>
-#include <cassert>
-
-using namespace CPlusPlus;
-
-std::ostream &operator << (std::ostream &out, const StringRef &s)
-{
- out.write(s.text(), s.size());
- return out;
-}
-
-struct Preprocessor::TokenBuffer
-{
- std::list<Token> tokens;
- const Macro *macro;
- TokenBuffer *next;
-
- template <typename _Iterator>
- TokenBuffer(_Iterator firstToken, _Iterator lastToken, const Macro *macro, TokenBuffer *next)
- : tokens(firstToken, lastToken), macro(macro), next(next) {}
-};
-
-Lexer *Preprocessor::switchLexer(Lexer *lex)
-{
- Lexer *previousLexer = _lexer;
- _lexer = lex;
- return previousLexer;
-}
-
-StringRef Preprocessor::switchSource(const StringRef &source)
-{
- StringRef previousSource = _source;
- _source = source;
- return previousSource;
-}
-
-const Preprocessor::Macro *Preprocessor::resolveMacro(const StringRef &name) const
-{
- std::map<StringRef, Macro>::const_iterator it = macros.find(name);
- if (it != macros.end()) {
- const Macro *m = &it->second;
- for (TokenBuffer *r = _tokenBuffer; r; r = r->next) {
- if (r->macro == m)
- return 0;
- }
- return m;
- }
-
- return 0;
-}
-
-void Preprocessor::collectActualArguments(Token *tk, std::vector<std::vector<Token> > *actuals)
-{
- lex(tk);
-
- assert(tk->is(T_LPAREN));
-
- lex(tk);
-
- std::vector<Token> tokens;
- scanActualArgument(tk, &tokens);
-
- actuals->push_back(tokens);
-
- while (tk->is(T_COMMA)) {
- lex(tk);
-
- std::vector<Token> tokens;
- scanActualArgument(tk, &tokens);
- actuals->push_back(tokens);
- }
-
- assert(tk->is(T_RPAREN));
- lex(tk);
-}
-
-void Preprocessor::scanActualArgument(Token *tk, std::vector<Token> *tokens)
-{
- int count = 0;
-
- while (tk->isNot(T_EOF_SYMBOL)) {
- if (tk->is(T_LPAREN)) {
- ++count;
- } else if (tk->is(T_RPAREN)) {
- if (! count)
- break;
-
- --count;
- } else if (! count && tk->is(T_COMMA)) {
- break;
- }
-
- tokens->push_back(*tk);
- lex(tk);
- }
-}
-
-void Preprocessor::lex(Token *tk)
-{
-_Lagain:
- if (_tokenBuffer) {
- if (_tokenBuffer->tokens.empty()) {
- TokenBuffer *r = _tokenBuffer;
- _tokenBuffer = _tokenBuffer->next;
- delete r;
- goto _Lagain;
- }
- *tk = _tokenBuffer->tokens.front();
- _tokenBuffer->tokens.pop_front();
- } else {
- _lexer->scan(tk);
- }
-
-_Lclassify:
- if (! inPreprocessorDirective) {
- if (tk->newline() && tk->is(T_POUND)) {
- handlePreprocessorDirective(tk);
- goto _Lclassify;
-
- } else if (tk->is(T_IDENTIFIER)) {
- const StringRef id = asStringRef(*tk);
-
- if (const Macro *macro = resolveMacro(id)) {
- std::vector<Token> body = macro->body;
-
- if (macro->isFunctionLike) {
- std::vector<std::vector<Token> > actuals;
- collectActualArguments(tk, &actuals);
-
- std::vector<Token> expanded;
- for (size_t i = 0; i < body.size(); ++i) {
- const Token &token = body[i];
-
- if (token.isNot(T_IDENTIFIER)) {
- expanded.push_back(token);
- } else {
- const StringRef id = asStringRef(token);
- size_t j = 0;
- for (; j < macro->formals.size(); ++j) {
- if (macro->formals[j] == id) {
- expanded.insert(expanded.end(), actuals[j].begin(), actuals[j].end());
- break;
- }
- }
-
- if (j == macro->formals.size())
- expanded.push_back(token);
- }
- }
-
- const Token currentTokenBuffer[] = { *tk };
- _tokenBuffer = new TokenBuffer(currentTokenBuffer, currentTokenBuffer + 1,
- /*macro */ 0, _tokenBuffer);
-
- body = expanded;
- }
-
- _tokenBuffer = new TokenBuffer(body.begin(), body.end(),
- macro, _tokenBuffer);
- goto _Lagain;
- }
- }
- }
-}
-
-void Preprocessor::handlePreprocessorDirective(Token *tk)
-{
- inPreprocessorDirective = true;
-
- lex(tk); // scan the directive
-
- if (tk->newline() && ! tk->joined())
- return; // nothing to do.
-
- const StringRef ppDefine("define", 6);
-
- if (tk->is(T_IDENTIFIER)) {
- const StringRef directive = asStringRef(*tk);
-
- if (directive == ppDefine)
- handleDefineDirective(tk);
- else
- skipPreprocesorDirective(tk);
- }
-
- inPreprocessorDirective = false;
-}
-
-bool Preprocessor::isValidToken(const Token &tk) const
-{
- if (tk.isNot(T_EOF_SYMBOL) && (! tk.newline() || tk.joined()))
- return true;
-
- return false;
-}
-
-void Preprocessor::handleDefineDirective(Token *tk)
-{
- lex(tk);
-
- if (tk->is(T_IDENTIFIER)) {
- const StringRef macroName = asStringRef(*tk);
- Macro macro;
-
- lex(tk);
-
- if (isValidToken(*tk) && tk->is(T_LPAREN) && ! tk->whitespace()) {
- macro.isFunctionLike = true;
-
- lex(tk); // skip `('
-
- if (isValidToken(*tk) && tk->is(T_IDENTIFIER)) {
- macro.formals.push_back(asStringRef(*tk));
-
- lex(tk);
-
- while (isValidToken(*tk) && tk->is(T_COMMA)) {
- lex(tk);
-
- if (isValidToken(*tk) && tk->is(T_IDENTIFIER)) {
- macro.formals.push_back(asStringRef(*tk));
- lex(tk);
- }
- }
- }
-
- if (isValidToken(*tk) && tk->is(T_RPAREN))
- lex(tk); // skip `)'
- }
-
- while (isValidToken(*tk)) {
- macro.body.push_back(*tk);
- lex(tk);
- }
-
- macros.insert(std::make_pair(macroName, macro));
- } else {
- skipPreprocesorDirective(tk);
- }
-}
-
-void Preprocessor::skipPreprocesorDirective(Token *tk)
-{
- do {
- lex(tk);
- } while (isValidToken(*tk));
-}
-
-StringRef Preprocessor::asStringRef(const Token &tk) const
-{ return StringRef(_source.begin() + tk.bytesBegin(), tk.bytes()); }
-
-Preprocessor::Preprocessor(std::ostream &out)
- : out(out), _lexer(0), inPreprocessorDirective(false)
-{ }
-
-void Preprocessor::operator()(const char *source, unsigned size, const StringRef &currentFileName)
-{
- _currentFileName = currentFileName;
- run(source, size);
-}
-
-void Preprocessor::run(const char *source, unsigned size)
-{
- _tokenBuffer = 0;
-
- const StringRef previousSource = switchSource(StringRef(source, size));
- Lexer thisLexer(source, source + size);
- thisLexer.setScanKeywords(false);
- Lexer *previousLexer = switchLexer(&thisLexer);
- inPreprocessorDirective = false;
-
- Token tk;
- unsigned lineno = 0;
- do {
- lex(&tk);
-
- if (lineno != tk.lineno) {
- if (lineno > tk.lineno || tk.lineno - lineno > 3) {
- out << std::endl << "#line " << tk.lineno << " \"" << _currentFileName << "\"" << std::endl;
- } else {
- for (unsigned i = lineno; i < tk.lineno; ++i)
- out << std::endl;
- }
-
- lineno = tk.lineno;
-
- } else {
- if (tk.newline())
- out << std::endl;
-
- if (tk.whitespace())
- out << ' ';
- }
-
- out << asStringRef(tk);
- lineno = tk.lineno;
- } while (tk.isNot(T_EOF_SYMBOL));
-
- out << std::endl;
-
- switchLexer(previousLexer);
- switchSource(previousSource);
-}
-
-
-
-
diff --git a/tests/manual/plain-cplusplus/Preprocessor.h b/tests/manual/plain-cplusplus/Preprocessor.h
deleted file mode 100644
index a30bd7751d..0000000000
--- a/tests/manual/plain-cplusplus/Preprocessor.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-#ifndef CPLUSPLUS_PREPROCESSOR_H
-#define CPLUSPLUS_PREPROCESSOR_H
-
-#include <CPlusPlusForwardDeclarations.h>
-#include <iosfwd>
-#include <vector>
-#include <map>
-#include <cstring>
-
-namespace CPlusPlus {
-
-class Lexer;
-class Token;
-
-class StringRef
-{
- const char *_text;
- unsigned _size;
-
-public:
- typedef const char *iterator;
- typedef const char *const_iterator;
-
- StringRef()
- : _text(0), _size(0) {}
-
- StringRef(const char *text, unsigned size)
- : _text(text), _size(size) {}
-
- StringRef(const char *text)
- : _text(text), _size(std::strlen(text)) {}
-
- inline const char *text() const { return _text; }
- inline unsigned size() const { return _size; }
-
- inline const_iterator begin() const { return _text; }
- inline const_iterator end() const { return _text + _size; }
-
- bool operator == (const StringRef &other) const
- {
- if (_size == other._size)
- return _text == other._text || ! std::strncmp(_text, other._text, _size);
-
- return false;
- }
-
- bool operator != (const StringRef &other) const
- { return ! operator == (other); }
-
- bool operator < (const StringRef &other) const
- { return std::lexicographical_compare(begin(), end(), other.begin(), other.end()); }
-};
-
-class CPLUSPLUS_EXPORT Preprocessor
-{
-public:
- Preprocessor(std::ostream &out);
-
- void operator()(const char *source, unsigned size, const StringRef &currentFileName);
-
-private:
- struct Macro
- {
- Macro(): isFunctionLike(false), isVariadic(false) {}
-
- std::vector<StringRef> formals;
- std::vector<Token> body;
- bool isFunctionLike: 1;
- bool isVariadic: 1;
- };
-
- void run(const char *source, unsigned size);
-
- Lexer *switchLexer(Lexer *lex);
- StringRef switchSource(const StringRef &source);
-
- const Macro *resolveMacro(const StringRef &name) const;
-
- StringRef asStringRef(const Token &tk) const;
- void lex(Token *tk);
- bool isValidToken(const Token &tk) const;
-
- void handlePreprocessorDirective(Token *tk);
- void handleDefineDirective(Token *tk);
- void skipPreprocesorDirective(Token *tk);
-
- void collectActualArguments(Token *tk, std::vector<std::vector<Token> > *actuals);
- void scanActualArgument(Token *tk, std::vector<Token> *tokens);
-
-private:
- struct TokenBuffer;
-
- std::ostream &out;
- StringRef _currentFileName;
- Lexer *_lexer;
- StringRef _source;
- TokenBuffer *_tokenBuffer;
- bool inPreprocessorDirective: 1;
- std::map<StringRef, Macro> macros;
-};
-
-} // end of namespace CPlusPlus
-
-CPLUSPLUS_EXPORT std::ostream &operator << (std::ostream &out, const CPlusPlus::StringRef &s);
-
-#endif // CPLUSPLUS_PREPROCESSOR_H
-
diff --git a/tests/manual/plain-cplusplus/main.cpp b/tests/manual/plain-cplusplus/main.cpp
deleted file mode 100644
index 3fb94be60b..0000000000
--- a/tests/manual/plain-cplusplus/main.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-#include "Preprocessor.h"
-#include <CPlusPlus.h>
-
-#include <string>
-#include <cstdlib>
-#include <sstream>
-
-using namespace CPlusPlus;
-
-enum { BLOCK_SIZE = 4 * 1024};
-
-void parse(const char *fileName, const char *source, unsigned size);
-int runWithSystemPreprocessor(int argc, char *argv[]);
-int runWithNewPreprocessor(int argc, char *argv[]);
-
-struct V: public ASTVisitor
-{
- V(TranslationUnit *unit)
- : ASTVisitor(unit) {}
-
- virtual bool visit(FunctionDeclaratorAST *ast)
- {
- if (ast->as_cpp_initializer) {
- if (! (ast->symbol && ast->symbol->enclosingScope()))
- ; //translationUnit()->warning(ast->firstToken(), "resolved as function declaration");
- else if (ast->symbol->enclosingScope()->isNamespace() || ast->symbol->enclosingScope()->isTemplate())
- ; //translationUnit()->warning(ast->firstToken(), "resolved as function declaration");
- else if (ast->symbol->enclosingScope()->isBlock())
- ; //translationUnit()->warning(ast->firstToken(), "resolved as C++ initializer");
- else
- translationUnit()->warning(ast->firstToken(), "ambiguous function declarator or C++ intializer");
- }
- return true;
- }
-
- virtual bool visit(ExpressionOrDeclarationStatementAST *ast)
- {
- translationUnit()->warning(ast->firstToken(), "ambiguous expression or declaration statement");
- return true;
- }
-};
-
-int main(int argc, char *argv[])
-{
- if (getenv("CPLUSPLUS_WITH_NEW_PREPROCESSOR"))
- return runWithNewPreprocessor(argc, argv);
-
- return runWithSystemPreprocessor(argc, argv);
-}
-
-int runWithSystemPreprocessor(int argc, char *argv[])
-{
- std::string cmdline;
- cmdline += "gcc -E -xc++ -U__BLOCKS__ -D__restrict= -D__restrict__= -D__extension__= -D__imag__= -D__real__= -D__complex__= -D_Complex= -D__signed=signed";
-
- for (int i = 1; i < argc; ++i) {
- cmdline += ' ';
- cmdline += argv[i];
- }
-
- char block[BLOCK_SIZE];
-
- std::string preprocessedCode;
-
- if (FILE *fp = popen(cmdline.c_str(), "r")) {
- while (size_t sz = fread(block, 1, BLOCK_SIZE, fp))
- preprocessedCode.append(block, sz);
-
- pclose(fp);
-
- } else {
- fprintf(stderr, "c++: No such file or directory\n");
- return EXIT_FAILURE;
- }
-
- parse("<stdin>", preprocessedCode.c_str(), preprocessedCode.size());
- return EXIT_SUCCESS;
-}
-
-int runWithNewPreprocessor(int argc, char *argv[])
-{
- if (argc == 1) {
- fprintf(stderr, "c++: No such file or directory\n");
- return EXIT_FAILURE;
- }
-
- char block[BLOCK_SIZE];
-
- std::string source;
-
- if (FILE *fp = fopen(argv[1], "r")) {
- while (size_t sz = fread(block, 1, BLOCK_SIZE, fp))
- source.append(block, sz);
-
- fclose(fp);
-
- } else {
- fprintf(stderr, "c++: No such file or directory\n");
- return EXIT_FAILURE;
- }
-
- std::ostringstream out;
- Preprocessor pp(out);
- pp(source.c_str(), source.size(), StringRef(argv[1]));
-
- const std::string preprocessedCode = out.str();
- parse(argv[1], preprocessedCode.c_str(), preprocessedCode.size());
- return EXIT_SUCCESS;
-}
-
-void parse(const char *fileName, const char *source, unsigned size)
-{
- Control control;
-
- LanguageFeatures features;
- features.cxx11Enabled = true;
-
- TranslationUnit unit(&control, control.stringLiteral(fileName));
- unit.setSource(source, size);
- unit.setLanguageFeatures(features);
- unit.parse();
-
-#if 1
- Namespace *globalNamespace = control.newNamespace(0);
- Bind bind(&unit);
- bind(unit.ast()->asTranslationUnit(), globalNamespace);
-
- V v(&unit);
- v.accept(unit.ast());
-#endif
-}
diff --git a/tests/manual/plain-cplusplus/plain-cplusplus.pro b/tests/manual/plain-cplusplus/plain-cplusplus.pro
deleted file mode 100644
index 3272942d25..0000000000
--- a/tests/manual/plain-cplusplus/plain-cplusplus.pro
+++ /dev/null
@@ -1,28 +0,0 @@
-QT -= core gui
-greaterThan(QT_MAJOR_VERSION, 4):QT += widgets
-TARGET = plain-c++
-DEFINES += CPLUSPLUS_WITHOUT_QT
-
-macx {
- CONFIG -= app_bundle
- release:LIBS += -Wl,-exported_symbol -Wl,_main
-}
-
-include(../../../src/libs/3rdparty/cplusplus/cplusplus.pri)
-INCLUDEPATH += ../../../src/libs/3rdparty/cplusplus
-
-# Input
-HEADERS += Preprocessor.h
-SOURCES += Preprocessor.cpp
-SOURCES += main.cpp
-
-unix {
- debug:OBJECTS_DIR = $${OUT_PWD}/.obj/debug-shared
- release:OBJECTS_DIR = $${OUT_PWD}/.obj/release-shared
-
- debug:MOC_DIR = $${OUT_PWD}/.moc/debug-shared
- release:MOC_DIR = $${OUT_PWD}/.moc/release-shared
-
- RCC_DIR = $${OUT_PWD}/.rcc/
- UI_DIR = $${OUT_PWD}/.uic/
-}
diff --git a/tests/manual/qml/testfiles/components/MyButton.qml b/tests/manual/qml/testfiles/components/MyButton.qml
index 4138cbf74d..20109e8593 100644
--- a/tests/manual/qml/testfiles/components/MyButton.qml
+++ b/tests/manual/qml/testfiles/components/MyButton.qml
@@ -27,7 +27,7 @@
**
****************************************************************************/
-import Qt 4.7
+import QtQuick 1.1
Rectangle {
width: 64
diff --git a/tests/manual/qml/testfiles/empty.qml b/tests/manual/qml/testfiles/empty.qml
index 11a6607c98..35da140ec6 100644
--- a/tests/manual/qml/testfiles/empty.qml
+++ b/tests/manual/qml/testfiles/empty.qml
@@ -27,7 +27,7 @@
**
****************************************************************************/
-import Qt 4.7
+import QtQuick 1.1
Rectangle {
width: 640
diff --git a/tests/manual/qml/testfiles/flipable.qml b/tests/manual/qml/testfiles/flipable.qml
index 7b0ecd67bc..3a392d7c8e 100644
--- a/tests/manual/qml/testfiles/flipable.qml
+++ b/tests/manual/qml/testfiles/flipable.qml
@@ -27,7 +27,7 @@
**
****************************************************************************/
-import Qt 4.7
+import QtQuick 1.1
Flipable {
width: 640
diff --git a/tests/manual/qml/testfiles/helloworld.qml b/tests/manual/qml/testfiles/helloworld.qml
index 3a53670a80..72b734bea7 100644
--- a/tests/manual/qml/testfiles/helloworld.qml
+++ b/tests/manual/qml/testfiles/helloworld.qml
@@ -27,7 +27,7 @@
**
****************************************************************************/
-import Qt 4.7
+import QtQuick 1.1
Rectangle {
width: 200
diff --git a/tests/manual/qml/testfiles/helloworld_inverted.qml b/tests/manual/qml/testfiles/helloworld_inverted.qml
index 45821b103d..abd81bea39 100644
--- a/tests/manual/qml/testfiles/helloworld_inverted.qml
+++ b/tests/manual/qml/testfiles/helloworld_inverted.qml
@@ -27,7 +27,7 @@
**
****************************************************************************/
-import Qt 4.7
+import QtQuick 1.1
Rectangle {
width: 200
diff --git a/tests/manual/qml/testfiles/images.qml b/tests/manual/qml/testfiles/images.qml
index d9365272e7..99fd5f750d 100644
--- a/tests/manual/qml/testfiles/images.qml
+++ b/tests/manual/qml/testfiles/images.qml
@@ -27,7 +27,7 @@
**
****************************************************************************/
-import Qt 4.7
+import QtQuick 1.1
Rectangle {
width: 640
diff --git a/tests/manual/qml/testfiles/listmodel.qml b/tests/manual/qml/testfiles/listmodel.qml
index bfa72575c1..f437850fb7 100644
--- a/tests/manual/qml/testfiles/listmodel.qml
+++ b/tests/manual/qml/testfiles/listmodel.qml
@@ -27,7 +27,7 @@
**
****************************************************************************/
-import Qt 4.7
+import QtQuick 1.1
ListModel {
id: myModel
diff --git a/tests/manual/qml/testfiles/listview.qml b/tests/manual/qml/testfiles/listview.qml
index 43d26825d3..cc05278807 100644
--- a/tests/manual/qml/testfiles/listview.qml
+++ b/tests/manual/qml/testfiles/listview.qml
@@ -27,7 +27,7 @@
**
****************************************************************************/
-import QtQuick 1.0
+import QtQuick 1.1
Item {
width: 200
diff --git a/tests/manual/qml/testfiles/states.qml b/tests/manual/qml/testfiles/states.qml
index 995ac81cf9..89c03ca79e 100644
--- a/tests/manual/qml/testfiles/states.qml
+++ b/tests/manual/qml/testfiles/states.qml
@@ -27,7 +27,7 @@
**
****************************************************************************/
-import Qt 4.7
+import QtQuick 1.1
Rectangle {
id: rect
diff --git a/tests/manual/qml/testfiles/subcomponent.qml b/tests/manual/qml/testfiles/subcomponent.qml
index b55bd44139..5371099a36 100644
--- a/tests/manual/qml/testfiles/subcomponent.qml
+++ b/tests/manual/qml/testfiles/subcomponent.qml
@@ -27,7 +27,7 @@
**
****************************************************************************/
-import Qt 4.7
+import QtQuick 1.1
Rectangle {
width: 640
diff --git a/tests/manual/qml/testfiles/usingbutton.qml b/tests/manual/qml/testfiles/usingbutton.qml
index c7aae10599..25e5a21a96 100644
--- a/tests/manual/qml/testfiles/usingbutton.qml
+++ b/tests/manual/qml/testfiles/usingbutton.qml
@@ -27,7 +27,7 @@
**
****************************************************************************/
-import Qt 4.7
+import QtQuick 1.1
import "components" as X
Rectangle {
diff --git a/tests/manual/qml/testfiles/webview.qml b/tests/manual/qml/testfiles/webview.qml
index 51c05dd3e6..02d2bca051 100644
--- a/tests/manual/qml/testfiles/webview.qml
+++ b/tests/manual/qml/testfiles/webview.qml
@@ -27,6 +27,7 @@
**
****************************************************************************/
+import QtQuick 1.1
import QtWebKit 1.0
// Test loading of import libraries
diff --git a/tests/system/README b/tests/system/README
index c1c18284d9..c220aa5267 100644
--- a/tests/system/README
+++ b/tests/system/README
@@ -11,8 +11,8 @@ On Linux/Mac this is ~/QtSDK, and on Windows this is C:\QtSDK.
After installing the QtSDK you should use the package manager of the QtSDK (SDKMaintenanceTool) to add some more packages.
You'll need at least Desktop Qt versions 4.7.4, 4.8.0, Harmattan stuff (except QEmu), Maemo Toolchain, Qt Examples, Simulator, Documentation files.
-Third - some of the test suites/test cases expect Qt 5.0.1 and Qt 5.2.1 installed in its default location.
-On Linux/Mac this is ~/Qt5.0.1 or ~/Qt5.2.1, and on Windows this is C:\Qt\Qt5.0.1 or C:\Qt\Qt5.2.1.
+Third - some of the test suites/test cases expect Qt 5.2.1 and Qt 5.3.1 installed in its default location.
+On Linux/Mac this is ~/Qt5.2.1 or ~/Qt5.3.1, and on Windows this is C:\Qt\Qt5.2.1 or C:\Qt\Qt5.3.1.
Fourth - you'll have to provide some additional repositories (and for the hooking into subprocesses even some more Squish bundles, see below).
These additional repositories are located inside ~/QtSDK/src or C:\QtSDK\src (depending on the OS you're on).
@@ -32,6 +32,14 @@ Normally it should be okay to just install them as usual and add their executabl
Attention! If any of these prerequisites cannot be satisfied the tests will likely fail (or not run at all).
+Prerequisites - testing on Qt4
+------------------------------
+If you want to test a Qt Creator based on Qt4, you should make sure that your build of Qt contains the change
+98530cbc3a0bbb633bab96eebb535d7f92ecb1fa
+Qt 4.8.7 will contain this change.
+Additionally, you'll have to set the variable isQt4Build to "True" in shared/classes.py.
+
+
Prerequisites - hooking into subprocesses
-----------------------------------------
The usage of the hook-into subprocess has following prerequisites:
diff --git a/tests/system/objects.map b/tests/system/objects.map
index 8bb268b6fd..37429e2a03 100644
--- a/tests/system/objects.map
+++ b/tests/system/objects.map
@@ -55,7 +55,7 @@
:Compiler:_QLabel {container=':qt_tabwidget_stackedwidget_QWidget' text='Compiler:' type='QLabel' unnamed='1' visible='1'}
:Core__Internal__GeneralSettings.User Interface_QGroupBox {container=':qt_tabwidget_stackedwidget.Core__Internal__GeneralSettings_QWidget' name='interfaceBox' title='User Interface' type='QGroupBox' visible='1'}
:CppTools__Internal__CompletionSettingsPage.Behavior_QGroupBox {container=':qt_tabwidget_stackedwidget.CppTools__Internal__CompletionSettingsPage_QWidget' name='groupBox' title='Behavior' type='QGroupBox' visible='1'}
-:CreateProject_QStyleItem {clip='false' container=':Qt Creator_QDeclarativeView' enabled='true' text='Create Project' type='LinkedText' unnamed='1' visible='true'}
+:CreateProject_QStyleItem {clip='false' container=':WelcomePage.scrollView_ScrollView' enabled='true' text='New Project' type='Button' unnamed='1' visible='true'}
:DebugModeWidget.Breakpoints_QDockWidget {container=':Qt Creator.DebugModeWidget_QSplitter' name='Debugger.Docks.Break' type='QDockWidget' visible='1' windowTitle='Breakpoints'}
:DebugModeWidget.Debugger Log_QDockWidget {container=':Qt Creator.DebugModeWidget_QSplitter' name='Debugger.Docks.Output' type='QDockWidget' visible='1' windowTitle='Debugger Log'}
:DebugModeWidget.Debugger Toolbar_QDockWidget {container=':Qt Creator.DebugModeWidget_QSplitter' name='Debugger Toolbar' type='QDockWidget' visible='1' windowTitle='Debugger Toolbar'}
@@ -115,7 +115,7 @@
:Open File.File name:_QLabel {name='fileNameLabel' text='File name:' type='QLabel' visible='1' window=':Open File_QFileDialog'}
:Open File_QFileDialog {name='QFileDialog' type='QFileDialog' visible='1' windowTitle='Open File'}
:OpenDocuments_Widget {type='Core::Internal::OpenEditorsWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Open Documents'}
-:OpenProject_QStyleItem {clip='false' container=':Qt Creator_QDeclarativeView' enabled='true' text='Open Project' type='LinkedText' unnamed='1' visible='true'}
+:OpenProject_QStyleItem {clip='false' container=':WelcomePage.scrollView_ScrollView' enabled='true' text='Open Project' type='Button' unnamed='1' visible='true'}
:Options.Cancel_QPushButton {text='Cancel' type='QPushButton' unnamed='1' visible='1' window=':Options_Core::Internal::SettingsDialog'}
:Options.OK_QPushButton {text='OK' type='QPushButton' unnamed='1' visible='1' window=':Options_Core::Internal::SettingsDialog'}
:Options.qt_tabwidget_stackedwidget_QStackedWidget {name='qt_tabwidget_stackedwidget' type='QStackedWidget' visible='1' window=':Options_Core::Internal::SettingsDialog'}
diff --git a/tests/system/settings/mac/QtProject/qtcreator/profiles.xml b/tests/system/settings/mac/QtProject/qtcreator/profiles.xml
index dacc8f46ce..ca971e6011 100644
--- a/tests/system/settings/mac/QtProject/qtcreator/profiles.xml
+++ b/tests/system/settings/mac/QtProject/qtcreator/profiles.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProfiles>
-<!-- Written by QtCreator 2.8.82, 2013-10-24T18:43:10. -->
+<!-- Written by QtCreator 3.1.84, 2014-07-28T14:22:51. -->
<qtcreator>
<data>
<variable>Profile.0</variable>
@@ -111,6 +111,7 @@
<variable>Profile.5</variable>
<valuemap type="QVariantMap">
<value type="bool" key="PE.Profile.AutoDetected">false</value>
+ <value type="QString" key="PE.Profile.AutoDetectionSource"></value>
<valuemap type="QVariantMap" key="PE.Profile.Data">
<value type="QString" key="Android.GdbServer.Information"></value>
<value type="QString" key="Debugger.Information">{2f514661-b9f7-4f83-8822-a9a9d0699600}</value>
@@ -119,13 +120,14 @@
<value type="QString" key="PE.Profile.SysRoot"></value>
<value type="QString" key="PE.Profile.ToolChain">ProjectExplorer.ToolChain.Clang:{6afe7dea-8caa-424e-b370-b7b0a34015fb}</value>
<value type="QString" key="QtPM4.mkSpecInformation"></value>
- <value type="int" key="QtSupport.QtInformation">7</value>
+ <value type="int" key="QtSupport.QtInformation">9</value>
</valuemap>
<value type="QString" key="PE.Profile.Icon">:///DESKTOP///</value>
- <value type="QString" key="PE.Profile.Id">{9c58fcfd-9e49-4a08-971f-a677dc9ce185}</value>
+ <value type="QString" key="PE.Profile.Id">{fc5f34fd-e703-4f4c-85ce-ea5bf5869e6a}</value>
<valuelist type="QVariantList" key="PE.Profile.MutableInfo"/>
- <value type="QString" key="PE.Profile.Name">Desktop 501 default</value>
+ <value type="QString" key="PE.Profile.Name">Desktop 521 default</value>
<value type="bool" key="PE.Profile.SDK">false</value>
+ <valuelist type="QVariantList" key="PE.Profile.StickyInfo"/>
</valuemap>
</data>
<data>
@@ -162,13 +164,14 @@
<value type="QString" key="PE.Profile.SysRoot"></value>
<value type="QString" key="PE.Profile.ToolChain">ProjectExplorer.ToolChain.Clang:{6afe7dea-8caa-424e-b370-b7b0a34015fb}</value>
<value type="QString" key="QtPM4.mkSpecInformation"></value>
- <value type="int" key="QtSupport.QtInformation">9</value>
+ <value type="int" key="QtSupport.QtInformation">11</value>
</valuemap>
<value type="QString" key="PE.Profile.Icon">:///DESKTOP///</value>
- <value type="QString" key="PE.Profile.Id">{fc5f34fd-e703-4f4c-85ce-ea5bf5869e6a}</value>
+ <value type="QString" key="PE.Profile.Id">{a1e860d1-c241-4abf-80fe-cf0c9f0a43b3}</value>
<valuelist type="QVariantList" key="PE.Profile.MutableInfo"/>
- <value type="QString" key="PE.Profile.Name">Desktop 521 default</value>
+ <value type="QString" key="PE.Profile.Name">Desktop 531 default</value>
<value type="bool" key="PE.Profile.SDK">false</value>
+ <valuelist type="QVariantList" key="PE.Profile.StickyInfo"/>
</valuemap>
</data>
<data>
diff --git a/tests/system/settings/mac/QtProject/qtcreator/qtversion.xml b/tests/system/settings/mac/QtProject/qtcreator/qtversion.xml
index 9dd3b5f076..941d0cac12 100644
--- a/tests/system/settings/mac/QtProject/qtcreator/qtversion.xml
+++ b/tests/system/settings/mac/QtProject/qtcreator/qtversion.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorQtVersions>
-<!-- Written by Qt Creator 2.5.81, 2012-06-27T15:58:50. -->
+<!-- Written by Qt Creator 3.1.84, 2014-07-28T14:22:16. -->
<qtcreator>
<data>
<variable>QtVersion.0</variable>
@@ -55,9 +55,9 @@
<data>
<variable>QtVersion.5</variable>
<valuemap type="QVariantMap">
- <value type="int" key="Id">7</value>
- <value type="QString" key="Name">Desktop Qt 5.0.1 (SQUISH_DEFAULT_COMPILER)</value>
- <value type="QString" key="QMakePath">~/Qt5.0.1/5.0.1/SQUISH_DEFAULT_COMPILER/bin/qmake</value>
+ <value type="int" key="Id">9</value>
+ <value type="QString" key="Name">Desktop Qt 5.2.1 (SQUISH_DEFAULT_COMPILER)</value>
+ <value type="QString" key="QMakePath">~/Qt5.2.1/5.2.1/SQUISH_DEFAULT_COMPILER/bin/qmake</value>
<value type="QString" key="QtVersion.Type">Qt4ProjectManager.QtVersion.Desktop</value>
<value type="bool" key="isAutodetected">false</value>
</valuemap>
@@ -65,9 +65,9 @@
<data>
<variable>QtVersion.6</variable>
<valuemap type="QVariantMap">
- <value type="int" key="Id">9</value>
- <value type="QString" key="Name">Desktop Qt 5.2.1 (SQUISH_DEFAULT_COMPILER)</value>
- <value type="QString" key="QMakePath">~/Qt5.2.1/5.2.1/SQUISH_DEFAULT_COMPILER/bin/qmake</value>
+ <value type="int" key="Id">11</value>
+ <value type="QString" key="Name">Desktop Qt 5.3.1 (SQUISH_DEFAULT_COMPILER)</value>
+ <value type="QString" key="QMakePath">~/Qt5.3.1/5.3/SQUISH_DEFAULT_COMPILER/bin/qmake</value>
<value type="QString" key="QtVersion.Type">Qt4ProjectManager.QtVersion.Desktop</value>
<value type="bool" key="isAutodetected">false</value>
</valuemap>
diff --git a/tests/system/settings/unix/QtProject/qtcreator/profiles.xml b/tests/system/settings/unix/QtProject/qtcreator/profiles.xml
index 2e15247fc1..b515d34047 100644
--- a/tests/system/settings/unix/QtProject/qtcreator/profiles.xml
+++ b/tests/system/settings/unix/QtProject/qtcreator/profiles.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProfiles>
-<!-- Written by QtCreator 2.8.82, 2013-10-24T18:43:10. -->
+<!-- Written by QtCreator 3.1.83, 2014-07-22T13:13:46. -->
<qtcreator>
<data>
<variable>Profile.0</variable>
@@ -111,6 +111,7 @@
<variable>Profile.5</variable>
<valuemap type="QVariantMap">
<value type="bool" key="PE.Profile.AutoDetected">false</value>
+ <value type="QString" key="PE.Profile.AutoDetectionSource"></value>
<valuemap type="QVariantMap" key="PE.Profile.Data">
<value type="QString" key="Android.GdbServer.Information"></value>
<value type="QString" key="Debugger.Information">{70e26273-2c0b-4534-bbc0-eb6ca670821a}</value>
@@ -119,13 +120,14 @@
<value type="QString" key="PE.Profile.SysRoot"></value>
<value type="QString" key="PE.Profile.ToolChain">ProjectExplorer.ToolChain.Gcc:{c3f59b87-6997-4bd8-8067-ee04dc536371}</value>
<value type="QString" key="QtPM4.mkSpecInformation"></value>
- <value type="int" key="QtSupport.QtInformation">7</value>
+ <value type="int" key="QtSupport.QtInformation">9</value>
</valuemap>
<value type="QString" key="PE.Profile.Icon">:///DESKTOP///</value>
- <value type="QString" key="PE.Profile.Id">{9c58fcfd-9e49-4a08-971f-a677dc9ce185}</value>
+ <value type="QString" key="PE.Profile.Id">{17ae70be-817d-4019-9337-fa7761c4b0ed}</value>
<valuelist type="QVariantList" key="PE.Profile.MutableInfo"/>
- <value type="QString" key="PE.Profile.Name">Desktop 501 default</value>
+ <value type="QString" key="PE.Profile.Name">Desktop 521 default</value>
<value type="bool" key="PE.Profile.SDK">false</value>
+ <valuelist type="QVariantList" key="PE.Profile.StickyInfo"/>
</valuemap>
</data>
<data>
@@ -162,13 +164,14 @@
<value type="QString" key="PE.Profile.SysRoot"></value>
<value type="QString" key="PE.Profile.ToolChain">ProjectExplorer.ToolChain.Gcc:{c3f59b87-6997-4bd8-8067-ee04dc536371}</value>
<value type="QString" key="QtPM4.mkSpecInformation"></value>
- <value type="int" key="QtSupport.QtInformation">9</value>
+ <value type="int" key="QtSupport.QtInformation">11</value>
</valuemap>
<value type="QString" key="PE.Profile.Icon">:///DESKTOP///</value>
- <value type="QString" key="PE.Profile.Id">{17ae70be-817d-4019-9337-fa7761c4b0ed}</value>
+ <value type="QString" key="PE.Profile.Id">{e91398ba-6443-4b02-b416-782a70d9df90}</value>
<valuelist type="QVariantList" key="PE.Profile.MutableInfo"/>
- <value type="QString" key="PE.Profile.Name">Desktop 521 default</value>
+ <value type="QString" key="PE.Profile.Name">Desktop 531 default</value>
<value type="bool" key="PE.Profile.SDK">false</value>
+ <valuelist type="QVariantList" key="PE.Profile.StickyInfo"/>
</valuemap>
</data>
<data>
diff --git a/tests/system/settings/unix/QtProject/qtcreator/qtversion.xml b/tests/system/settings/unix/QtProject/qtcreator/qtversion.xml
index 9dd3b5f076..6ed59e9a93 100644
--- a/tests/system/settings/unix/QtProject/qtcreator/qtversion.xml
+++ b/tests/system/settings/unix/QtProject/qtcreator/qtversion.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorQtVersions>
-<!-- Written by Qt Creator 2.5.81, 2012-06-27T15:58:50. -->
+<!-- Written by QtCreator 3.1.83, 2014-07-22T13:13:46. -->
<qtcreator>
<data>
<variable>QtVersion.0</variable>
@@ -55,9 +55,9 @@
<data>
<variable>QtVersion.5</variable>
<valuemap type="QVariantMap">
- <value type="int" key="Id">7</value>
- <value type="QString" key="Name">Desktop Qt 5.0.1 (SQUISH_DEFAULT_COMPILER)</value>
- <value type="QString" key="QMakePath">~/Qt5.0.1/5.0.1/SQUISH_DEFAULT_COMPILER/bin/qmake</value>
+ <value type="int" key="Id">9</value>
+ <value type="QString" key="Name">Desktop Qt 5.2.1 (SQUISH_DEFAULT_COMPILER)</value>
+ <value type="QString" key="QMakePath">~/Qt5.2.1/5.2.1/SQUISH_DEFAULT_COMPILER/bin/qmake</value>
<value type="QString" key="QtVersion.Type">Qt4ProjectManager.QtVersion.Desktop</value>
<value type="bool" key="isAutodetected">false</value>
</valuemap>
@@ -65,9 +65,9 @@
<data>
<variable>QtVersion.6</variable>
<valuemap type="QVariantMap">
- <value type="int" key="Id">9</value>
- <value type="QString" key="Name">Desktop Qt 5.2.1 (SQUISH_DEFAULT_COMPILER)</value>
- <value type="QString" key="QMakePath">~/Qt5.2.1/5.2.1/SQUISH_DEFAULT_COMPILER/bin/qmake</value>
+ <value type="int" key="Id">11</value>
+ <value type="QString" key="Name">Qt 5.3.1 (SQUISH_DEFAULT_COMPILER)</value>
+ <value type="QString" key="QMakePath">~/Qt5.3.1/5.3/SQUISH_DEFAULT_COMPILER/bin/qmake</value>
<value type="QString" key="QtVersion.Type">Qt4ProjectManager.QtVersion.Desktop</value>
<value type="bool" key="isAutodetected">false</value>
</valuemap>
diff --git a/tests/system/settings/windows/QtProject/qtcreator/profiles.xml b/tests/system/settings/windows/QtProject/qtcreator/profiles.xml
index 658e518ffd..f04407b93b 100644
--- a/tests/system/settings/windows/QtProject/qtcreator/profiles.xml
+++ b/tests/system/settings/windows/QtProject/qtcreator/profiles.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProfiles>
-<!-- Written by QtCreator 2.8.82, 2013-10-24T15:19:45. -->
+<!-- Written by QtCreator 3.1.83, 2014-07-21T18:40:39. -->
<qtcreator>
<data>
<variable>Profile.0</variable>
@@ -111,6 +111,7 @@
<variable>Profile.5</variable>
<valuemap type="QVariantMap">
<value type="bool" key="PE.Profile.AutoDetected">false</value>
+ <value type="QString" key="PE.Profile.AutoDetectionSource"></value>
<valuemap type="QVariantMap" key="PE.Profile.Data">
<value type="QString" key="Android.GdbServer.Information"></value>
<value type="QString" key="Debugger.Information">{811977c9-ea95-4616-bc28-c66d1935ff65}</value>
@@ -119,13 +120,14 @@
<value type="QString" key="PE.Profile.SysRoot"></value>
<value type="QString" key="PE.Profile.ToolChain">ProjectExplorer.ToolChain.Msvc:{1186dad9-c485-4f69-b7e1-aff54c89ecb2}</value>
<value type="QString" key="QtPM4.mkSpecInformation"></value>
- <value type="int" key="QtSupport.QtInformation">18</value>
+ <value type="int" key="QtSupport.QtInformation">20</value>
</valuemap>
<value type="QString" key="PE.Profile.Icon">:///DESKTOP///</value>
- <value type="QString" key="PE.Profile.Id">{175f6238-a585-4e62-b2d3-d15e90296bb6}</value>
+ <value type="QString" key="PE.Profile.Id">{6a95566e-8372-4372-8286-ef73af7de191}</value>
<valuelist type="QVariantList" key="PE.Profile.MutableInfo"/>
- <value type="QString" key="PE.Profile.Name">Desktop 501 default</value>
+ <value type="QString" key="PE.Profile.Name">Desktop 531 default</value>
<value type="bool" key="PE.Profile.SDK">false</value>
+ <valuelist type="QVariantList" key="PE.Profile.StickyInfo"/>
</valuemap>
</data>
<data>
diff --git a/tests/system/settings/windows/QtProject/qtcreator/qtversion.xml b/tests/system/settings/windows/QtProject/qtcreator/qtversion.xml
index 543ca215c0..853d07393c 100644
--- a/tests/system/settings/windows/QtProject/qtcreator/qtversion.xml
+++ b/tests/system/settings/windows/QtProject/qtcreator/qtversion.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorQtVersions>
-<!-- Written by QtCreator 2.8.1, 2013-07-15T17:43:58. -->
+<!-- Written by QtCreator 3.1.83, 2014-07-21T18:40:39. -->
<qtcreator>
<data>
<variable>QtVersion.0</variable>
@@ -65,9 +65,9 @@
<data>
<variable>QtVersion.6</variable>
<valuemap type="QVariantMap">
- <value type="int" key="Id">18</value>
- <value type="QString" key="Name">Desktop Qt 5.0.1 (msvc2010)</value>
- <value type="QString" key="QMakePath">C:/Qt/Qt5.0.1/5.0.1/msvc2010/bin/qmake.exe</value>
+ <value type="int" key="Id">4</value>
+ <value type="QString" key="Name">Desktop Qt 5.2.1 (msvc2010)</value>
+ <value type="QString" key="QMakePath">C:/Qt/Qt5.2.1/5.2.1/msvc2010/bin/qmake.exe</value>
<value type="QString" key="QtVersion.Type">Qt4ProjectManager.QtVersion.Desktop</value>
<value type="bool" key="isAutodetected">false</value>
</valuemap>
@@ -75,9 +75,9 @@
<data>
<variable>QtVersion.7</variable>
<valuemap type="QVariantMap">
- <value type="int" key="Id">4</value>
- <value type="QString" key="Name">Desktop Qt 5.2.1 (msvc2010)</value>
- <value type="QString" key="QMakePath">C:/Qt/Qt5.2.1/5.2.1/msvc2010/bin/qmake.exe</value>
+ <value type="int" key="Id">20</value>
+ <value type="QString" key="Name">Qt 5.3.1 (msvc2010_opengl)</value>
+ <value type="QString" key="QMakePath">C:/Qt/Qt5.3.1/5.3/msvc2010_opengl/bin/qmake.exe</value>
<value type="QString" key="QtVersion.Type">Qt4ProjectManager.QtVersion.Desktop</value>
<value type="bool" key="isAutodetected">false</value>
</valuemap>
diff --git a/tests/system/shared/classes.py b/tests/system/shared/classes.py
index 35061df5c0..87ffc83903 100644
--- a/tests/system/shared/classes.py
+++ b/tests/system/shared/classes.py
@@ -40,13 +40,13 @@ class Targets:
HARMATTAN = 16
EMBEDDED_LINUX = 32
DESKTOP_480_MSVC2010 = 64
- DESKTOP_501_DEFAULT = 128
- DESKTOP_521_DEFAULT = 256
+ DESKTOP_521_DEFAULT = 128
+ DESKTOP_531_DEFAULT = 256
@staticmethod
def desktopTargetClasses():
desktopTargets = (Targets.DESKTOP_474_GCC | Targets.DESKTOP_480_GCC
- | Targets.DESKTOP_501_DEFAULT | Targets.DESKTOP_521_DEFAULT)
+ | Targets.DESKTOP_521_DEFAULT | Targets.DESKTOP_531_DEFAULT)
if platform.system() in ('Windows', 'Microsoft'):
desktopTargets |= Targets.DESKTOP_480_MSVC2010
return desktopTargets
@@ -67,10 +67,10 @@ class Targets:
return "Embedded Linux"
elif target == Targets.DESKTOP_480_MSVC2010:
return "Desktop 480 MSVC2010"
- elif target == Targets.DESKTOP_501_DEFAULT:
- return "Desktop 501 default"
elif target == Targets.DESKTOP_521_DEFAULT:
return "Desktop 521 default"
+ elif target == Targets.DESKTOP_531_DEFAULT:
+ return "Desktop 531 default"
else:
return None
@@ -88,13 +88,17 @@ class Targets:
def intToArray(targets):
available = [Targets.DESKTOP_474_GCC, Targets.DESKTOP_480_GCC, Targets.SIMULATOR, Targets.MAEMO5,
Targets.HARMATTAN, Targets.EMBEDDED_LINUX, Targets.DESKTOP_480_MSVC2010,
- Targets.DESKTOP_501_DEFAULT, Targets.DESKTOP_521_DEFAULT]
+ Targets.DESKTOP_521_DEFAULT, Targets.DESKTOP_531_DEFAULT]
return filter(lambda x: x & targets == x, available)
@staticmethod
def arrayToInt(targetArr):
return reduce(operator.or_, targetArr, 0)
+ @staticmethod
+ def getDefaultKit():
+ return Targets.DESKTOP_521_DEFAULT
+
# this class holds some constants for easier usage inside the Projects view
class ProjectSettings:
BUILD = 1
diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py
index 3e62cccb85..f94dfa445c 100644
--- a/tests/system/shared/project.py
+++ b/tests/system/shared/project.py
@@ -385,8 +385,8 @@ def __chooseTargets__(targets=Targets.DESKTOP_474_GCC, availableTargets=None):
available = availableTargets
else:
# following targets depend on the build environment - added for further/later tests
- available = [Targets.DESKTOP_474_GCC, Targets.DESKTOP_480_GCC, Targets.DESKTOP_501_DEFAULT,
- Targets.DESKTOP_521_DEFAULT, Targets.MAEMO5, Targets.EMBEDDED_LINUX,
+ available = [Targets.DESKTOP_474_GCC, Targets.DESKTOP_480_GCC, Targets.DESKTOP_521_DEFAULT,
+ Targets.DESKTOP_531_DEFAULT, Targets.MAEMO5, Targets.EMBEDDED_LINUX,
Targets.SIMULATOR, Targets.HARMATTAN]
if platform.system() in ('Windows', 'Microsoft'):
available.remove(Targets.EMBEDDED_LINUX)
@@ -620,7 +620,7 @@ def __getSupportedPlatforms__(text, templateName, getAsStrings=False):
result.append(Targets.EMBEDDED_LINUX)
elif platform.system() in ('Windows', 'Microsoft'):
result.append(Targets.DESKTOP_480_MSVC2010)
- result.extend([Targets.DESKTOP_501_DEFAULT, Targets.DESKTOP_521_DEFAULT])
+ result.extend([Targets.DESKTOP_521_DEFAULT, Targets.DESKTOP_531_DEFAULT])
if 'MeeGo/Harmattan' in supports:
result.append(Targets.HARMATTAN)
if 'Maemo/Fremantle' in supports:
@@ -629,8 +629,8 @@ def __getSupportedPlatforms__(text, templateName, getAsStrings=False):
result.append(Targets.SIMULATOR)
elif 'Platform independent' in text:
# MAEMO5 and HARMATTAN could be wrong here - depends on having Madde plugin enabled or not
- result = [Targets.DESKTOP_474_GCC, Targets.DESKTOP_480_GCC, Targets.DESKTOP_501_DEFAULT,
- Targets.DESKTOP_521_DEFAULT, Targets.MAEMO5, Targets.SIMULATOR, Targets.HARMATTAN]
+ result = [Targets.DESKTOP_474_GCC, Targets.DESKTOP_480_GCC, Targets.DESKTOP_521_DEFAULT,
+ Targets.DESKTOP_531_DEFAULT, Targets.MAEMO5, Targets.SIMULATOR, Targets.HARMATTAN]
if platform.system() in ('Windows', 'Microsoft'):
result.append(Targets.DESKTOP_480_MSVC2010)
else:
diff --git a/tests/system/shared/qtcreator.py b/tests/system/shared/qtcreator.py
index 218c59049f..086aa9411e 100644
--- a/tests/system/shared/qtcreator.py
+++ b/tests/system/shared/qtcreator.py
@@ -121,10 +121,6 @@ def waitForCleanShutdown(timeOut=10):
break
def checkForStillRunningQmlExecutable(possibleNames):
- if JIRA.isBugStillOpen(12644):
- possibleNames.append('WerFault.exe')
- else:
- test.warning("Remove temporary workaround for QTCREATORBUG-12644!")
for qmlHelper in possibleNames:
tasks = subprocess.Popen("tasklist /FI \"IMAGENAME eq %s\"" % qmlHelper, shell=True,
stdout=subprocess.PIPE)
diff --git a/tests/system/shared/suites_qtta.py b/tests/system/shared/suites_qtta.py
index 01ed84a0da..8dce154b81 100755
--- a/tests/system/shared/suites_qtta.py
+++ b/tests/system/shared/suites_qtta.py
@@ -88,6 +88,10 @@ def checkIfObjectItemExists(object, item, timeout = 3000):
def getQmlItem(type, container, clip, text=""):
if (container.startswith(":")):
container = "'%s'" % container
- clip = ("%s" % __builtin__.bool(clip)).lower()
- return ("{clip='%s' container=%s enabled='true' %s type='%s' unnamed='1' visible='true'}"
- % (clip, container, text, type)) \ No newline at end of file
+ if clip != None:
+ clip = ("%s" % __builtin__.bool(clip)).lower()
+ return ("{clip='%s' container=%s enabled='true' %s type='%s' unnamed='1' visible='true'}"
+ % (clip, container, text, type))
+ else:
+ return ("{container=%s enabled='true' %s type='%s' unnamed='1' visible='true'}"
+ % (container, text, type))
diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py
index c3177280a3..b9e35782ec 100644
--- a/tests/system/shared/utils.py
+++ b/tests/system/shared/utils.py
@@ -540,7 +540,7 @@ def setAlwaysStartFullHelp():
waitForObjectItem(":Options_QListView", "Help")
clickItem(":Options_QListView", "Help", 5, 5, 0, Qt.LeftButton)
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "General")
- selectFromCombo(":Startup.contextHelpComboBox_QComboBox", "Always Start Full Help")
+ selectFromCombo(":Startup.contextHelpComboBox_QComboBox", "Always Show in Help Mode")
clickButton(waitForObject(":Options.OK_QPushButton"))
def removePackagingDirectory(projectPath):
@@ -674,3 +674,7 @@ def getHelpTitle():
return str(hv.title)
except:
return str(hv.documentTitle)
+
+def canTestEmbeddedQtQuick():
+ return (squishinfo.major * 0x10000 + squishinfo.minor * 0x100
+ + squishinfo.patch) > 0x050100
diff --git a/tests/system/suite_CCOM/tst_CCOM01/test.py b/tests/system/suite_CCOM/tst_CCOM01/test.py
index e0b9016fef..f795ede512 100755
--- a/tests/system/suite_CCOM/tst_CCOM01/test.py
+++ b/tests/system/suite_CCOM/tst_CCOM01/test.py
@@ -44,7 +44,7 @@ def main():
return
# open example project
# qmlapplicationviewer of this example supports only Qt version < 5
- targets = Targets.desktopTargetClasses() ^ Targets.DESKTOP_501_DEFAULT ^ Targets.DESKTOP_521_DEFAULT
+ targets = Targets.desktopTargetClasses() ^ Targets.DESKTOP_521_DEFAULT ^ Targets.DESKTOP_531_DEFAULT
checkedTargets = openQmakeProject(examplePath, targets)
if not replaceLine("propertyanimation.Sources.main\\.cpp",
"#include <QtGui/QApplication>",
diff --git a/tests/system/suite_CCOM/tst_CCOM02/test.py b/tests/system/suite_CCOM/tst_CCOM02/test.py
index 6244c58ef6..fa2023bcd0 100755
--- a/tests/system/suite_CCOM/tst_CCOM02/test.py
+++ b/tests/system/suite_CCOM/tst_CCOM02/test.py
@@ -44,7 +44,7 @@ def main():
if not startedWithoutPluginError():
return
# open example project
- targets = Targets.desktopTargetClasses() ^ Targets.DESKTOP_501_DEFAULT ^ Targets.DESKTOP_521_DEFAULT
+ targets = Targets.desktopTargetClasses() ^ Targets.DESKTOP_521_DEFAULT ^ Targets.DESKTOP_531_DEFAULT
openQmakeProject(examplePath, targets)
# create syntax error
openDocument("propertyanimation.QML.qml.property-animation\\.qml")
diff --git a/tests/system/suite_WELP/tst_WELP01/test.py b/tests/system/suite_WELP/tst_WELP01/test.py
index 708d6b14a6..e5148e4f6b 100755
--- a/tests/system/suite_WELP/tst_WELP01/test.py
+++ b/tests/system/suite_WELP/tst_WELP01/test.py
@@ -30,91 +30,118 @@
source("../../shared/qtcreator.py")
source("../../shared/suites_qtta.py")
-webPageContentLoadedValue = 0
-gettingStartedText = getQmlItem("Text", ":Qt Creator_QDeclarativeView", False,
- "text='Getting Started'")
-
-# wait until help gets loaded
-def webPageContentLoaded(*args):
- global webPageContentLoadedValue
- objectClass = str(args[0].metaObject().className())
- if objectClass in ("QWebPage", "Help::Internal::HelpViewer"):
- webPageContentLoadedValue += 1
+gettingStartedText = getQmlItem("Button", ":WelcomePage.scrollView_ScrollView", False,
+ "text='Get Started Now' id='gettingStartedButton'")
def clickItemVerifyHelpCombo(qmlItem, expectedHelpComboRegex, testDetails):
global gettingStartedText
- webPageContentLoadedValue = 0
mouseClick(waitForObject(qmlItem), 5, 5, 0, Qt.LeftButton)
- waitFor("webPageContentLoadedValue == 4", 5000)
- foundText = str(waitForObject(":Qt Creator_HelpSelector_QComboBox").currentText)
- if not test.verify(re.match(expectedHelpComboRegex, foundText), testDetails):
- test.log("Found %s" % foundText)
+ helpCombo = waitForObject(":Qt Creator_HelpSelector_QComboBox")
+ if not test.verify(waitFor('re.match(expectedHelpComboRegex, str(helpCombo.currentText))',
+ 5000), testDetails):
+ test.log("Found %s" % str(helpCombo.currentText))
# select "Welcome" page from left toolbar again
switchViewTo(ViewConstants.WELCOME)
test.verify(checkIfObjectExists(gettingStartedText),
- "Verifying: Getting Started topic is being displayed.")
+ "Verifying: Get Started Now button is being displayed.")
+
+def waitForButtonsState(projectsChecked, examplesChecked, tutorialsChecked, timeout=5000):
+ projButton = waitForObject(getQmlItem("Button", ":WelcomePage.scrollView_ScrollView", False,
+ "text='Projects'"))
+ exmpButton = waitForObject(getQmlItem("Button", ":WelcomePage.scrollView_ScrollView", False,
+ "text='Examples'"))
+ tutoButton = waitForObject(getQmlItem("Button", ":WelcomePage.scrollView_ScrollView", False,
+ "text='Tutorials'"))
+ return waitFor('projButton.checked == projectsChecked '
+ 'and exmpButton.checked == examplesChecked '
+ 'and tutoButton.checked == tutorialsChecked', timeout)
def main():
- test.log("Welcome mode is not scriptable at the moment")
- return
- global webPageContentLoadedValue, gettingStartedText
+ if isQt4Build or not canTestEmbeddedQtQuick():
+ test.log("Welcome mode is not available or not scriptable with this Squish version")
+ return
+ global gettingStartedText
# open Qt Creator
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
- installLazySignalHandler(":QWebPage","loadFinished(bool)", "webPageContentLoaded")
- installLazySignalHandler(":Qt Creator_Help::Internal::HelpViewer", "loadFinished(bool)",
- "webPageContentLoaded")
+
setAlwaysStartFullHelp()
addCurrentCreatorDocumentation()
- if not test.verify(checkIfObjectExists(gettingStartedText),
- "Verifying: Qt Creator displays Welcome Page with Getting Started."):
- mouseClick(waitForObject(getQmlItem("LinkedText", ":Qt Creator_QDeclarativeView", False,
- "text='Getting Started'")), 5, 5, 0, Qt.LeftButton)
- qmlItem = getQmlItem("LinkedText", ":Qt Creator_QDeclarativeView", False, "text='User Guide'")
+
+ buttonsAndState = {'Projects':True, 'Examples':False, 'Tutorials':False, 'New Project':False,
+ 'Open Project':False}
+ for button, state in buttonsAndState.items():
+ qmlItem = getQmlItem("Button", ":WelcomePage.scrollView_ScrollView", False,
+ "text='%s'" % button)
+ if test.verify(checkIfObjectExists(qmlItem),
+ "Verifying whether '%s' button is shown." % button):
+ buttonObj = findObject(qmlItem)
+ test.compare(buttonObj.checked, state, "Verifying whether '%s' button is checked."
+ % button)
+
+ test.verify(checkIfObjectExists(gettingStartedText),
+ "Verifying: Qt Creator displays Welcome Page with 'Get Started Now' button.")
expectedText = "(QtCreator : Qt Creator Manual)|(Qt Creator Manual [|] QtCreator)"
testDetails = "Verifying: Help with Creator Documentation is being opened."
- # select "User Guide" topic
- clickItemVerifyHelpCombo(qmlItem, expectedText, testDetails)
- # check "Online Community" link
- test.verify(checkIfObjectExists(getQmlItem("LinkedText", ":Qt Creator_QDeclarativeView", False,
- "text='Online Community'")),
- "Verifying: Link to Qt forums exists.")
- test.verify(checkIfObjectExists(getQmlItem("LinkedText", ":Qt Creator_QDeclarativeView", False,
- "text='Blogs'")),
- "Verifying: Link to Planet Qt exists.")
- qmlItem = getQmlItem("Text", ":Qt Creator_QDeclarativeView", False, "text='IDE Overview'")
- expectedText = "(QtCreator : IDE Overview)|(IDE Overview [|] QtCreator)"
- testDetails = "Verifying: Help with IDE Overview topic is being opened."
- # select "IDE Overview"
- clickItemVerifyHelpCombo(qmlItem, expectedText, testDetails)
- qmlItem = getQmlItem("Text", ":Qt Creator_QDeclarativeView", False, "text='User Interface'")
- expectedText = "(QtCreator : User Interface)|(User Interface [|]) QtCreator"
- testDetails = "Verifying: Help with User Interface topic is being opened."
- # select "User interface"
- clickItemVerifyHelpCombo(qmlItem, expectedText, testDetails)
- # select "Building and Running an Example Application"
- webPageContentLoadedValue = 0
- mouseClick(waitForObject(getQmlItem("Text", ":Qt Creator_QDeclarativeView", False,
- "text='Building and Running an Example Application'")),
- 5, 5, 0, Qt.LeftButton)
- waitFor("webPageContentLoadedValue == 4", 5000)
- checkPattern = ("(QtCreator : Building and Running an Example( Application)?)"
- "|(Building and Running an Example( Application)? [|] QtCreator)")
- checkText = str(waitForObject(":Qt Creator_HelpSelector_QComboBox").currentText)
- if not test.verify(re.search(checkPattern, checkText),
- "Verifying: Building and Running an Example is opened."):
- test.fail("Pattern does not match: '%s', text found in QComboBox is: "
- "'%s'" % (checkPattern, checkText))
+
+ clickItemVerifyHelpCombo(gettingStartedText, expectedText, testDetails)
+ textUrls = {'Online Community':'http://qt-project.org/forums',
+ 'Blogs':'http://planet.qt-project.org',
+ 'Qt Account':'https://login.qt.digia.com/qtaccount',
+ 'Qt Cloud Services':'https://developer.qtcloudservices.com',
+ 'User Guide':'qthelp://org.qt-project.qtcreator/doc/index.html'
+ }
+ for text, url in textUrls.items():
+ qmlItem = getQmlItem("LinkedText", ":WelcomePage.scrollView_ScrollView", False,
+ "text='%s'" % text)
+ if test.verify(checkIfObjectExists(qmlItem),
+ "Verifying: Link to %s exists." % text):
+ itemObj = findObject(qmlItem)
+ # some URLs might have varying parameters - limiting them to URL without a query
+ if url.startswith("qthelp"):
+ relevantUrlPart = str(itemObj.parent.openHelpUrl).split("?")[0]
+ else:
+ relevantUrlPart = str(itemObj.parent.openUrl).split("?")[0]
+ test.compare(relevantUrlPart, url, "Verifying link.")
+
+ mouseClick(gettingStartedText, 5, 5, 0, Qt.LeftButton)
+ qcManualQModelIndexStr = getQModelIndexStr("text~='Qt Creator Manual [0-9.]+'",
+ ":Qt Creator_QHelpContentWidget")
+ if str(waitForObject(":Qt Creator_HelpSelector_QComboBox").currentText) == "(Untitled)":
+ mouseClick(qcManualQModelIndexStr, 5, 5, 0, Qt.LeftButton)
+ test.warning("Clicking 'Get Started Now' the second time showed blank page (Untitled)")
+
# select "Welcome" page from left toolbar again
switchViewTo(ViewConstants.WELCOME)
test.verify(checkIfObjectExists(gettingStartedText),
"Verifying: Getting Started topic is being displayed.")
- # select "Start Developing"
- mouseClick(waitForObject(getQmlItem("Text", ":Qt Creator_QDeclarativeView", False,
- "text='Start Developing'")), 5, 5, 0, Qt.LeftButton)
- test.verify(checkIfObjectExists(getQmlItem("Text", ":Qt Creator_QDeclarativeView", False,
- "text='Tutorials'")),
- "Verifying: Tutorials are opened in Welcome Page.")
+ # select Examples and roughly check them
+ mouseClick(waitForObject(getQmlItem("Button", ":WelcomePage.scrollView_ScrollView", False,
+ "text='Examples'")), 5, 5, 0, Qt.LeftButton)
+ waitForButtonsState(False, True, False)
+ expect = (("Rectangle", "id='rectangle1' radius='0'", "examples rectangle"),
+ ("TextField", "id='lineEdit' placeholderText='Search in Examples...'",
+ "examples search line edit"),
+ ("ComboBox", "id='comboBox'", "Qt version combo box"),
+ ("Delegate", "id='delegate' radius='0' caption~='.*Example'", "at least one example")
+ )
+ for (qType, prop, info) in expect:
+ test.verify(checkIfObjectExists(getQmlItem(qType, ":WelcomePage.scrollView_ScrollView",
+ None, prop)),
+ "Verifying whether %s is shown" % info)
+ # select Tutorials and roughly check them
+ mouseClick(waitForObject(getQmlItem("Button", ":WelcomePage.scrollView_ScrollView", False,
+ "text='Tutorials'")), 5, 5, 0, Qt.LeftButton)
+ waitForButtonsState(False, False, True)
+ expect = (("Rectangle", "id='rectangle1' radius='0'", "tutorials rectangle"),
+ ("TextField", "id='lineEdit' placeholderText='Search in Tutorials...'",
+ "tutorials search line edit"),
+ ("Delegate", "id='delegate' radius='0' caption~='Creating.*'", "at least one tutorial")
+ )
+ for (qType, prop, info) in expect:
+ test.verify(checkIfObjectExists(getQmlItem(qType, ":WelcomePage.scrollView_ScrollView",
+ None, prop)),
+ "Verifying whether %s is shown" % info)
# exit Qt Creator
invokeMenuItem("File", "Exit")
diff --git a/tests/system/suite_WELP/tst_WELP02/test.py b/tests/system/suite_WELP/tst_WELP02/test.py
index 2eb82568e9..e04fdb3163 100644
--- a/tests/system/suite_WELP/tst_WELP02/test.py
+++ b/tests/system/suite_WELP/tst_WELP02/test.py
@@ -30,9 +30,16 @@
source("../../shared/qtcreator.py")
source("../../shared/suites_qtta.py")
+def checkTypeAndProperties(typePropertiesDetails):
+ for (qType, props, detail) in typePropertiesDetails:
+ test.verify(checkIfObjectExists(getQmlItem(qType, ":WelcomePage.scrollView_ScrollView",
+ False, props)),
+ "Verifying: Qt Creator displays %s." % detail)
+
def main():
- test.log("Welcome mode is not scriptable at the moment")
- return
+ if isQt4Build or not canTestEmbeddedQtQuick():
+ test.log("Welcome mode is not available or not scriptable with this Squish version")
+ return
# prepare example project
sourceExample = os.path.join(sdkPath, "Examples", "4.7", "declarative", "animation", "basics",
"property-animation")
@@ -42,47 +49,46 @@ def main():
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
- if not test.verify(checkIfObjectExists(getQmlItem("Text", ":Qt Creator_QDeclarativeView", False,
- "text='Getting Started'")),
- "Verifying: Qt Creator displays Welcome Page with Getting Started."):
- mouseClick(waitForObject(getQmlItem("LinkedText", ":Qt Creator_QDeclarativeView", False,
- "text='Getting Started'")), 5, 5, 0, Qt.LeftButton)
- # select "Develop" topic
- mouseClick(waitForObject(getQmlItem("LinkedText", ":Qt Creator_QDeclarativeView", False,
- "text='Develop'")), 5, 5, 0, Qt.LeftButton)
- sessionsText = getQmlItem("Text", ":Qt Creator_QDeclarativeView", False, "text='Sessions'")
- recentProjText = getQmlItem("Text", ":Qt Creator_QDeclarativeView", False,
- "text='Recent Projects'")
- test.verify(checkIfObjectExists(sessionsText) and checkIfObjectExists(recentProjText),
- "Verifying: 'Develop' with 'Recently used sessions' and "
- "'Recently used Projects' is being opened.")
- # select "Create Project" and try to create a new project.
- # create Qt Quick application from "Welcome" page -> "Develop" tab
+
+ typePropDet = (("Button", "text='Get Started Now' id='gettingStartedButton'",
+ "Get Started Now button"),
+ ("Text", "text='Sessions' id='sessionsTitle'", "Sessions section"),
+ ("Text", "text='default' id='text'", "default session listed"),
+ ("Text", "text='Recent Projects' id='recentProjectsTitle'", "Projects section"),
+ )
+ checkTypeAndProperties(typePropDet)
+
+ # select "Create Project" and try to create a new project
createNewQtQuickApplication(tempDir(), "SampleApp", fromWelcome = True)
test.verify(checkIfObjectExists("{column='0' container=':Qt Creator_Utils::NavigationTreeView'"
" text~='SampleApp( \(.*\))?' type='QModelIndex'}"),
"Verifying: The project is opened in 'Edit' mode after configuring.")
- # go to "Welcome page" -> "Develop" topic again.
+ # go to "Welcome page" again and verify updated information
switchViewTo(ViewConstants.WELCOME)
- test.verify(checkIfObjectExists(sessionsText) and checkIfObjectExists(recentProjText),
- "Verifying: 'Develop' with 'Sessions' and 'Recent Projects' is opened.")
- # select "Open project" and select any project.
- # copy example project to temp directory
+ typePropDet = (("Text", "text='Sessions' id='sessionsTitle'", "Sessions section"),
+ ("Text", "text='default (current session)' id='text'",
+ "default session as current listed"),
+ ("Text", "text='Recent Projects' id='recentProjectsTitle'", "Projects section"),
+ ("LinkedText", "text='SampleApp' id='projectNameText'",
+ "current project listed in projects section")
+ )
+ checkTypeAndProperties(typePropDet)
+
+ # select "Open project" and select a project
examplePath = os.path.join(prepareTemplate(sourceExample), "propertyanimation.pro")
- # open example project from "Welcome" page -> "Develop" tab
openQmakeProject(examplePath, fromWelcome = True)
progressBarWait(30000)
test.verify(checkIfObjectExists("{column='0' container=':Qt Creator_Utils::NavigationTreeView'"
" text~='propertyanimation( \(.*\))?' type='QModelIndex'}"),
"Verifying: The project is opened in 'Edit' mode after configuring.")
- # go to "Welcome page" -> "Develop" again and check if there is an information about
- # recent projects in "Recent Projects".
+ # go to "Welcome page" again and check if there is an information about recent projects
switchViewTo(ViewConstants.WELCOME)
- test.verify(checkIfObjectExists(getQmlItem("LinkedText", ":Qt Creator_QDeclarativeView", False,
- "text='propertyanimation'")) and
- checkIfObjectExists(getQmlItem("LinkedText", ":Qt Creator_QDeclarativeView", False,
- "text='SampleApp'")),
- "Verifying: 'Develop' is opened and the recently created and "
- "opened project can be seen in 'Recent Projects'.")
+ test.verify(checkIfObjectExists(getQmlItem("LinkedText", ":WelcomePage.scrollView_ScrollView",
+ False,
+ "text='propertyanimation' id='projectNameText'")) and
+ checkIfObjectExists(getQmlItem("LinkedText", ":WelcomePage.scrollView_ScrollView",
+ False, "text='SampleApp' id='projectNameText'")),
+ "Verifying: 'Welcome page' displays information about recently created and "
+ "opened projects.")
# exit Qt Creator
invokeMenuItem("File", "Exit")
diff --git a/tests/system/suite_debugger/tst_qml_locals/test.py b/tests/system/suite_debugger/tst_qml_locals/test.py
index ce74e4c8a7..b8d1c88bca 100644
--- a/tests/system/suite_debugger/tst_qml_locals/test.py
+++ b/tests/system/suite_debugger/tst_qml_locals/test.py
@@ -54,7 +54,7 @@ def main():
exe, target = getExecutableAndTargetFromToolTip(str(waitForObject(fancyConfButton).toolTip))
if not (test.verify(fancyRunButton.enabled and fancyDebugButton.enabled,
"Verifying Run and Debug are enabled (Qt5 is available).")
- and test.compare(target, Targets.getStringForTarget(Targets.DESKTOP_521_DEFAULT),
+ and test.compare(target, Targets.getStringForTarget(Targets.getDefaultKit()),
"Verifying selected Target is Qt5.")
and test.compare(exe, "QML Scene", "Verifying selected executable is QML Scene.")):
earlyExit("Something went wrong opening Qml project - probably missing Qt5.")
diff --git a/tests/system/suite_general/tst_session_handling/test.py b/tests/system/suite_general/tst_session_handling/test.py
index e5ef8cf410..ae65515424 100644
--- a/tests/system/suite_general/tst_session_handling/test.py
+++ b/tests/system/suite_general/tst_session_handling/test.py
@@ -29,10 +29,6 @@
source("../../shared/qtcreator.py")
-def canTestQtQuick():
- return (squishinfo.major * 0x10000 + squishinfo.minor * 0x100
- + squishinfo.patch) > 0x050100
-
def main():
projects = prepareTestExamples()
if not projects:
@@ -45,7 +41,7 @@ def main():
mainWindow = waitForObject(":Qt Creator_Core::Internal::MainWindow")
test.verify(waitFor("sessionName in str(mainWindow.windowTitle)", 2000),
"Verifying window title contains created session name.")
- if not isQt4Build and canTestQtQuick():
+ if not isQt4Build and canTestEmbeddedQtQuick():
checkWelcomePage(sessionName, True)
for project in projects:
openQmakeProject(project, Targets.DESKTOP_480_GCC)
@@ -58,7 +54,7 @@ def main():
switchSession("default")
test.verify(waitFor("'Qt Creator' == str(mainWindow.windowTitle)", 2000),
"Verifying window title is set to default.")
- if not isQt4Build and canTestQtQuick():
+ if not isQt4Build and canTestEmbeddedQtQuick():
checkWelcomePage(sessionName, False)
switchViewTo(ViewConstants.EDIT)
checkNavigator(1, "Verifying that no more project is opened.")
diff --git a/tests/system/suite_qtquick/tst_qtquick_creation4/test.py b/tests/system/suite_qtquick/tst_qtquick_creation4/test.py
index 36b328d449..641b27da54 100644
--- a/tests/system/suite_qtquick/tst_qtquick_creation4/test.py
+++ b/tests/system/suite_qtquick/tst_qtquick_creation4/test.py
@@ -33,8 +33,8 @@ def main():
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
- for targ, quickVer in [[Targets.DESKTOP_480_GCC, 1], [Targets.DESKTOP_501_DEFAULT, 2],
- [Targets.DESKTOP_521_DEFAULT, 2]]:
+ for targ, quickVer in [[Targets.DESKTOP_480_GCC, 1], [Targets.DESKTOP_521_DEFAULT, 2],
+ [Targets.DESKTOP_531_DEFAULT, 2]]:
# using a temporary directory won't mess up a potentially existing
createNewQmlExtension(tempDir(), targ, quickVer)
# wait for parsing to complete
diff --git a/tests/tools/cplusplus-ast2png/dumpers.inc b/tests/tools/cplusplus-ast2png/dumpers.inc
index 5e901c386c..5e5bb1a10b 100644
--- a/tests/tools/cplusplus-ast2png/dumpers.inc
+++ b/tests/tools/cplusplus-ast2png/dumpers.inc
@@ -50,7 +50,21 @@ virtual bool visit(SimpleSpecifierAST *ast)
return false;
}
-virtual bool visit(AttributeSpecifierAST *ast)
+virtual bool visit(AlignmentSpecifierAST *ast)
+{
+ if (ast->align_token)
+ terminal(ast->align_token, ast);
+ if (ast->lparen_token)
+ terminal(ast->lparen_token, ast);
+ nonterminal(ast->typeIdExprOrAlignmentExpr);
+ if (ast->ellipses_token)
+ terminal(ast->ellipses_token, ast);
+ if (ast->rparen_token)
+ terminal(ast->rparen_token, ast);
+ return false;
+}
+
+virtual bool visit(GnuAttributeSpecifierAST *ast)
{
if (ast->attribute_token)
terminal(ast->attribute_token, ast);
@@ -58,7 +72,7 @@ virtual bool visit(AttributeSpecifierAST *ast)
terminal(ast->first_lparen_token, ast);
if (ast->second_lparen_token)
terminal(ast->second_lparen_token, ast);
- for (AttributeListAST *iter = ast->attribute_list; iter; iter = iter->next)
+ for (GnuAttributeListAST *iter = ast->attribute_list; iter; iter = iter->next)
nonterminal(iter->value);
if (ast->first_rparen_token)
terminal(ast->first_rparen_token, ast);
@@ -67,7 +81,7 @@ virtual bool visit(AttributeSpecifierAST *ast)
return false;
}
-virtual bool visit(AttributeAST *ast)
+virtual bool visit(GnuAttributeAST *ast)
{
if (ast->identifier_token)
terminal(ast->identifier_token, ast);