summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libs/3rdparty/cplusplus/Parser.cpp2
-rw-r--r--src/libs/aggregation/aggregation.qbs2
-rw-r--r--src/libs/cplusplus/LookupContext.cpp15
-rw-r--r--src/libs/cplusplus/LookupContext.h4
-rw-r--r--src/libs/cplusplus/cplusplus.qbs2
-rw-r--r--src/libs/extensionsystem/extensionsystem.qbs2
-rw-r--r--src/libs/extensionsystem/pluginerrorview.cpp16
-rw-r--r--src/libs/glsl/glsl.qbs2
-rw-r--r--src/libs/languageutils/languageutils.qbs2
-rw-r--r--src/libs/qmldebug/qmldebug.qbs2
-rw-r--r--src/libs/qmleditorwidgets/contextpanewidgetimage.cpp4
-rw-r--r--src/libs/qmleditorwidgets/contextpanewidgetimage.ui12
-rw-r--r--src/libs/qmleditorwidgets/easingpane/easingcontextpane.ui14
-rw-r--r--src/libs/qmleditorwidgets/qmleditorwidgets.qbs2
-rw-r--r--src/libs/qmljs/qmljs.qbs2
-rw-r--r--src/libs/qmljs/qmljsdocument.cpp3
-rw-r--r--src/libs/qmljs/qmljsmodelmanagerinterface.cpp2
-rw-r--r--src/libs/ssh/ssh.qbs2
-rw-r--r--src/libs/utils/logging.h14
-rw-r--r--src/libs/utils/process_ctrlc_stub.qbs2
-rw-r--r--src/libs/utils/process_stub.qbs2
-rw-r--r--src/libs/utils/synchronousprocess.cpp19
-rw-r--r--src/libs/utils/utils.qbs2
-rw-r--r--src/libs/zeroconf/zeroconf.qbs2
-rw-r--r--src/plugins/analyzerbase/analyzerbase.qbs2
-rw-r--r--src/plugins/android/android.qbs2
-rw-r--r--src/plugins/android/androidanalyzesupport.cpp4
-rw-r--r--src/plugins/android/androidconfigurations.cpp33
-rw-r--r--src/plugins/android/androidconfigurations.h1
-rw-r--r--src/plugins/android/androiddeployqtwidget.ui4
-rw-r--r--src/plugins/android/androiddeploystepwidget.ui4
-rw-r--r--src/plugins/android/androiddevicedialog.cpp24
-rw-r--r--src/plugins/android/androiddevicedialog.h1
-rw-r--r--src/plugins/android/androiddevicedialog.ui81
-rw-r--r--src/plugins/android/androidmanager.cpp3
-rw-r--r--src/plugins/android/androidmanifesteditorwidget.cpp472
-rw-r--r--src/plugins/android/androidmanifesteditorwidget.h15
-rw-r--r--src/plugins/android/androidpackagecreationwidget.ui2
-rw-r--r--src/plugins/android/androidrunner.cpp31
-rw-r--r--src/plugins/android/androidrunner.h4
-rw-r--r--src/plugins/android/androidsettingspage.cpp25
-rw-r--r--src/plugins/android/androidsettingswidget.cpp2
-rw-r--r--src/plugins/android/createandroidmanifestwizard.cpp44
-rw-r--r--src/plugins/android/createandroidmanifestwizard.h8
-rw-r--r--src/plugins/autotoolsprojectmanager/autotoolsprojectmanager.qbs2
-rw-r--r--src/plugins/autotoolsprojectmanager/autotoolsprojectnode.cpp2
-rw-r--r--src/plugins/autotoolsprojectmanager/autotoolsprojectnode.h2
-rw-r--r--src/plugins/bazaar/bazaar.qbs2
-rw-r--r--src/plugins/bazaar/bazaarcommitpanel.ui2
-rw-r--r--src/plugins/bazaar/cloneoptionspanel.ui10
-rw-r--r--src/plugins/bazaar/pullorpushdialog.ui10
-rw-r--r--src/plugins/beautifier/artisticstyle/artisticstyle.cpp5
-rw-r--r--src/plugins/beautifier/beautifier.qbs2
-rw-r--r--src/plugins/bineditor/bineditor.qbs2
-rw-r--r--src/plugins/bookmarks/bookmarks.qbs2
-rw-r--r--src/plugins/clangcodemodel/clangutils.cpp5
-rw-r--r--src/plugins/clangcodemodel/cppcreatemarkers.cpp15
-rw-r--r--src/plugins/classview/classview.qbs2
-rw-r--r--src/plugins/clearcase/clearcase.qbs2
-rw-r--r--src/plugins/clearcase/clearcaseplugin.cpp5
-rw-r--r--src/plugins/clearcase/settingspage.ui4
-rw-r--r--src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp2
-rw-r--r--src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs2
-rw-r--r--src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp2
-rw-r--r--src/plugins/cmakeprojectmanager/cmakeprojectnodes.h2
-rw-r--r--src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp2
-rw-r--r--src/plugins/coreplugin/coreplugin.qbs2
-rw-r--r--src/plugins/coreplugin/dialogs/externaltoolconfig.ui14
-rw-r--r--src/plugins/coreplugin/find/searchresultwidget.cpp11
-rw-r--r--src/plugins/coreplugin/find/searchresultwidget.h2
-rw-r--r--src/plugins/coreplugin/find/searchresultwindow.cpp2
-rw-r--r--src/plugins/coreplugin/find/searchresultwindow.h6
-rw-r--r--src/plugins/coreplugin/generalsettings.ui6
-rw-r--r--src/plugins/coreplugin/images/logo/logo.qbs2
-rw-r--r--src/plugins/coreplugin/infobar.cpp2
-rw-r--r--src/plugins/coreplugin/locator/executefilter.cpp2
-rw-r--r--src/plugins/coreplugin/vcsmanager.cpp2
-rw-r--r--src/plugins/cpaster/cpaster.qbs2
-rw-r--r--src/plugins/cpaster/frontend/frontend.qbs2
-rw-r--r--src/plugins/cppeditor/cppeditor.cpp15
-rw-r--r--src/plugins/cppeditor/cppeditor.qbs2
-rw-r--r--src/plugins/cpptools/builtinindexingsupport.cpp7
-rw-r--r--src/plugins/cpptools/completionsettingspage.ui4
-rw-r--r--src/plugins/cpptools/cppcompletion_test.cpp63
-rw-r--r--src/plugins/cpptools/cppcompletionassist.cpp51
-rw-r--r--src/plugins/cpptools/cppcompletionassist.h1
-rw-r--r--src/plugins/cpptools/cppfindreferences.cpp2
-rw-r--r--src/plugins/cpptools/cppmodelmanager.cpp1
-rw-r--r--src/plugins/cpptools/cppsemanticinfo.cpp2
-rw-r--r--src/plugins/cpptools/cppsemanticinfo.h3
-rw-r--r--src/plugins/cpptools/cpptools.qbs2
-rw-r--r--src/plugins/cpptools/cpptoolseditorsupport.cpp52
-rw-r--r--src/plugins/cpptools/cpptoolseditorsupport.h35
-rw-r--r--src/plugins/cvs/cvs.qbs2
-rw-r--r--src/plugins/cvs/cvsplugin.cpp7
-rw-r--r--src/plugins/debugger/cdb/cdboptionspagewidget.ui4
-rw-r--r--src/plugins/debugger/commonoptionspage.cpp12
-rw-r--r--src/plugins/debugger/debugger.qbs2
-rw-r--r--src/plugins/debugger/debuggerplugin.cpp2
-rw-r--r--src/plugins/debugger/debuggerrunner.cpp24
-rw-r--r--src/plugins/debugger/gdb/gdboptionspage.cpp2
-rw-r--r--src/plugins/debugger/lldb/lldbengine.cpp20
-rw-r--r--src/plugins/debugger/lldb/lldbengine.h3
-rw-r--r--src/plugins/debugger/ptracepreload.qbs2
-rw-r--r--src/plugins/designer/designer.qbs2
-rw-r--r--src/plugins/designer/formeditorfactory.cpp2
-rw-r--r--src/plugins/diffeditor/diffeditor.qbs2
-rw-r--r--src/plugins/diffeditor/diffeditorplugin.cpp11
-rw-r--r--src/plugins/diffeditor/diffeditorplugin.h4
-rw-r--r--src/plugins/diffeditor/diffutils.cpp149
-rw-r--r--src/plugins/diffeditor/diffutils.h13
-rw-r--r--src/plugins/diffeditor/sidebysidediffeditorwidget.cpp165
-rw-r--r--src/plugins/diffeditor/sidebysidediffeditorwidget.h4
-rw-r--r--src/plugins/fakevim/fakevim.qbs2
-rw-r--r--src/plugins/fakevim/fakevimoptions.ui2
-rw-r--r--src/plugins/find/find.qbs2
-rw-r--r--src/plugins/genericprojectmanager/genericprojectmanager.qbs2
-rw-r--r--src/plugins/genericprojectmanager/genericprojectnodes.cpp2
-rw-r--r--src/plugins/genericprojectmanager/genericprojectnodes.h2
-rw-r--r--src/plugins/git/branchdialog.ui2
-rw-r--r--src/plugins/git/commitdata.cpp1
-rw-r--r--src/plugins/git/commitdata.h2
-rw-r--r--src/plugins/git/gerrit/gerritplugin.cpp2
-rw-r--r--src/plugins/git/git.qbs2
-rw-r--r--src/plugins/git/gitclient.cpp65
-rw-r--r--src/plugins/git/gitclient.h3
-rw-r--r--src/plugins/git/giteditor.cpp9
-rw-r--r--src/plugins/git/gitsubmiteditor.cpp16
-rw-r--r--src/plugins/git/gitsubmiteditor.h2
-rw-r--r--src/plugins/git/mergetool.cpp8
-rw-r--r--src/plugins/glsleditor/glsleditor.qbs2
-rw-r--r--src/plugins/helloworld/helloworld.qbs2
-rw-r--r--src/plugins/help/generalsettingspage.ui4
-rw-r--r--src/plugins/help/help.qbs2
-rw-r--r--src/plugins/imageviewer/imageviewer.qbs2
-rw-r--r--src/plugins/ios/ios.qbs2
-rw-r--r--src/plugins/ios/iosconstants.h8
-rw-r--r--src/plugins/ios/iosdevice.cpp38
-rw-r--r--src/plugins/ios/iosdevice.h3
-rw-r--r--src/plugins/ios/iosdevicefactory.cpp8
-rw-r--r--src/plugins/ios/iosrunconfiguration.cpp2
-rw-r--r--src/plugins/ios/iossimulator.cpp38
-rw-r--r--src/plugins/ios/iossimulator.h3
-rw-r--r--src/plugins/ios/iostoolhandler.cpp6
-rw-r--r--src/plugins/locator/locator.qbs2
-rw-r--r--src/plugins/macros/macros.qbs2
-rw-r--r--src/plugins/mercurial/mercurial.qbs2
-rw-r--r--src/plugins/mercurial/srcdestdialog.ui4
-rw-r--r--src/plugins/perforce/perforce.qbs2
-rw-r--r--src/plugins/perforce/perforceplugin.cpp4
-rw-r--r--src/plugins/projectexplorer/customtoolchain.cpp2
-rw-r--r--src/plugins/projectexplorer/dependenciespanel.cpp3
-rw-r--r--src/plugins/projectexplorer/kit.cpp10
-rw-r--r--src/plugins/projectexplorer/kitinformationconfigwidget.cpp2
-rw-r--r--src/plugins/projectexplorer/msvctoolchain.cpp2
-rw-r--r--src/plugins/projectexplorer/projectexplorer.cpp6
-rw-r--r--src/plugins/projectexplorer/projectexplorer.qbs2
-rw-r--r--src/plugins/projectexplorer/projectexplorersettingspage.ui2
-rw-r--r--src/plugins/projectexplorer/projectmodels.cpp21
-rw-r--r--src/plugins/projectexplorer/projectmodels.h4
-rw-r--r--src/plugins/projectexplorer/projectnodes.cpp34
-rw-r--r--src/plugins/projectexplorer/projectnodes.h18
-rw-r--r--src/plugins/projectexplorer/removetaskhandler.cpp2
-rw-r--r--src/plugins/projectexplorer/session.cpp4
-rw-r--r--src/plugins/projectexplorer/sessiondialog.ui2
-rw-r--r--src/plugins/projectexplorer/toolchainoptionspage.cpp5
-rw-r--r--src/plugins/projectexplorer/vcsannotatetaskhandler.cpp2
-rw-r--r--src/plugins/pythoneditor/pythoneditor.qbs2
-rw-r--r--src/plugins/qbsprojectmanager/qbsnodes.cpp9
-rw-r--r--src/plugins/qbsprojectmanager/qbsnodes.h5
-rw-r--r--src/plugins/qbsprojectmanager/qbsprojectmanager.qbs2
-rw-r--r--src/plugins/qmakeprojectmanager/qmakenodes.cpp16
-rw-r--r--src/plugins/qmakeprojectmanager/qmakenodes.h6
-rw-r--r--src/plugins/qmakeprojectmanager/qmakeproject.cpp3
-rw-r--r--src/plugins/qmakeprojectmanager/qmakeprojectmanager.qbs2
-rw-r--r--src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp21
-rw-r--r--src/plugins/qmldesigner/components/formeditor/dragtool.cpp3
-rw-r--r--src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp50
-rw-r--r--src/plugins/qmldesigner/components/importmanager/importmanagerview.cpp6
-rw-r--r--src/plugins/qmldesigner/components/integration/componentaction.cpp2
-rw-r--r--src/plugins/qmldesigner/components/integration/designdocument.cpp3
-rw-r--r--src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp2
-rw-r--r--src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp16
-rw-r--r--src/plugins/qmldesigner/components/navigator/navigatorwidget.cpp8
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/designerpropertymap.cpp4
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/designerpropertymap.h2
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp11
-rw-r--r--src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp4
-rw-r--r--src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp8
-rw-r--r--src/plugins/qmldesigner/componentsplugin/Controls/RadioButtonSpecifics.qml2
-rw-r--r--src/plugins/qmldesigner/designercore/exceptions/exception.cpp14
-rw-r--r--src/plugins/qmldesigner/designercore/include/exception.h1
-rw-r--r--src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp97
-rw-r--r--src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.h2
-rw-r--r--src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp2
-rw-r--r--src/plugins/qmldesigner/designercore/model/abstractview.cpp7
-rw-r--r--src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp3
-rw-r--r--src/plugins/qmldesigner/designercore/model/qmltextgenerator.cpp2
-rw-r--r--src/plugins/qmldesigner/qmldesigner.qbs2
-rw-r--r--src/plugins/qmldesigner/qmldesignerplugin.cpp49
-rw-r--r--src/plugins/qmljseditor/qmljseditor.qbs2
-rw-r--r--src/plugins/qmljseditor/qmljsfindreferences.cpp3
-rw-r--r--src/plugins/qmljseditor/qmljspreviewrunner.cpp4
-rw-r--r--src/plugins/qmljstools/qmljstools.qbs2
-rw-r--r--src/plugins/qmlprofiler/qml/CategoryLabel.qml2
-rw-r--r--src/plugins/qmlprofiler/qml/MainView.qml43
-rw-r--r--src/plugins/qmlprofiler/qmlprofiler.qbs2
-rw-r--r--src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp9
-rw-r--r--src/plugins/qmlprofiler/qmlprofilerengine.cpp4
-rw-r--r--src/plugins/qmlprofiler/qmlprofilertracefile.cpp3
-rw-r--r--src/plugins/qmlprofiler/qmlprofilertraceview.cpp10
-rw-r--r--src/plugins/qmlprofiler/timelinerenderer.cpp15
-rw-r--r--src/plugins/qmlprojectmanager/qmlprojectmanager.qbs2
-rw-r--r--src/plugins/qmlprojectmanager/qmlprojectnodes.cpp2
-rw-r--r--src/plugins/qmlprojectmanager/qmlprojectnodes.h2
-rw-r--r--src/plugins/qnx/blackberryapilevelconfiguration.cpp12
-rw-r--r--src/plugins/qnx/blackberryapplicationrunner.cpp135
-rw-r--r--src/plugins/qnx/blackberryapplicationrunner.h24
-rw-r--r--src/plugins/qnx/blackberryconfigurationmanager.cpp5
-rw-r--r--src/plugins/qnx/blackberrycreatepackagestep.cpp75
-rw-r--r--src/plugins/qnx/blackberrydebugsupport.cpp8
-rw-r--r--src/plugins/qnx/blackberrydebugtokenpinsdialog.cpp2
-rw-r--r--src/plugins/qnx/blackberryruncontrol.cpp2
-rw-r--r--src/plugins/qnx/blackberryruncontrolfactory.cpp54
-rw-r--r--src/plugins/qnx/qnx.qbs2
-rw-r--r--src/plugins/qnx/qnxtoolchain.cpp1
-rw-r--r--src/plugins/qtsupport/exampleslistmodel.cpp283
-rw-r--r--src/plugins/qtsupport/exampleslistmodel.h33
-rw-r--r--src/plugins/qtsupport/gettingstartedwelcomepage.cpp5
-rw-r--r--src/plugins/qtsupport/qtsupport.qbs2
-rw-r--r--src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.ui2
-rw-r--r--src/plugins/remotelinux/remotelinux.qbs2
-rw-r--r--src/plugins/resourceeditor/resourceeditor.qbs2
-rw-r--r--src/plugins/resourceeditor/resourcenode.cpp13
-rw-r--r--src/plugins/resourceeditor/resourcenode.h1
-rw-r--r--src/plugins/subversion/subversion.qbs2
-rw-r--r--src/plugins/subversion/subversionplugin.cpp9
-rw-r--r--src/plugins/tasklist/tasklist.qbs2
-rw-r--r--src/plugins/texteditor/basefilefind.cpp3
-rw-r--r--src/plugins/texteditor/behaviorsettingswidget.cpp4
-rw-r--r--src/plugins/texteditor/behaviorsettingswidget.ui2
-rw-r--r--src/plugins/texteditor/codeassist/genericproposalwidget.cpp21
-rw-r--r--src/plugins/texteditor/colorschemeedit.ui4
-rw-r--r--src/plugins/texteditor/displaysettingspage.ui2
-rw-r--r--src/plugins/texteditor/plaintexteditorfactory.cpp2
-rw-r--r--src/plugins/texteditor/texteditor.qbs2
-rw-r--r--src/plugins/texteditor/texteditorsettings.cpp4
-rw-r--r--src/plugins/todo/todo.qbs2
-rw-r--r--src/plugins/updateinfo/updateinfo.qbs2
-rw-r--r--src/plugins/valgrind/valgrind.qbs2
-rw-r--r--src/plugins/valgrind/valgrindconfigwidget.ui17
-rw-r--r--src/plugins/vcsbase/basecheckoutwizardpage.cpp12
-rw-r--r--src/plugins/vcsbase/checkoutprogresswizardpage.cpp29
-rw-r--r--src/plugins/vcsbase/checkoutprogresswizardpage.h3
-rw-r--r--src/plugins/vcsbase/cleandialog.cpp2
-rw-r--r--src/plugins/vcsbase/commonsettingspage.cpp2
-rw-r--r--src/plugins/vcsbase/commonsettingspage.ui2
-rw-r--r--src/plugins/vcsbase/vcsbase.qbs2
-rw-r--r--src/plugins/vcsbase/vcsbaseplugin.cpp2
-rw-r--r--src/plugins/welcome/welcome.qbs2
-rw-r--r--src/plugins/winrt/winrt.pro3
-rw-r--r--src/plugins/winrt/winrt.qbs5
-rw-r--r--src/plugins/winrt/winrtconstants.h1
-rw-r--r--src/plugins/winrt/winrtdeployconfiguration.cpp4
-rw-r--r--src/plugins/winrt/winrtpackagedeploymentstep.cpp65
-rw-r--r--src/plugins/winrt/winrtpackagedeploymentstep.h10
-rw-r--r--src/plugins/winrt/winrtpackagedeploymentstepwidget.cpp73
-rw-r--r--src/plugins/winrt/winrtpackagedeploymentstepwidget.h64
-rw-r--r--src/plugins/winrt/winrtpackagedeploymentstepwidget.ui47
-rw-r--r--src/plugins/winrt/winrtqtversionfactory.cpp9
m---------src/shared/qbs0
-rw-r--r--src/tools/3rdparty/3rdparty.pro4
-rw-r--r--src/tools/3rdparty/iossim/dvtiphonesimulatorremoteclient/dvtiphonesimulatorremoteclient.h290
-rw-r--r--src/tools/3rdparty/iossim/iossim.pro8
-rw-r--r--src/tools/3rdparty/iossim/iossim.qbs4
-rw-r--r--src/tools/3rdparty/iossim/iphonesimulator.h8
-rw-r--r--src/tools/3rdparty/iossim/iphonesimulator.mm296
-rw-r--r--src/tools/3rdparty/iossim/main.mm57
-rw-r--r--src/tools/3rdparty/iossim/nsprintf.mm4
-rw-r--r--src/tools/3rdparty/iossim/nsstringexpandpath.mm2
-rw-r--r--src/tools/3rdparty/iossim/version.h2
-rw-r--r--src/tools/3rdparty/iossim_1_8_2/IOSSIM_LICENSE31
-rw-r--r--src/tools/3rdparty/iossim_1_8_2/Info.plist16
-rw-r--r--src/tools/3rdparty/iossim_1_8_2/iossim.qbs30
-rw-r--r--src/tools/3rdparty/iossim_1_8_2/iossim_1_8_2.pro55
-rw-r--r--src/tools/3rdparty/iossim_1_8_2/iphonesimulator.h41
-rw-r--r--src/tools/3rdparty/iossim_1_8_2/iphonesimulator.mm566
-rw-r--r--src/tools/3rdparty/iossim_1_8_2/iphonesimulatorremoteclient/iphonesimulatorremoteclient.h (renamed from src/tools/3rdparty/iossim/iphonesimulatorremoteclient/iphonesimulatorremoteclient.h)0
-rw-r--r--src/tools/3rdparty/iossim_1_8_2/main.mm77
-rw-r--r--src/tools/3rdparty/iossim_1_8_2/nsprintf.h6
-rw-r--r--src/tools/3rdparty/iossim_1_8_2/nsprintf.mm44
-rw-r--r--src/tools/3rdparty/iossim_1_8_2/nsstringexpandpath.h11
-rw-r--r--src/tools/3rdparty/iossim_1_8_2/nsstringexpandpath.mm18
-rw-r--r--src/tools/3rdparty/iossim_1_8_2/version.h1
-rw-r--r--src/tools/iostool/iostool.qbs2
-rw-r--r--src/tools/qtcdebugger/qtcdebugger.qbs2
-rw-r--r--src/tools/qtcreatorcrashhandler/qtcreatorcrashhandler.qbs2
-rw-r--r--src/tools/qtpromaker/qtpromaker.qbs2
-rw-r--r--src/tools/sdktool/getoperation.cpp7
-rw-r--r--src/tools/sdktool/sdktool.qbs2
300 files changed, 3772 insertions, 1452 deletions
diff --git a/src/libs/3rdparty/cplusplus/Parser.cpp b/src/libs/3rdparty/cplusplus/Parser.cpp
index 2f0bb6e477..bf19628fd2 100644
--- a/src/libs/3rdparty/cplusplus/Parser.cpp
+++ b/src/libs/3rdparty/cplusplus/Parser.cpp
@@ -541,7 +541,7 @@ bool Parser::parseTranslationUnit(TranslationUnitAST *&node)
if (TopLevelDeclarationProcessor *processor = _control->topLevelDeclarationProcessor()) {
- if (processor->processDeclaration(declaration))
+ if (!processor->processDeclaration(declaration))
break;
}
diff --git a/src/libs/aggregation/aggregation.qbs b/src/libs/aggregation/aggregation.qbs
index 6c0e6e8d6b..4225adf64e 100644
--- a/src/libs/aggregation/aggregation.qbs
+++ b/src/libs/aggregation/aggregation.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcLibrary
QtcLibrary {
diff --git a/src/libs/cplusplus/LookupContext.cpp b/src/libs/cplusplus/LookupContext.cpp
index 87ed0b3f26..75c71170b5 100644
--- a/src/libs/cplusplus/LookupContext.cpp
+++ b/src/libs/cplusplus/LookupContext.cpp
@@ -669,6 +669,15 @@ void ClassOrNamespace::lookup_helper(const Name *name, ClassOrNamespace *binding
foreach (ClassOrNamespace *u, binding->usings())
lookup_helper(name, u, result, processed, binding->_templateId);
+
+ Anonymouses::const_iterator cit = binding->_anonymouses.begin();
+ Anonymouses::const_iterator citEnd = binding->_anonymouses.end();
+ for (; cit != citEnd; ++cit) {
+ const AnonymousNameId *anonymousNameId = cit.key();
+ ClassOrNamespace *a = cit.value();
+ if (!binding->_declaredAnonymouses.contains(anonymousNameId))
+ lookup_helper(name, a, result, processed, binding->_templateId);
+ }
}
}
@@ -1567,8 +1576,12 @@ bool CreateBindings::visit(Declaration *decl)
}
}
}
+ } else if (Class *clazz = decl->type()->asClassType()) {
+ if (const Name *name = clazz->name()) {
+ if (const AnonymousNameId *anonymousNameId = name->asAnonymousNameId())
+ _currentClassOrNamespace->_declaredAnonymouses.insert(anonymousNameId);
+ }
}
-
return false;
}
diff --git a/src/libs/cplusplus/LookupContext.h b/src/libs/cplusplus/LookupContext.h
index 4b11ad4caf..b1a1ba2c82 100644
--- a/src/libs/cplusplus/LookupContext.h
+++ b/src/libs/cplusplus/LookupContext.h
@@ -96,6 +96,7 @@ public:
private:
typedef std::map<const Name *, ClassOrNamespace *, Name::Compare> Table;
typedef std::map<const TemplateNameId *, ClassOrNamespace *, TemplateNameId::Compare> TemplateNameIdTable;
+ typedef QHash<const AnonymousNameId *, ClassOrNamespace *> Anonymouses;
/// \internal
void flush();
@@ -141,7 +142,8 @@ private:
QSharedPointer<Control> _control;
TemplateNameIdTable _specializations;
QMap<const TemplateNameId *, ClassOrNamespace *> _instantiations;
- QHash<const AnonymousNameId *, ClassOrNamespace *> _anonymouses;
+ Anonymouses _anonymouses;
+ QSet<const AnonymousNameId *> _declaredAnonymouses;
QHash<Internal::FullyQualifiedName, Symbol *> *_scopeLookupCache;
diff --git a/src/libs/cplusplus/cplusplus.qbs b/src/libs/cplusplus/cplusplus.qbs
index 09dfe63cec..3ea4a34b90 100644
--- a/src/libs/cplusplus/cplusplus.qbs
+++ b/src/libs/cplusplus/cplusplus.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcLibrary
QtcLibrary {
diff --git a/src/libs/extensionsystem/extensionsystem.qbs b/src/libs/extensionsystem/extensionsystem.qbs
index 2a5b12a6c7..a3e4bce8d4 100644
--- a/src/libs/extensionsystem/extensionsystem.qbs
+++ b/src/libs/extensionsystem/extensionsystem.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcLibrary
QtcLibrary {
diff --git a/src/libs/extensionsystem/pluginerrorview.cpp b/src/libs/extensionsystem/pluginerrorview.cpp
index 3c3170e0d2..cfb3b18f0f 100644
--- a/src/libs/extensionsystem/pluginerrorview.cpp
+++ b/src/libs/extensionsystem/pluginerrorview.cpp
@@ -75,35 +75,35 @@ void PluginErrorView::update(PluginSpec *spec)
switch (spec->state()) {
case PluginSpec::Invalid:
text = tr("Invalid");
- tooltip = tr("Description file found, but error on read");
+ tooltip = tr("Description file found, but error on read.");
break;
case PluginSpec::Read:
text = tr("Read");
- tooltip = tr("Description successfully read");
+ tooltip = tr("Description successfully read.");
break;
case PluginSpec::Resolved:
text = tr("Resolved");
- tooltip = tr("Dependencies are successfully resolved");
+ tooltip = tr("Dependencies are successfully resolved.");
break;
case PluginSpec::Loaded:
text = tr("Loaded");
- tooltip = tr("Library is loaded");
+ tooltip = tr("Library is loaded.");
break;
case PluginSpec::Initialized:
text = tr("Initialized");
- tooltip = tr("Plugin's initialization function succeeded");
+ tooltip = tr("Plugin's initialization function succeeded.");
break;
case PluginSpec::Running:
text = tr("Running");
- tooltip = tr("Plugin successfully loaded and running");
+ tooltip = tr("Plugin successfully loaded and running.");
break;
case PluginSpec::Stopped:
text = tr("Stopped");
- tooltip = tr("Plugin was shut down");
+ tooltip = tr("Plugin was shut down.");
break;
case PluginSpec::Deleted:
text = tr("Deleted");
- tooltip = tr("Plugin ended its life cycle and was deleted");
+ tooltip = tr("Plugin ended its life cycle and was deleted.");
break;
}
diff --git a/src/libs/glsl/glsl.qbs b/src/libs/glsl/glsl.qbs
index 4a9d6e4165..ade3e6d86b 100644
--- a/src/libs/glsl/glsl.qbs
+++ b/src/libs/glsl/glsl.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcLibrary
QtcLibrary {
diff --git a/src/libs/languageutils/languageutils.qbs b/src/libs/languageutils/languageutils.qbs
index 12326d2df8..eef6bf3c3d 100644
--- a/src/libs/languageutils/languageutils.qbs
+++ b/src/libs/languageutils/languageutils.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcLibrary
QtcLibrary {
diff --git a/src/libs/qmldebug/qmldebug.qbs b/src/libs/qmldebug/qmldebug.qbs
index 7181013a80..80fe8b2995 100644
--- a/src/libs/qmldebug/qmldebug.qbs
+++ b/src/libs/qmldebug/qmldebug.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcLibrary
QtcLibrary {
diff --git a/src/libs/qmleditorwidgets/contextpanewidgetimage.cpp b/src/libs/qmleditorwidgets/contextpanewidgetimage.cpp
index 3206499752..6047e7b826 100644
--- a/src/libs/qmleditorwidgets/contextpanewidgetimage.cpp
+++ b/src/libs/qmleditorwidgets/contextpanewidgetimage.cpp
@@ -84,7 +84,7 @@ ContextPaneWidgetImage::ContextPaneWidgetImage(QWidget *parent, bool borderImage
uiBorderImage->setupUi(this);
m_fileWidget = uiBorderImage->fileWidget;
m_sizeLabel = uiBorderImage->sizeLabel;
- uiBorderImage->label->setToolTip(tr("double click for preview"));
+ uiBorderImage->label->setToolTip(tr("Double click for preview."));
uiBorderImage->label->installEventFilter(labelFilter);
@@ -103,7 +103,7 @@ ContextPaneWidgetImage::ContextPaneWidgetImage(QWidget *parent, bool borderImage
} else {
ui = new Ui::ContextPaneWidgetImage;
ui->setupUi(this);
- ui->label->setToolTip(tr("double click for preview"));
+ ui->label->setToolTip(tr("Double click for preview."));
ui->label->installEventFilter(labelFilter);
m_fileWidget = ui->fileWidget;
m_sizeLabel = ui->sizeLabel;
diff --git a/src/libs/qmleditorwidgets/contextpanewidgetimage.ui b/src/libs/qmleditorwidgets/contextpanewidgetimage.ui
index ed25fbf0fd..1f7fe1299e 100644
--- a/src/libs/qmleditorwidgets/contextpanewidgetimage.ui
+++ b/src/libs/qmleditorwidgets/contextpanewidgetimage.ui
@@ -57,7 +57,7 @@
<item row="1" column="1">
<widget class="QRadioButton" name="stretchRadioButton">
<property name="toolTip">
- <string>The image is scaled to fit</string>
+ <string>The image is scaled to fit.</string>
</property>
<property name="text">
<string/>
@@ -77,7 +77,7 @@
<item row="1" column="2">
<widget class="QRadioButton" name="horizontalStretchRadioButton">
<property name="toolTip">
- <string>The image is stretched horizontally and tiled vertically</string>
+ <string>The image is stretched horizontally and tiled vertically.</string>
</property>
<property name="text">
<string/>
@@ -97,7 +97,7 @@
<item row="1" column="3">
<widget class="QRadioButton" name="verticalStretchRadioButton">
<property name="toolTip">
- <string>The image is stretched vertically and tiled horizontally</string>
+ <string>The image is stretched vertically and tiled horizontally.</string>
</property>
<property name="text">
<string/>
@@ -117,7 +117,7 @@
<item row="2" column="1">
<widget class="QRadioButton" name="tileRadioButton">
<property name="toolTip">
- <string>The image is duplicated horizontally and vertically</string>
+ <string>The image is duplicated horizontally and vertically.</string>
</property>
<property name="text">
<string/>
@@ -137,7 +137,7 @@
<item row="2" column="2">
<widget class="QRadioButton" name="preserveAspectFitRadioButton">
<property name="toolTip">
- <string>The image is scaled uniformly to fit without cropping</string>
+ <string>The image is scaled uniformly to fit without cropping.</string>
</property>
<property name="text">
<string/>
@@ -157,7 +157,7 @@
<item row="2" column="3">
<widget class="QRadioButton" name="cropAspectFitRadioButton">
<property name="toolTip">
- <string>The image is scaled uniformly to fill, cropping if necessary</string>
+ <string>The image is scaled uniformly to fill, cropping if necessary.</string>
</property>
<property name="text">
<string/>
diff --git a/src/libs/qmleditorwidgets/easingpane/easingcontextpane.ui b/src/libs/qmleditorwidgets/easingpane/easingcontextpane.ui
index f883e743fc..aa351e986f 100644
--- a/src/libs/qmleditorwidgets/easingpane/easingcontextpane.ui
+++ b/src/libs/qmleditorwidgets/easingpane/easingcontextpane.ui
@@ -54,7 +54,7 @@
</size>
</property>
<property name="toolTip">
- <string>Play simulation</string>
+ <string>Play simulation.</string>
</property>
</widget>
</item>
@@ -83,7 +83,7 @@
</size>
</property>
<property name="toolTip">
- <string>Type of easing curve</string>
+ <string>Type of easing curve.</string>
</property>
<item>
<property name="text">
@@ -164,7 +164,7 @@
</sizepolicy>
</property>
<property name="toolTip">
- <string>Acceleration or deceleration of easing curve</string>
+ <string>Acceleration or deceleration of easing curve.</string>
</property>
<item>
<property name="text">
@@ -207,7 +207,7 @@
</size>
</property>
<property name="toolTip">
- <string>Duration of animation</string>
+ <string>Duration of animation.</string>
</property>
<property name="specialValueText">
<string>INVALID</string>
@@ -251,7 +251,7 @@
</size>
</property>
<property name="toolTip">
- <string>Amplitude of elastic and bounce easing curves</string>
+ <string>Amplitude of elastic and bounce easing curves.</string>
</property>
<property name="specialValueText">
<string>INVALID</string>
@@ -292,7 +292,7 @@
</size>
</property>
<property name="toolTip">
- <string>Easing period of an elastic curve</string>
+ <string>Easing period of an elastic curve.</string>
</property>
<property name="specialValueText">
<string>INVALID</string>
@@ -333,7 +333,7 @@
</size>
</property>
<property name="toolTip">
- <string>Easing overshoot for a back curve</string>
+ <string>Easing overshoot for a back curve.</string>
</property>
<property name="specialValueText">
<string>INVALID</string>
diff --git a/src/libs/qmleditorwidgets/qmleditorwidgets.qbs b/src/libs/qmleditorwidgets/qmleditorwidgets.qbs
index 9c60cfb182..80ce26a55a 100644
--- a/src/libs/qmleditorwidgets/qmleditorwidgets.qbs
+++ b/src/libs/qmleditorwidgets/qmleditorwidgets.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcLibrary
QtcLibrary {
diff --git a/src/libs/qmljs/qmljs.qbs b/src/libs/qmljs/qmljs.qbs
index 6e52fda608..d29d40d18c 100644
--- a/src/libs/qmljs/qmljs.qbs
+++ b/src/libs/qmljs/qmljs.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcLibrary
QtcLibrary {
diff --git a/src/libs/qmljs/qmljsdocument.cpp b/src/libs/qmljs/qmljsdocument.cpp
index d347e76a71..fa580cce13 100644
--- a/src/libs/qmljs/qmljsdocument.cpp
+++ b/src/libs/qmljs/qmljsdocument.cpp
@@ -159,7 +159,8 @@ QList<Language::Enum> Document::companionLanguages(Language::Enum language)
break;
case Language::Unknown:
langs << Language::JavaScript << Language::Json << Language::QmlProject << Language:: QmlQbs
- << Language::QmlTypeInfo << Language::QmlQtQuick1 << Language::QmlQtQuick2 ;
+ << Language::QmlTypeInfo << Language::QmlQtQuick1 << Language::QmlQtQuick2
+ << Language::Qml;
break;
}
return langs;
diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp
index 92b1dcf2d4..c7acf47495 100644
--- a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp
+++ b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp
@@ -777,7 +777,7 @@ void ModelManagerInterface::parseLoop(QSet<QString> &scannedPaths,
continue;
}
if (language == Language::Qml
- && (mainLanguage == Language::QmlQtQuick1 || Language::QmlQtQuick2))
+ && (mainLanguage == Language::QmlQtQuick1 || mainLanguage == Language::QmlQtQuick2))
language = mainLanguage;
QString contents;
int documentRevision = 0;
diff --git a/src/libs/ssh/ssh.qbs b/src/libs/ssh/ssh.qbs
index c8a0c5ef91..e044ba16b6 100644
--- a/src/libs/ssh/ssh.qbs
+++ b/src/libs/ssh/ssh.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcLibrary
QtcLibrary {
diff --git a/src/libs/utils/logging.h b/src/libs/utils/logging.h
index 825abff590..3252287627 100644
--- a/src/libs/utils/logging.h
+++ b/src/libs/utils/logging.h
@@ -31,7 +31,7 @@
#include <qglobal.h>
-#if QT_VERSION < 0x052000
+#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0)
//
// Qt < 5.2 didn't feature categorized logging:
@@ -67,7 +67,7 @@ private:
return category; \
}
-#if QT_VERSION > 0x050000
+#if QT_VERSION > QT_VERSION_CHECK(5, 0, 0)
//
// Qt 5.0, 5.1 do have already support for categories in QMessageLogger
@@ -100,13 +100,13 @@ private:
qCritical(__VA_ARGS__)
-# endif // QT_VERSION > 0x050000
+# endif // QT_VERSION > QT_VERSION_CHECK(5, 0, 0)
-#else // QT_VERSION >= 0x052000
+#else // QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
#include <QLoggingCategory>
-#if QT_VERSION < 0x053000
+#if QT_VERSION < QT_VERSION_CHECK(5, 3, 0)
// printf style for qCDebug was only added in Qt 5.3
@@ -124,6 +124,6 @@ private:
for (bool q_category_enabled = category().isCriticalEnabled(); q_category_enabled; q_category_enabled = false) \
QMessageLogger(__FILE__, __LINE__, Q_FUNC_INFO, category().categoryName()).critical(__VA_ARGS__)
-#endif // QT_VERSION < 0x053000
-#endif // QT_VERSION < 0x052000
+#endif // QT_VERSION < QT_VERSION_CHECK(5, 3, 0)
+#endif // QT_VERSION < QT_VERSION_CHECK(5, 2, 0)
#endif // LOGGING_H
diff --git a/src/libs/utils/process_ctrlc_stub.qbs b/src/libs/utils/process_ctrlc_stub.qbs
index 8f0a3f763c..aec4ffbf7e 100644
--- a/src/libs/utils/process_ctrlc_stub.qbs
+++ b/src/libs/utils/process_ctrlc_stub.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcTool
QtcTool {
diff --git a/src/libs/utils/process_stub.qbs b/src/libs/utils/process_stub.qbs
index 6f1a06310c..8ef2dd51fb 100644
--- a/src/libs/utils/process_stub.qbs
+++ b/src/libs/utils/process_stub.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcTool
QtcTool {
diff --git a/src/libs/utils/synchronousprocess.cpp b/src/libs/utils/synchronousprocess.cpp
index bb31af4f06..5ede9bcc6b 100644
--- a/src/libs/utils/synchronousprocess.cpp
+++ b/src/libs/utils/synchronousprocess.cpp
@@ -188,7 +188,8 @@ void ChannelBuffer::clearForRun()
QString ChannelBuffer::linesRead()
{
// Any new lines?
- const int lastLineIndex = data.lastIndexOf(QLatin1Char('\n'));
+ const int lastLineIndex = qMax(data.lastIndexOf(QLatin1Char('\n')),
+ data.lastIndexOf(QLatin1Char('\r')));
if (lastLineIndex == -1 || lastLineIndex <= bufferPos)
return QString();
const int nextBufferPos = lastLineIndex + 1;
@@ -719,20 +720,8 @@ QString SynchronousProcess::locateBinary(const QString &path, const QString &bin
QString SynchronousProcess::normalizeNewlines(const QString &text)
{
- const QChar cr(QLatin1Char('\r'));
- const QChar lf(QLatin1Char('\n'));
- QString res;
- res.reserve(text.size());
- for (int i = 0, count = text.size(); i < count; ++i) {
- const QChar c = text.at(i);
- if (c == cr) {
- res += lf;
- if (i + 1 < count && text.at(i + 1) == lf)
- ++i;
- } else {
- res += c;
- }
- }
+ QString res = text;
+ res.replace(QLatin1String("\r\n"), QLatin1String("\n"));
return res;
}
diff --git a/src/libs/utils/utils.qbs b/src/libs/utils/utils.qbs
index 987adc0db7..0714e853d2 100644
--- a/src/libs/utils/utils.qbs
+++ b/src/libs/utils/utils.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcLibrary
QtcLibrary {
diff --git a/src/libs/zeroconf/zeroconf.qbs b/src/libs/zeroconf/zeroconf.qbs
index d16f576b1b..935f63b406 100644
--- a/src/libs/zeroconf/zeroconf.qbs
+++ b/src/libs/zeroconf/zeroconf.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcLibrary
QtcLibrary {
diff --git a/src/plugins/analyzerbase/analyzerbase.qbs b/src/plugins/analyzerbase/analyzerbase.qbs
index 4249cec137..6506ed43cd 100644
--- a/src/plugins/analyzerbase/analyzerbase.qbs
+++ b/src/plugins/analyzerbase/analyzerbase.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/android/android.qbs b/src/plugins/android/android.qbs
index c79434734e..4e59499c94 100644
--- a/src/plugins/android/android.qbs
+++ b/src/plugins/android/android.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/android/androidanalyzesupport.cpp b/src/plugins/android/androidanalyzesupport.cpp
index 858920512f..7c24ecfa6f 100644
--- a/src/plugins/android/androidanalyzesupport.cpp
+++ b/src/plugins/android/androidanalyzesupport.cpp
@@ -114,10 +114,12 @@ void AndroidAnalyzeSupport::handleRemoteOutput(const QByteArray &output)
void AndroidAnalyzeSupport::handleRemoteErrorOutput(const QByteArray &output)
{
+ const QString msg = QString::fromUtf8(output);
if (m_runControl)
- m_runControl->logApplicationMessage(QString::fromUtf8(output), Utils::StdErrFormatSameLine);
+ m_runControl->logApplicationMessage(msg, Utils::StdErrFormatSameLine);
else
AndroidRunSupport::handleRemoteErrorOutput(output);
+ m_outputParser.processOutput(msg);
}
void AndroidAnalyzeSupport::remoteIsRunning()
diff --git a/src/plugins/android/androidconfigurations.cpp b/src/plugins/android/androidconfigurations.cpp
index bc0a939e39..609e5e13e0 100644
--- a/src/plugins/android/androidconfigurations.cpp
+++ b/src/plugins/android/androidconfigurations.cpp
@@ -574,7 +574,9 @@ QVector<AndroidDeviceInfo> AndroidConfig::androidVirtualDevices() const
break;
if (line.contains(QLatin1String("Target:")))
dev.sdk = line.mid(line.lastIndexOf(QLatin1Char(' '))).remove(QLatin1Char(')')).toInt();
- if (line.contains(QLatin1String("ABI:")))
+ if (line.contains(QLatin1String("Tag/ABI:")))
+ dev.cpuAbi = QStringList() << line.mid(line.lastIndexOf(QLatin1Char('/')) +1);
+ else if (line.contains(QLatin1String("ABI:")))
dev.cpuAbi = QStringList() << line.mid(line.lastIndexOf(QLatin1Char(' '))).trimmed();
}
// armeabi-v7a devices can also run armeabi code
@@ -884,8 +886,9 @@ void AndroidConfigurations::setConfig(const AndroidConfig &devConfigs)
m_instance->m_config = devConfigs;
m_instance->save();
- m_instance->updateAutomaticKitList();
m_instance->updateAndroidDevice();
+ m_instance->updateToolChainList();
+ m_instance->updateAutomaticKitList();
emit m_instance->updated();
}
@@ -944,6 +947,32 @@ static bool equalKits(Kit *a, Kit *b)
&& QtSupport::QtKitInformation::qtVersion(a) == QtSupport::QtKitInformation::qtVersion(b);
}
+void AndroidConfigurations::updateToolChainList()
+{
+ QList<ToolChain *> existingToolChains = ToolChainManager::toolChains();
+ QList<ToolChain *> toolchains = AndroidToolChainFactory::createToolChainsForNdk(AndroidConfigurations::currentConfig().ndkLocation());
+ foreach (ToolChain *tc, toolchains) {
+ bool found = false;
+ for (int i = 0; i < existingToolChains.count(); ++i) {
+ if (*(existingToolChains.at(i)) == *tc) {
+ found = true;
+ break;
+ }
+ }
+ if (found)
+ delete tc;
+ else
+ ToolChainManager::registerToolChain(tc);
+ }
+
+ foreach (ToolChain *tc, existingToolChains) {
+ if (tc->type() == QLatin1String(Constants::ANDROID_TOOLCHAIN_TYPE)) {
+ if (!tc->isValid())
+ ToolChainManager::deregisterToolChain(tc);
+ }
+ }
+}
+
void AndroidConfigurations::updateAutomaticKitList()
{
QList<AndroidToolChain *> toolchains;
diff --git a/src/plugins/android/androidconfigurations.h b/src/plugins/android/androidconfigurations.h
index 9d2fcc630a..1f2be2a0c4 100644
--- a/src/plugins/android/androidconfigurations.h
+++ b/src/plugins/android/androidconfigurations.h
@@ -185,6 +185,7 @@ public:
static QString defaultDevice(ProjectExplorer::Project *project, const QString &abi); // serial number or avd name
public slots:
static void clearDefaultDevices(ProjectExplorer::Project *project);
+ static void updateToolChainList();
static void updateAutomaticKitList();
signals:
diff --git a/src/plugins/android/androiddeployqtwidget.ui b/src/plugins/android/androiddeployqtwidget.ui
index d1fa06ddbf..dff8cad50a 100644
--- a/src/plugins/android/androiddeployqtwidget.ui
+++ b/src/plugins/android/androiddeployqtwidget.ui
@@ -248,7 +248,7 @@
<item>
<widget class="QRadioButton" name="ministroOption">
<property name="toolTip">
- <string>Use the external Ministro application to download and maintain Qt libraries.</string>
+ <string>Uses the external Ministro application to download and maintain Qt libraries.</string>
</property>
<property name="text">
<string>Use Ministro service to install Qt</string>
@@ -261,7 +261,7 @@
<item>
<widget class="QRadioButton" name="temporaryQtOption">
<property name="toolTip">
- <string>Push local Qt libraries to device. You must have Qt libraries compiled for that platform.
+ <string>Pushes local Qt libraries to device. You must have Qt libraries compiled for that platform.
The APK will not be usable on any other device.</string>
</property>
<property name="text">
diff --git a/src/plugins/android/androiddeploystepwidget.ui b/src/plugins/android/androiddeploystepwidget.ui
index 9db955796d..5973527807 100644
--- a/src/plugins/android/androiddeploystepwidget.ui
+++ b/src/plugins/android/androiddeploystepwidget.ui
@@ -29,7 +29,7 @@
<item>
<widget class="QRadioButton" name="ministroOption">
<property name="toolTip">
- <string>Use the external Ministro application to download and maintain Qt libraries.</string>
+ <string>Uses the external Ministro application to download and maintain Qt libraries.</string>
</property>
<property name="text">
<string>Use Ministro service to install Qt</string>
@@ -42,7 +42,7 @@
<item>
<widget class="QRadioButton" name="temporaryQtOption">
<property name="toolTip">
- <string>Push local Qt libraries to device. You must have Qt libraries compiled for that platform.
+ <string>Pushes local Qt libraries to device. You must have Qt libraries compiled for that platform.
The APK will not be usable on any other device.</string>
</property>
<property name="text">
diff --git a/src/plugins/android/androiddevicedialog.cpp b/src/plugins/android/androiddevicedialog.cpp
index ff243188f6..ff6b422757 100644
--- a/src/plugins/android/androiddevicedialog.cpp
+++ b/src/plugins/android/androiddevicedialog.cpp
@@ -33,6 +33,7 @@
#include <QPainter>
#include <QStyledItemDelegate>
+#include <QToolTip>
using namespace Android;
using namespace Android::Internal;
@@ -386,6 +387,17 @@ AndroidDeviceDialog::AndroidDeviceDialog(int apiLevel, const QString &abi, QWidg
m_ui->defaultDeviceCheckBox->setText(tr("Always use this device for architecture %1").arg(abi));
+ m_ui->noDeviceFoundLabel->setText(tr("<p align=\"center\"><span style=\" font-size:16pt;\">"
+ "No Device Found</span></p>"
+ "<br/>"
+ "<p>Connect an Android device via USB and activate developer mode on it. "
+ "Some devices require the installation of a USB driver.</p>"
+ "<br/>"
+ "<p>The adb tool in the Android SDK lists all connected devices if run via &quot;adb devices&quot;.</p>"
+ ));
+ connect(m_ui->missingLabel, SIGNAL(linkActivated(QString)),
+ this, SLOT(showHelp()));
+
connect(m_ui->refreshDevicesButton, SIGNAL(clicked()),
this, SLOT(refreshDeviceList()));
@@ -445,6 +457,8 @@ void AndroidDeviceDialog::refreshDeviceList()
newIndex = m_model->indexFor(devices.first().serialNumber);
m_ui->deviceView->setCurrentIndex(newIndex);
+
+ m_ui->stackedWidget->setCurrentIndex(devices.isEmpty() ? 1 : 0);
}
void AndroidDeviceDialog::createAvd()
@@ -470,3 +484,13 @@ void AndroidDeviceDialog::clickedOnView(const QModelIndex &idx)
}
}
}
+
+void AndroidDeviceDialog::showHelp()
+{
+ QPoint pos = m_ui->missingLabel->pos();
+ pos = m_ui->missingLabel->parentWidget()->mapToGlobal(pos);
+ QToolTip::showText(pos, tr("<p>Connect an Android device via USB and activate developer mode on it. "
+ "Some devices require the installation of a USB driver.</p>"
+ "<p>The adb tool in the Android SDK lists all connected devices if run via &quot;adb devices&quot;.</p>"),
+ this);
+}
diff --git a/src/plugins/android/androiddevicedialog.h b/src/plugins/android/androiddevicedialog.h
index 0c5c5ed964..6cb4202ab7 100644
--- a/src/plugins/android/androiddevicedialog.h
+++ b/src/plugins/android/androiddevicedialog.h
@@ -62,6 +62,7 @@ private slots:
void refreshDeviceList();
void createAvd();
void clickedOnView(const QModelIndex &idx);
+ void showHelp();
private:
AndroidDeviceModel *m_model;
Ui::AndroidDeviceDialog *m_ui;
diff --git a/src/plugins/android/androiddevicedialog.ui b/src/plugins/android/androiddevicedialog.ui
index c64465e143..ef02aa4391 100644
--- a/src/plugins/android/androiddevicedialog.ui
+++ b/src/plugins/android/androiddevicedialog.ui
@@ -6,36 +6,29 @@
<rect>
<x>0</x>
<y>0</y>
- <width>618</width>
- <height>400</height>
+ <width>636</width>
+ <height>438</height>
</rect>
</property>
<property name="windowTitle">
<string>Select Android Device</string>
</property>
<layout class="QGridLayout" name="gridLayout">
- <item row="1" column="0">
- <widget class="QPushButton" name="refreshDevicesButton">
+ <item row="3" column="0" colspan="2">
+ <widget class="QCheckBox" name="defaultDeviceCheckBox">
<property name="text">
- <string>Refresh Device List</string>
+ <string>Always use this device for architecture %1</string>
</property>
</widget>
</item>
- <item row="1" column="1">
+ <item row="2" column="1">
<widget class="QPushButton" name="createAVDButton">
<property name="text">
<string>Create Android Virtual Device</string>
</property>
</widget>
</item>
- <item row="2" column="0" colspan="2">
- <widget class="QCheckBox" name="defaultDeviceCheckBox">
- <property name="text">
- <string>Always use this device for architecture %1</string>
- </property>
- </widget>
- </item>
- <item row="3" column="2">
+ <item row="4" column="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -45,14 +38,62 @@
</property>
</widget>
</item>
+ <item row="2" column="0">
+ <widget class="QPushButton" name="refreshDevicesButton">
+ <property name="text">
+ <string>Refresh Device List</string>
+ </property>
+ </widget>
+ </item>
<item row="0" column="0" colspan="3">
- <widget class="QTreeView" name="deviceView">
- <property name="minimumSize">
- <size>
- <width>600</width>
- <height>300</height>
- </size>
+ <widget class="QStackedWidget" name="stackedWidget">
+ <property name="currentIndex">
+ <number>0</number>
</property>
+ <widget class="QWidget" name="devicesPage">
+ <layout class="QGridLayout" name="gridLayout_3">
+ <item row="1" column="0">
+ <widget class="QTreeView" name="deviceView">
+ <property name="minimumSize">
+ <size>
+ <width>600</width>
+ <height>300</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="missingLabel">
+ <property name="text">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;aaa&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0057ae;&quot;&gt;My device is missing&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ <property name="textFormat">
+ <enum>Qt::RichText</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="noDevicesPage">
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="0" column="0">
+ <widget class="QLabel" name="noDeviceFoundLabel">
+ <property name="text">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ <property name="textFormat">
+ <enum>Qt::RichText</enum>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
</widget>
</item>
</layout>
diff --git a/src/plugins/android/androidmanager.cpp b/src/plugins/android/androidmanager.cpp
index 35a2c6b8d2..3c5e1397db 100644
--- a/src/plugins/android/androidmanager.cpp
+++ b/src/plugins/android/androidmanager.cpp
@@ -39,6 +39,7 @@
#include <coreplugin/documentmanager.h>
#include <coreplugin/messagemanager.h>
+#include <coreplugin/icore.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/session.h>
#include <projectexplorer/target.h>
@@ -631,7 +632,7 @@ bool AndroidManager::createAndroidTemplatesIfNecessary(ProjectExplorer::Target *
}
if (forceUpdate)
- QMessageBox::warning(0, tr("Warning"), tr("Android files have been updated automatically."));
+ QMessageBox::warning(Core::ICore::dialogParent(), tr("Warning"), tr("Android files have been updated automatically."));
return true;
}
diff --git a/src/plugins/android/androidmanifesteditorwidget.cpp b/src/plugins/android/androidmanifesteditorwidget.cpp
index 4edea40f16..4dbf918573 100644
--- a/src/plugins/android/androidmanifesteditorwidget.cpp
+++ b/src/plugins/android/androidmanifesteditorwidget.cpp
@@ -66,6 +66,7 @@
#include <QPushButton>
#include <QFileDialog>
#include <QTimer>
+#include <QCheckBox>
using namespace ProjectExplorer;
using namespace Android;
@@ -278,16 +279,21 @@ void AndroidManifestEditorWidget::initializePage()
{
QGridLayout *layout = new QGridLayout(permissionsGroupBox);
+ m_defaultPermissonsCheckBox = new QCheckBox(this);
+ m_defaultPermissonsCheckBox->setText(tr("Include default permissions and features for Qt modules."));
+ m_defaultPermissonsCheckBox->setTristate(true);
+ layout->addWidget(m_defaultPermissonsCheckBox, 0, 0);
+
m_permissionsModel = new PermissionsModel(this);
m_permissionsListView = new QListView(permissionsGroupBox);
m_permissionsListView->setModel(m_permissionsModel);
m_permissionsListView->setMinimumSize(QSize(0, 200));
- layout->addWidget(m_permissionsListView, 0, 0, 3, 1);
+ layout->addWidget(m_permissionsListView, 1, 0, 3, 1);
m_removePermissionButton = new QPushButton(permissionsGroupBox);
m_removePermissionButton->setText(tr("Remove"));
- layout->addWidget(m_removePermissionButton, 0, 1);
+ layout->addWidget(m_removePermissionButton, 1, 1);
m_permissionsComboBox = new QComboBox(permissionsGroupBox);
m_permissionsComboBox->insertItems(0, QStringList()
@@ -423,14 +429,17 @@ void AndroidManifestEditorWidget::initializePage()
<< QLatin1String("android.permission.WRITE_USER_DICTIONARY")
);
m_permissionsComboBox->setEditable(true);
- layout->addWidget(m_permissionsComboBox, 4, 0);
+ layout->addWidget(m_permissionsComboBox, 5, 0);
m_addPermissionButton = new QPushButton(permissionsGroupBox);
m_addPermissionButton->setText(tr("Add"));
- layout->addWidget(m_addPermissionButton, 4, 1);
+ layout->addWidget(m_addPermissionButton, 5, 1);
permissionsGroupBox->setLayout(layout);
+ connect(m_defaultPermissonsCheckBox, SIGNAL(stateChanged(int)),
+ this, SLOT(defaultPermissionCheckBoxClicked()));
+
connect(m_addPermissionButton, SIGNAL(clicked()),
this, SLOT(addPermission()));
connect(m_removePermissionButton, SIGNAL(clicked()),
@@ -791,6 +800,29 @@ void AndroidManifestEditorWidget::syncToWidgets(const QDomDocument &doc)
m_mIconPath.clear();
m_hIconPath.clear();
+ disconnect(m_defaultPermissonsCheckBox, SIGNAL(stateChanged(int)),
+ this, SLOT(defaultPermissionCheckBoxClicked()));
+
+ m_defaultPermissonsCheckBox->setChecked(false);
+ QDomNodeList manifestChilds = manifest.childNodes();
+ bool foundPermissionComment = false;
+ bool foundFeatureComment = false;
+ for (int i = 0; i < manifestChilds.size(); ++i) {
+ const QDomNode &child = manifestChilds.at(i);
+ if (child.isComment()) {
+ QDomComment comment = child.toComment();
+ if (comment.data().trimmed() == QLatin1String("%%INSERT_PERMISSIONS"))
+ foundPermissionComment = true;
+ else if (comment.data().trimmed() == QLatin1String("%%INSERT_FEATURES"))
+ foundFeatureComment = true;
+ }
+ }
+
+ m_defaultPermissonsCheckBox->setCheckState(Qt::CheckState(foundFeatureComment + foundPermissionComment));
+
+ connect(m_defaultPermissonsCheckBox, SIGNAL(stateChanged(int)),
+ this, SLOT(defaultPermissionCheckBoxClicked()));
+
QStringList permissions;
QDomElement permissionElem = manifest.firstChildElement(QLatin1String("uses-permission"));
while (!permissionElem.isNull()) {
@@ -805,53 +837,6 @@ void AndroidManifestEditorWidget::syncToWidgets(const QDomDocument &doc)
m_dirty = false;
}
-void setUsesSdk(QDomDocument &doc, QDomElement &manifest, int minimumSdk, int targetSdk)
-{
- QDomElement usesSdk = manifest.firstChildElement(QLatin1String("uses-sdk"));
- if (usesSdk.isNull()) { // doesn't exist yet
- if (minimumSdk == 0 && targetSdk == 0) {
- // and doesn't need to exist
- } else {
- usesSdk = doc.createElement(QLatin1String("uses-sdk"));
- if (minimumSdk != 0)
- usesSdk.setAttribute(QLatin1String("android:minSdkVersion"), minimumSdk);
- if (targetSdk != 0)
- usesSdk.setAttribute(QLatin1String("android:targetSdkVersion"), targetSdk);
- manifest.appendChild(usesSdk);
- }
- } else {
- if (minimumSdk == 0 && targetSdk == 0) {
- // We might be able to remove the whole element
- // check if there are other attributes
- QDomNamedNodeMap usesSdkAttributes = usesSdk.attributes();
- bool keepNode = false;
- for (int i = 0; i < usesSdkAttributes.size(); ++i) {
- if (usesSdkAttributes.item(i).nodeName() != QLatin1String("android:minSdkVersion")
- && usesSdkAttributes.item(i).nodeName() != QLatin1String("android:targetSdkVersion")) {
- keepNode = true;
- break;
- }
- }
- if (keepNode) {
- usesSdk.removeAttribute(QLatin1String("android:minSdkVersion"));
- usesSdk.removeAttribute(QLatin1String("android:targetSdkVersion"));
- } else {
- manifest.removeChild(usesSdk);
- }
- } else {
- if (minimumSdk == 0)
- usesSdk.removeAttribute(QLatin1String("android:minSdkVersion"));
- else
- usesSdk.setAttribute(QLatin1String("android:minSdkVersion"), minimumSdk);
-
- if (targetSdk == 0)
- usesSdk.removeAttribute(QLatin1String("android:targetSdkVersion"));
- else
- usesSdk.setAttribute(QLatin1String("android:targetSdkVersion"), targetSdk);
- }
- }
-}
-
int extractVersion(const QString &string)
{
if (!string.startsWith(QLatin1String("API")))
@@ -868,78 +853,360 @@ int extractVersion(const QString &string)
void AndroidManifestEditorWidget::syncToEditor()
{
- QDomDocument doc;
- if (!doc.setContent(m_textEditorWidget->toPlainText())) {
- // This should not happen
- updateInfoBar();
- return;
+ QString result;
+ QXmlStreamReader reader(m_textEditorWidget->toPlainText());
+ reader.setNamespaceProcessing(false);
+ QXmlStreamWriter writer(&result);
+ writer.setAutoFormatting(true);
+ writer.setAutoFormattingIndent(4);
+ while (!reader.atEnd()) {
+ reader.readNext();
+ if (reader.hasError()) {
+ // This should not happen
+ updateInfoBar();
+ return;
+ } else {
+ if (reader.name() == QLatin1String("manifest"))
+ parseManifest(reader, writer);
+ else if (reader.isStartElement())
+ parseUnknownElement(reader, writer);
+ else
+ writer.writeCurrentToken(reader);
+ }
}
- QDomElement manifest = doc.documentElement();
- manifest.setAttribute(QLatin1String("package"), m_packageNameLineEdit->text());
- manifest.setAttribute(QLatin1String("android:versionCode"), m_versionCode->value());
- manifest.setAttribute(QLatin1String("android:versionName"), m_versionNameLinedit->text());
+ if (result == m_textEditorWidget->toPlainText())
+ return;
- if (!m_appNameInStringsXml) {
- QDomElement application = manifest.firstChildElement(QLatin1String("application"));
- application.setAttribute(QLatin1String("android:label"), m_appNameLineEdit->text());
- }
+ m_textEditorWidget->setPlainText(result);
+ m_textEditorWidget->document()->setModified(true);
- setUsesSdk(doc, manifest, extractVersion(m_androidMinSdkVersion->currentText()),
- extractVersion(m_androidTargetSdkVersion->currentText()));
+ m_dirty = false;
+}
- setAndroidAppLibName(doc, manifest.firstChildElement(QLatin1String("application"))
- .firstChildElement(QLatin1String("activity")),
- m_targetLineEdit->currentText());
+namespace {
+QXmlStreamAttributes modifyXmlStreamAttributes(const QXmlStreamAttributes &input, const QStringList &keys,
+ const QStringList values, const QStringList &remove = QStringList())
+{
+ Q_ASSERT(keys.size() == values.size());
+ QXmlStreamAttributes result;
+ result.reserve(input.size());
+ foreach (const QXmlStreamAttribute &attribute, input) {
+ const QString &name = attribute.qualifiedName().toString();
+ if (remove.contains(name))
+ continue;
+ int index = keys.indexOf(name);
+ if (index == -1)
+ result.push_back(attribute);
+ else
+ result.push_back(QXmlStreamAttribute(name,
+ values.at(index)));
+ }
- // permissions
- QDomElement permissionElem = manifest.firstChildElement(QLatin1String("uses-permission"));
- while (!permissionElem.isNull()) {
- manifest.removeChild(permissionElem);
- permissionElem = manifest.firstChildElement(QLatin1String("uses-permission"));
+ for (int i = 0; i < keys.size(); ++i) {
+ if (!result.hasAttribute(keys.at(i)))
+ result.push_back(QXmlStreamAttribute(keys.at(i), values.at(i)));
}
+ return result;
+}
+} // end namespace
+
+void AndroidManifestEditorWidget::parseManifest(QXmlStreamReader &reader, QXmlStreamWriter &writer)
+{
+ Q_ASSERT(reader.isStartElement());
+ writer.writeStartElement(reader.name().toString());
+
+ QXmlStreamAttributes attributes = reader.attributes();
+ QStringList keys = QStringList()
+ << QLatin1String("package")
+ << QLatin1String("android:versionCode")
+ << QLatin1String("android:versionName");
+ QStringList values = QStringList()
+ << m_packageNameLineEdit->text()
+ << QString::number(m_versionCode->value())
+ << m_versionNameLinedit->text();
+
+ QXmlStreamAttributes result = modifyXmlStreamAttributes(attributes, keys, values);
+ writer.writeAttributes(result);
+
+ QSet<QString> permissions = m_permissionsModel->permissions().toSet();
+
+ bool foundUsesSdk = false;
+ bool foundPermissionComment = false;
+ bool foundFeatureComment = false;
+ reader.readNext();
+ while (!reader.atEnd()) {
+ if (reader.name() == QLatin1String("application")) {
+ parseApplication(reader, writer);
+ } else if (reader.name() == QLatin1String("uses-sdk")) {
+ parseUsesSdk(reader, writer);
+ foundUsesSdk = true;
+ } else if (reader.name() == QLatin1String("uses-permission")) {
+ permissions.remove(parseUsesPermission(reader, writer, permissions));
+ } else if (reader.isEndElement()) {
+ if (!foundUsesSdk) {
+ int minimumSdk = extractVersion(m_androidMinSdkVersion->currentText());
+ int targetSdk = extractVersion(m_androidTargetSdkVersion->currentText());
+ if (minimumSdk == 0 && targetSdk == 0) {
+ // and doesn't need to exist
+ } else {
+ writer.writeEmptyElement(QLatin1String("uses-sdk"));
+ if (minimumSdk != 0)
+ writer.writeAttribute(QLatin1String("android:minSdkVersion"),
+ QString::number(minimumSdk));
+ if (targetSdk != 0)
+ writer.writeAttribute(QLatin1String("android:targetSdkVersion"),
+ QString::number(targetSdk));
+ }
+ }
+
+ if (!foundPermissionComment && m_defaultPermissonsCheckBox->checkState() == Qt::Checked)
+ writer.writeComment(QLatin1String(" %%INSERT_PERMISSIONS "));
+
+ if (!foundFeatureComment && m_defaultPermissonsCheckBox->checkState() == Qt::Checked)
+ writer.writeComment(QLatin1String(" %%INSERT_FEATURES "));
- foreach (const QString &permission, m_permissionsModel->permissions()) {
- permissionElem = doc.createElement(QLatin1String("uses-permission"));
- permissionElem.setAttribute(QLatin1String("android:name"), permission);
- manifest.appendChild(permissionElem);
+ if (!permissions.isEmpty()) {
+ foreach (const QString &permission, permissions) {
+ writer.writeEmptyElement(QLatin1String("uses-permission"));
+ writer.writeAttribute(QLatin1String("android:name"), permission);
+ }
+ }
+
+ writer.writeCurrentToken(reader);
+ return;
+ } else if (reader.isComment()) {
+ QString commentText = parseComment(reader, writer);
+ if (commentText == QLatin1String("%%INSERT_PERMISSIONS"))
+ foundPermissionComment = true;
+ else if (commentText == QLatin1String("%%INSERT_FEATURES"))
+ foundFeatureComment = true;
+ } else if (reader.isStartElement()) {
+ parseUnknownElement(reader, writer);
+ } else {
+ writer.writeCurrentToken(reader);
+ }
+ reader.readNext();
}
+}
+
+void AndroidManifestEditorWidget::parseApplication(QXmlStreamReader &reader, QXmlStreamWriter &writer)
+{
+ Q_ASSERT(reader.isStartElement());
+ writer.writeStartElement(reader.name().toString());
+ QXmlStreamAttributes attributes = reader.attributes();
+ QStringList keys;
+ QStringList values;
+ if (!m_appNameInStringsXml) {
+ keys << QLatin1String("android:label");
+ values << m_appNameLineEdit->text();
+ }
bool ensureIconAttribute = !m_lIconPath.isEmpty()
|| !m_mIconPath.isEmpty()
|| !m_hIconPath.isEmpty();
-
if (ensureIconAttribute) {
- QDomElement applicationElem = manifest.firstChildElement(QLatin1String("application"));
- applicationElem.setAttribute(QLatin1String("android:icon"), QLatin1String("@drawable/icon"));
+ keys << QLatin1String("android:icon");
+ values << QLatin1String("@drawable/icon");
}
+ QXmlStreamAttributes result = modifyXmlStreamAttributes(attributes, keys, values);
+ writer.writeAttributes(result);
- QString newText = doc.toString(4);
- if (newText == m_textEditorWidget->toPlainText())
- return;
+ reader.readNext();
- m_textEditorWidget->setPlainText(newText);
- m_textEditorWidget->document()->setModified(true);
+ while (!reader.atEnd()) {
+ if (reader.isEndElement()) {
+ writer.writeCurrentToken(reader);
+ return;
+ } else if (reader.isStartElement()) {
+ if (reader.name() == QLatin1String("activity"))
+ parseActivity(reader, writer);
+ else
+ parseUnknownElement(reader, writer);
+ } else {
+ writer.writeCurrentToken(reader);
+ }
- m_dirty = false;
+ reader.readNext();
+ }
}
-bool AndroidManifestEditorWidget::setAndroidAppLibName(QDomDocument document, QDomElement activity, const QString &name)
+void AndroidManifestEditorWidget::parseActivity(QXmlStreamReader &reader, QXmlStreamWriter &writer)
{
- QDomElement metadataElem = activity.firstChildElement(QLatin1String("meta-data"));
- while (!metadataElem.isNull()) {
- if (metadataElem.attribute(QLatin1String("android:name")) == QLatin1String("android.app.lib_name")) {
- metadataElem.setAttribute(QLatin1String("android:value"), name);
- return true;
+ Q_ASSERT(reader.isStartElement());
+ writer.writeCurrentToken(reader);
+ reader.readNext();
+
+ bool found = false;
+
+ while (!reader.atEnd()) {
+ if (reader.isEndElement()) {
+ if (!found) {
+ writer.writeEmptyElement(QLatin1String("meta-data"));
+ writer.writeAttribute(QLatin1String("android:name"),
+ QLatin1String("android.app.lib_name"));
+ writer.writeAttribute(QLatin1String("android:value"),
+ m_targetLineEdit->currentText());
+ }
+ writer.writeCurrentToken(reader);
+ return;
+ } else if (reader.isStartElement()) {
+ if (reader.name() == QLatin1String("meta-data"))
+ found = parseMetaData(reader, writer) || found; // ORDER MATTERS
+ else
+ parseUnknownElement(reader, writer);
+ } else {
+ writer.writeCurrentToken(reader);
}
- metadataElem = metadataElem.nextSiblingElement(QLatin1String("meta-data"));
+ reader.readNext();
+ }
+}
+
+bool AndroidManifestEditorWidget::parseMetaData(QXmlStreamReader &reader, QXmlStreamWriter &writer)
+{
+ Q_ASSERT(reader.isStartElement());
+
+ bool found = false;
+ QXmlStreamAttributes attributes = reader.attributes();
+ QXmlStreamAttributes result;
+
+ if (attributes.value(QLatin1String("android:name")) == QLatin1String("android.app.lib_name")) {
+ QStringList keys = QStringList() << QLatin1String("android:value");
+ QStringList values = QStringList() << m_targetLineEdit->currentText();
+ result = modifyXmlStreamAttributes(attributes, keys, values);
+ found = true;
+ } else {
+ result = attributes;
+ }
+
+ writer.writeStartElement(QLatin1String("meta-data"));
+ writer.writeAttributes(result);
+
+ reader.readNext();
+
+ while (!reader.atEnd()) {
+ if (reader.isEndElement()) {
+ writer.writeCurrentToken(reader);
+ return found;
+ } else if (reader.isStartElement()) {
+ parseUnknownElement(reader, writer);
+ } else {
+ writer.writeCurrentToken(reader);
+ }
+ reader.readNext();
+ }
+ return found; // should never be reached
+}
+
+void AndroidManifestEditorWidget::parseUsesSdk(QXmlStreamReader &reader, QXmlStreamWriter & writer)
+{
+ int minimumSdk = extractVersion(m_androidMinSdkVersion->currentText());
+ int targetSdk = extractVersion(m_androidTargetSdkVersion->currentText());
+
+ QStringList keys;
+ QStringList values;
+ QStringList remove;
+ if (minimumSdk == 0) {
+ remove << QLatin1String("android:minSdkVersion");
+ } else {
+ keys << QLatin1String("android:minSdkVersion");
+ values << QString::number(minimumSdk);
+ }
+ if (targetSdk == 0) {
+ remove << QLatin1String("android:targetSdkVersion");
+ } else {
+ keys << QLatin1String("android:targetSdkVersion");
+ values << QString::number(targetSdk);
+ }
+
+ QXmlStreamAttributes result = modifyXmlStreamAttributes(reader.attributes(),
+ keys, values, remove);
+ bool removeUseSdk = result.isEmpty();
+ if (!removeUseSdk) {
+ writer.writeStartElement(reader.name().toString());
+ writer.writeAttributes(result);
+ }
+
+ reader.readNext();
+ while (!reader.atEnd()) {
+ if (reader.isEndElement()) {
+ if (!removeUseSdk)
+ writer.writeCurrentToken(reader);
+ return;
+ } else {
+ if (removeUseSdk) {
+ removeUseSdk = false;
+ writer.writeStartElement(QLatin1String("uses-sdk"));
+ }
+
+ if (reader.isStartElement())
+ parseUnknownElement(reader, writer);
+ else
+ writer.writeCurrentToken(reader);
+ }
+ reader.readNext();
+ }
+}
+
+QString AndroidManifestEditorWidget::parseUsesPermission(QXmlStreamReader &reader, QXmlStreamWriter &writer, const QSet<QString> permissions)
+{
+ Q_ASSERT(reader.isStartElement());
+
+
+ QString permissionName = reader.attributes().value(QLatin1String("android:name")).toString();
+ bool writePermission = permissions.contains(permissionName);
+ if (writePermission)
+ writer.writeCurrentToken(reader);
+ reader.readNext();
+
+ while (!reader.atEnd()) {
+ if (reader.isEndElement()) {
+ if (writePermission)
+ writer.writeCurrentToken(reader);
+ return permissionName;
+ } else if (reader.isStartElement()) {
+ parseUnknownElement(reader, writer);
+ } else {
+ writer.writeCurrentToken(reader);
+ }
+ reader.readNext();
+ }
+ return permissionName; // should not be reached
+}
+
+QString AndroidManifestEditorWidget::parseComment(QXmlStreamReader &reader, QXmlStreamWriter &writer)
+{
+ QString commentText = reader.text().toString().trimmed();
+ if (commentText == QLatin1String("%%INSERT_PERMISSIONS")
+ || commentText == QLatin1String("%%INSERT_FEATURES")) {
+ if (m_defaultPermissonsCheckBox->checkState() == Qt::Unchecked)
+ return commentText;
+
+ writer.writeCurrentToken(reader);
+ return commentText;
+ }
+ writer.writeCurrentToken(reader);
+ return QString();
+}
+
+void AndroidManifestEditorWidget::parseUnknownElement(QXmlStreamReader &reader, QXmlStreamWriter &writer)
+{
+ Q_ASSERT(reader.isStartElement());
+ writer.writeCurrentToken(reader);
+ reader.readNext();
+
+ while (!reader.atEnd()) {
+ if (reader.isEndElement()) {
+ writer.writeCurrentToken(reader);
+ return;
+ } else if (reader.isStartElement()) {
+ parseUnknownElement(reader, writer);
+ } else {
+ writer.writeCurrentToken(reader);
+ }
+ reader.readNext();
}
- QDomElement elem = document.createElement(QLatin1String("meta-data"));
- elem.setAttribute(QLatin1String("android:name"), QLatin1String("android.app.lib_name"));
- elem.setAttribute(QLatin1String("android:value"), name);
- activity.appendChild(elem);
- return true;
}
QString AndroidManifestEditorWidget::iconPath(const QString &baseDir, IconDPI dpi)
@@ -1021,6 +1288,13 @@ void AndroidManifestEditorWidget::setHDPIIcon()
setDirty(true);
}
+void AndroidManifestEditorWidget::defaultPermissionCheckBoxClicked()
+{
+ if (m_defaultPermissonsCheckBox->checkState() == Qt::PartiallyChecked)
+ m_defaultPermissonsCheckBox->setChecked(Qt::Checked);
+ setDirty(true);
+}
+
void AndroidManifestEditorWidget::updateAddRemovePermissionButtons()
{
QStringList permissions = m_permissionsModel->permissions();
diff --git a/src/plugins/android/androidmanifesteditorwidget.h b/src/plugins/android/androidmanifesteditorwidget.h
index ab19800e2f..bfc016cac2 100644
--- a/src/plugins/android/androidmanifesteditorwidget.h
+++ b/src/plugins/android/androidmanifesteditorwidget.h
@@ -39,6 +39,7 @@
#include <QTimer>
QT_BEGIN_NAMESPACE
+class QCheckBox;
class QDomDocument;
class QDomElement;
class QComboBox;
@@ -48,6 +49,8 @@ class QLineEdit;
class QListView;
class QSpinBox;
class QToolButton;
+class QXmlStreamReader;
+class QXmlStreamWriter;
QT_END_NAMESPACE
namespace Core { class IEditor; }
@@ -120,6 +123,7 @@ private slots:
void setLDPIIcon();
void setMDPIIcon();
void setHDPIIcon();
+ void defaultPermissionCheckBoxClicked();
void addPermission();
void removePermission();
void updateAddRemovePermissionButtons();
@@ -137,7 +141,6 @@ private:
void syncToEditor();
bool checkDocument(QDomDocument doc, QString *errorMessage, int *errorLine, int *errorColumn);
- bool setAndroidAppLibName(QDomDocument document, QDomElement activity, const QString &name);
enum IconDPI { LowDPI, MediumDPI, HighDPI };
QIcon icon(const QString &baseDir, IconDPI dpi);
QString iconPath(const QString &baseDir, IconDPI dpi);
@@ -147,6 +150,15 @@ private:
void hideInfoBar();
Q_SLOT void updateTargetComboBox();
+ void parseManifest(QXmlStreamReader &reader, QXmlStreamWriter &writer);
+ void parseApplication(QXmlStreamReader &reader, QXmlStreamWriter &writer);
+ void parseActivity(QXmlStreamReader &reader, QXmlStreamWriter &writer);
+ bool parseMetaData(QXmlStreamReader &reader, QXmlStreamWriter &writer);
+ void parseUsesSdk(QXmlStreamReader &reader, QXmlStreamWriter &writer);
+ QString parseUsesPermission(QXmlStreamReader &reader, QXmlStreamWriter &writer, const QSet<QString> permissions);
+ QString parseComment(QXmlStreamReader &reader, QXmlStreamWriter &writer);
+ void parseUnknownElement(QXmlStreamReader &reader, QXmlStreamWriter &writer);
+
bool m_dirty; // indicates that we need to call syncToEditor()
bool m_stayClean;
bool m_setAppName;
@@ -173,6 +185,7 @@ private:
QString m_hIconPath;
// Permissions
+ QCheckBox *m_defaultPermissonsCheckBox;
PermissionsModel *m_permissionsModel;
QListView *m_permissionsListView;
QPushButton *m_addPermissionButton;
diff --git a/src/plugins/android/androidpackagecreationwidget.ui b/src/plugins/android/androidpackagecreationwidget.ui
index 5f27b1d6e9..13b96df747 100644
--- a/src/plugins/android/androidpackagecreationwidget.ui
+++ b/src/plugins/android/androidpackagecreationwidget.ui
@@ -45,7 +45,7 @@
<item row="0" column="0" colspan="2">
<widget class="QPushButton" name="readInfoPushButton">
<property name="toolTip">
- <string>Automatically check required Qt libraries from compiled application</string>
+ <string>Automatically check required Qt libraries from compiled application.</string>
</property>
<property name="text">
<string>Read information from application (must be compiled)</string>
diff --git a/src/plugins/android/androidrunner.cpp b/src/plugins/android/androidrunner.cpp
index 7647876824..093958c85f 100644
--- a/src/plugins/android/androidrunner.cpp
+++ b/src/plugins/android/androidrunner.cpp
@@ -183,6 +183,7 @@ void AndroidRunner::checkPID()
emit remoteProcessStarted(-1, -1);
}
m_wasStarted = true;
+ logcatReadStandardOutput();
}
}
@@ -350,22 +351,17 @@ void AndroidRunner::stop()
m_adbLogcatProcess.waitForFinished();
}
-void AndroidRunner::logcatReadStandardError()
+void AndroidRunner::logcatProcess(const QByteArray &text, QByteArray &buffer, bool onlyError)
{
- emit remoteErrorOutput(m_adbLogcatProcess.readAllStandardError());
-}
-
-void AndroidRunner::logcatReadStandardOutput()
-{
- QList<QByteArray> lines = m_adbLogcatProcess.readAllStandardOutput().split('\n');
+ QList<QByteArray> lines = text.split('\n');
// lines always contains at least one item
- lines[0].prepend(m_logcat);
+ lines[0].prepend(buffer);
if (!lines.last().endsWith('\n')) {
// incomplete line
- m_logcat = lines.last();
+ buffer = lines.last();
lines.removeLast();
} else {
- m_logcat.clear();
+ buffer.clear();
}
QByteArray pid(QString::fromLatin1("%1):").arg(m_processPID).toLatin1());
@@ -375,7 +371,8 @@ void AndroidRunner::logcatReadStandardOutput()
if (line.endsWith('\r'))
line.chop(1);
line.append('\n');
- if (line.startsWith("E/")
+ if (onlyError || line.startsWith("F/")
+ || line.startsWith("E/")
|| line.startsWith("D/Qt")
|| line.startsWith("W/"))
emit remoteErrorOutput(line);
@@ -385,6 +382,18 @@ void AndroidRunner::logcatReadStandardOutput()
}
}
+void AndroidRunner::logcatReadStandardError()
+{
+ if (m_processPID != -1)
+ logcatProcess(m_adbLogcatProcess.readAllStandardError(), m_stderrBuffer, true);
+}
+
+void AndroidRunner::logcatReadStandardOutput()
+{
+ if (m_processPID != -1)
+ logcatProcess(m_adbLogcatProcess.readAllStandardOutput(), m_stdoutBuffer, false);
+}
+
void AndroidRunner::adbKill(qint64 pid)
{
{
diff --git a/src/plugins/android/androidrunner.h b/src/plugins/android/androidrunner.h
index b18aee29d2..a42034b557 100644
--- a/src/plugins/android/androidrunner.h
+++ b/src/plugins/android/androidrunner.h
@@ -82,6 +82,7 @@ private:
void forceStop();
QByteArray runPs();
void findPs();
+ void logcatProcess(const QByteArray &text, QByteArray &buffer, bool onlyError);
private:
QProcess m_adbLogcatProcess;
@@ -89,7 +90,8 @@ private:
bool m_wasStarted;
int m_tries;
- QByteArray m_logcat;
+ QByteArray m_stdoutBuffer;
+ QByteArray m_stderrBuffer;
QString m_intentName;
QString m_packageName;
QString m_deviceSerialNumber;
diff --git a/src/plugins/android/androidsettingspage.cpp b/src/plugins/android/androidsettingspage.cpp
index 3e51deb4f3..307cace4e4 100644
--- a/src/plugins/android/androidsettingspage.cpp
+++ b/src/plugins/android/androidsettingspage.cpp
@@ -62,31 +62,6 @@ QWidget *AndroidSettingsPage::widget()
void AndroidSettingsPage::apply()
{
m_widget->saveSettings();
-
- QList<ToolChain *> existingToolChains = ToolChainManager::toolChains();
- QList<ToolChain *> toolchains = AndroidToolChainFactory::createToolChainsForNdk(AndroidConfigurations::currentConfig().ndkLocation());
- foreach (ToolChain *tc, toolchains) {
- bool found = false;
- for (int i = 0; i < existingToolChains.count(); ++i) {
- if (*(existingToolChains.at(i)) == *tc) {
- found = true;
- break;
- }
- }
- if (found)
- delete tc;
- else
- ToolChainManager::registerToolChain(tc);
- }
-
- foreach (ToolChain *tc, existingToolChains) {
- if (tc->type() == QLatin1String(Constants::ANDROID_TOOLCHAIN_TYPE)) {
- if (!tc->isValid())
- ToolChainManager::deregisterToolChain(tc);
- }
- }
-
- AndroidConfigurations::updateAutomaticKitList();
}
void AndroidSettingsPage::finish()
diff --git a/src/plugins/android/androidsettingswidget.cpp b/src/plugins/android/androidsettingswidget.cpp
index 085a3bb412..b6bfdca48b 100644
--- a/src/plugins/android/androidsettingswidget.cpp
+++ b/src/plugins/android/androidsettingswidget.cpp
@@ -216,7 +216,7 @@ void AndroidSettingsWidget::check(AndroidSettingsWidget::Mode mode)
m_javaState = NotSet;
} else {
Utils::FileName bin = m_androidConfig.openJDKLocation();
- bin.appendPath(QLatin1String("bin"));
+ bin.appendPath(QLatin1String("bin/javac" QTC_HOST_EXE_SUFFIX));
if (!m_androidConfig.openJDKLocation().toFileInfo().exists()
|| !bin.toFileInfo().exists())
m_javaState = Error;
diff --git a/src/plugins/android/createandroidmanifestwizard.cpp b/src/plugins/android/createandroidmanifestwizard.cpp
index 5176b78930..bd8e0fbc52 100644
--- a/src/plugins/android/createandroidmanifestwizard.cpp
+++ b/src/plugins/android/createandroidmanifestwizard.cpp
@@ -95,7 +95,7 @@ void ChooseProFilePage::nodeSelected(int index)
// ChooseDirectoryPage
//
ChooseDirectoryPage::ChooseDirectoryPage(CreateAndroidManifestWizard *wizard)
- : m_wizard(wizard), m_androidPackageSourceDir(0)
+ : m_wizard(wizard), m_androidPackageSourceDir(0), m_complete(true)
{
QString androidPackageDir = m_wizard->node()->singleVariableValue(QmakeProjectManager::AndroidPackageSourceDir);
@@ -104,28 +104,68 @@ ChooseDirectoryPage::ChooseDirectoryPage(CreateAndroidManifestWizard *wizard)
label->setWordWrap(true);
fl->addRow(label);
+ m_sourceDirectoryWarning = new QLabel(this);
+ m_sourceDirectoryWarning->setVisible(false);
+ m_sourceDirectoryWarning->setText(tr("The Android package source directory can not be the same as the project directory."));
+ m_sourceDirectoryWarning->setWordWrap(true);
+ m_warningIcon = new QLabel(this);
+ m_warningIcon->setVisible(false);
+ m_warningIcon->setPixmap(QPixmap(QLatin1String(":/projectexplorer/images/compile_error.png")));
+ m_warningIcon->setWordWrap(true);
+ m_warningIcon->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+
+ QHBoxLayout *hbox = new QHBoxLayout;
+ hbox->addWidget(m_warningIcon);
+ hbox->addWidget(m_sourceDirectoryWarning);
+ hbox->setAlignment(m_warningIcon, Qt::AlignTop);
+
+ fl->addRow(hbox);
+
m_androidPackageSourceDir = new Utils::PathChooser(this);
m_androidPackageSourceDir->setExpectedKind(Utils::PathChooser::Directory);
fl->addRow(tr("Android package source directory:"), m_androidPackageSourceDir);
if (androidPackageDir.isEmpty()) {
- label->setText(tr("Select the Android package source directory. "
+ label->setText(tr("Select the Android package source directory.\n\n"
"The files in the Android package source directory are copied to the build directory's "
"Android directory and the default files are overwritten."));
m_androidPackageSourceDir->setPath(QFileInfo(m_wizard->node()->path()).absolutePath().append(QLatin1String("/android")));
+ connect(m_androidPackageSourceDir, SIGNAL(changed(QString)),
+ this, SLOT(checkPackageSourceDir()));
} else {
label->setText(tr("The Android manifest file will be created in the ANDROID_PACKAGE_SOURCE_DIR set in the .pro file."));
m_androidPackageSourceDir->setPath(androidPackageDir);
m_androidPackageSourceDir->setReadOnly(true);
}
+
m_wizard->setDirectory(m_androidPackageSourceDir->path());
connect(m_androidPackageSourceDir, SIGNAL(pathChanged(QString)),
m_wizard, SLOT(setDirectory(QString)));
}
+void ChooseDirectoryPage::checkPackageSourceDir()
+{
+ QString projectDir = QFileInfo(m_wizard->node()->path()).absolutePath();
+ QString newDir = m_androidPackageSourceDir->path();
+ bool isComplete = QFileInfo(projectDir) != QFileInfo(newDir);
+
+ m_sourceDirectoryWarning->setVisible(!isComplete);
+ m_warningIcon->setVisible(!isComplete);
+
+ if (isComplete != m_complete) {
+ m_complete = isComplete;
+ emit completeChanged();
+ }
+}
+
+bool ChooseDirectoryPage::isComplete() const
+{
+ return m_complete;
+}
+
//
// CreateAndroidManifestWizard
//
diff --git a/src/plugins/android/createandroidmanifestwizard.h b/src/plugins/android/createandroidmanifestwizard.h
index a92c610e6f..8cb8c95b7f 100644
--- a/src/plugins/android/createandroidmanifestwizard.h
+++ b/src/plugins/android/createandroidmanifestwizard.h
@@ -34,6 +34,7 @@
QT_BEGIN_NAMESPACE
class QComboBox;
+class QLabel;
QT_END_NAMESPACE
namespace ProjectExplorer { class Target; }
@@ -70,9 +71,16 @@ class ChooseDirectoryPage : public QWizardPage
Q_OBJECT
public:
ChooseDirectoryPage(CreateAndroidManifestWizard *wizard);
+protected:
+ bool isComplete() const;
+private slots:
+ void checkPackageSourceDir();
private:
CreateAndroidManifestWizard *m_wizard;
Utils::PathChooser *m_androidPackageSourceDir;
+ QLabel *m_sourceDirectoryWarning;
+ QLabel *m_warningIcon;
+ bool m_complete;
};
class CreateAndroidManifestWizard : public Utils::Wizard
diff --git a/src/plugins/autotoolsprojectmanager/autotoolsprojectmanager.qbs b/src/plugins/autotoolsprojectmanager/autotoolsprojectmanager.qbs
index cb64585b63..0d377593c4 100644
--- a/src/plugins/autotoolsprojectmanager/autotoolsprojectmanager.qbs
+++ b/src/plugins/autotoolsprojectmanager/autotoolsprojectmanager.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.cpp b/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.cpp
index 355720d169..f7bee79cbd 100644
--- a/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.cpp
+++ b/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.cpp
@@ -45,7 +45,7 @@ AutotoolsProjectNode::AutotoolsProjectNode(AutotoolsProject *project, Core::IDoc
{
}
-bool AutotoolsProjectNode::hasBuildTargets() const
+bool AutotoolsProjectNode::showInSimpleTree() const
{
return true;
}
diff --git a/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.h b/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.h
index a96e1485a2..8c96d0977a 100644
--- a/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.h
+++ b/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.h
@@ -57,7 +57,7 @@ class AutotoolsProjectNode : public ProjectExplorer::ProjectNode
public:
AutotoolsProjectNode(AutotoolsProject *project, Core::IDocument *projectFile);
- bool hasBuildTargets() const;
+ bool showInSimpleTree() const;
QList<ProjectExplorer::ProjectAction> supportedActions(Node *node) const;
bool canAddSubProject(const QString &proFilePath) const;
bool addSubProjects(const QStringList &proFilePaths);
diff --git a/src/plugins/bazaar/bazaar.qbs b/src/plugins/bazaar/bazaar.qbs
index 92dfa3adff..cf7d7f3363 100644
--- a/src/plugins/bazaar/bazaar.qbs
+++ b/src/plugins/bazaar/bazaar.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/bazaar/bazaarcommitpanel.ui b/src/plugins/bazaar/bazaarcommitpanel.ui
index 1a57ceffa7..b0bb2d9410 100644
--- a/src/plugins/bazaar/bazaarcommitpanel.ui
+++ b/src/plugins/bazaar/bazaarcommitpanel.ui
@@ -37,7 +37,7 @@
<item row="2" column="1">
<widget class="QCheckBox" name="isLocalCheckBox">
<property name="toolTip">
- <string>Perform a local commit in a bound branch.
+ <string>Performs a local commit in a bound branch.
Local commits are not pushed to the master branch until a normal commit is performed.</string>
</property>
<property name="text">
diff --git a/src/plugins/bazaar/cloneoptionspanel.ui b/src/plugins/bazaar/cloneoptionspanel.ui
index 2d08db91e6..4a9e6ea712 100644
--- a/src/plugins/bazaar/cloneoptionspanel.ui
+++ b/src/plugins/bazaar/cloneoptionspanel.ui
@@ -49,7 +49,7 @@ This flag will allow branch to proceed.</string>
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="stackedCheckBox">
<property name="toolTip">
- <string>Create a stacked branch referring to the source branch.
+ <string>Creates a stacked branch referring to the source branch.
The new branch will depend on the availability of the source branch for all operations.</string>
</property>
<property name="text">
@@ -60,7 +60,7 @@ The new branch will depend on the availability of the source branch for all oper
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="standAloneCheckBox">
<property name="toolTip">
- <string>Do not use a shared repository, even if available.</string>
+ <string>Does not use a shared repository, even if available.</string>
</property>
<property name="text">
<string>Standalone</string>
@@ -77,7 +77,7 @@ The new branch will depend on the availability of the source branch for all oper
<item row="4" column="0" colspan="2">
<widget class="QCheckBox" name="switchCheckBox">
<property name="toolTip">
- <string>Switch the checkout in the current directory to the new branch.</string>
+ <string>Switches the checkout in the current directory to the new branch.</string>
</property>
<property name="text">
<string>Switch checkout</string>
@@ -87,7 +87,7 @@ The new branch will depend on the availability of the source branch for all oper
<item row="5" column="0" colspan="2">
<widget class="QCheckBox" name="hardlinkCheckBox">
<property name="toolTip">
- <string>Hard-link working tree files where possible.</string>
+ <string>Hard-links working tree files where possible.</string>
</property>
<property name="text">
<string>Hardlink</string>
@@ -97,7 +97,7 @@ The new branch will depend on the availability of the source branch for all oper
<item row="6" column="0" colspan="2">
<widget class="QCheckBox" name="noTreeCheckBox">
<property name="toolTip">
- <string>Create a branch without a working-tree.</string>
+ <string>Creates a branch without a working-tree.</string>
</property>
<property name="text">
<string>No working-tree</string>
diff --git a/src/plugins/bazaar/pullorpushdialog.ui b/src/plugins/bazaar/pullorpushdialog.ui
index 624265764e..d5584af946 100644
--- a/src/plugins/bazaar/pullorpushdialog.ui
+++ b/src/plugins/bazaar/pullorpushdialog.ui
@@ -47,7 +47,7 @@
<item row="2" column="0">
<widget class="QRadioButton" name="urlButton">
<property name="toolTip">
- <string>For example: https://[user[:pass]@]host[:port]/[path]</string>
+ <string>For example: 'https://[user[:pass]@]host[:port]/[path]'.</string>
</property>
<property name="text">
<string>Specify URL:</string>
@@ -60,7 +60,7 @@
<bool>false</bool>
</property>
<property name="toolTip">
- <string>For example: https://[user[:pass]@]host[:port]/[path]</string>
+ <string>For example: 'https://[user[:pass]@]host[:port]/[path]'.</string>
</property>
</widget>
</item>
@@ -86,7 +86,7 @@
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="overwriteCheckBox">
<property name="toolTip">
- <string>Ignore differences between branches and overwrite
+ <string>Ignores differences between branches and overwrites
unconditionally.</string>
</property>
<property name="text">
@@ -108,7 +108,7 @@ This flag will allow push to proceed.</string>
<item row="4" column="0" colspan="2">
<widget class="QCheckBox" name="createPrefixCheckBox">
<property name="toolTip">
- <string>Create the path leading up to the branch if it does not already exist.</string>
+ <string>Creates the path leading up to the branch if it does not already exist.</string>
</property>
<property name="text">
<string>Create prefix</string>
@@ -128,7 +128,7 @@ This flag will allow push to proceed.</string>
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="localCheckBox">
<property name="toolTip">
- <string>Perform a local pull in a bound branch.
+ <string>Performs a local pull in a bound branch.
Local pulls are not applied to the master branch.</string>
</property>
<property name="text">
diff --git a/src/plugins/beautifier/artisticstyle/artisticstyle.cpp b/src/plugins/beautifier/artisticstyle/artisticstyle.cpp
index f9beea916f..b9b4d0bb4f 100644
--- a/src/plugins/beautifier/artisticstyle/artisticstyle.cpp
+++ b/src/plugins/beautifier/artisticstyle/artisticstyle.cpp
@@ -118,11 +118,12 @@ void ArtisticStyle::formatFile()
}
if (cfgFileName.isEmpty() && m_settings->useHomeFile()) {
- QString file = QDir::home().filePath(QLatin1String(".astylerc"));
+ const QDir homeDirectory = QDir::home();
+ QString file = homeDirectory.filePath(QLatin1String(".astylerc"));
if (QFile::exists(file)) {
cfgFileName = file;
} else {
- file = QDir::home().filePath(QLatin1String("astylerc"));
+ file = homeDirectory.filePath(QLatin1String("astylerc"));
if (QFile::exists(file))
cfgFileName = file;
}
diff --git a/src/plugins/beautifier/beautifier.qbs b/src/plugins/beautifier/beautifier.qbs
index 78ef3327ee..685f996e95 100644
--- a/src/plugins/beautifier/beautifier.qbs
+++ b/src/plugins/beautifier/beautifier.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/bineditor/bineditor.qbs b/src/plugins/bineditor/bineditor.qbs
index 2e3109aa85..7951c1180e 100644
--- a/src/plugins/bineditor/bineditor.qbs
+++ b/src/plugins/bineditor/bineditor.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/bookmarks/bookmarks.qbs b/src/plugins/bookmarks/bookmarks.qbs
index b7c3549f61..693357ebe1 100644
--- a/src/plugins/bookmarks/bookmarks.qbs
+++ b/src/plugins/bookmarks/bookmarks.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/clangcodemodel/clangutils.cpp b/src/plugins/clangcodemodel/clangutils.cpp
index dae5f1a835..79348e44bd 100644
--- a/src/plugins/clangcodemodel/clangutils.cpp
+++ b/src/plugins/clangcodemodel/clangutils.cpp
@@ -113,6 +113,11 @@ static QStringList buildDefines(const QByteArray &defines, bool toolchainDefines
if (def.isEmpty())
continue;
+ // This is a quick fix for QTCREATORBUG-11501.
+ // TODO: do a proper fix, see QTCREATORBUG-11709.
+ if (def.startsWith("#define __cplusplus"))
+ continue;
+
// TODO: verify if we can pass compiler-defined macros when also passing -undef.
if (toolchainDefines) {
//### FIXME: the next 3 check shouldn't be needed: we probably don't want to get the compiler-defined defines in.
diff --git a/src/plugins/clangcodemodel/cppcreatemarkers.cpp b/src/plugins/clangcodemodel/cppcreatemarkers.cpp
index aadf3b6b7e..5cbac36dda 100644
--- a/src/plugins/clangcodemodel/cppcreatemarkers.cpp
+++ b/src/plugins/clangcodemodel/cppcreatemarkers.cpp
@@ -32,6 +32,7 @@
#include <cplusplus/CppDocument.h>
#include <cpptools/cppmodelmanagerinterface.h>
+#include <utils/hostosinfo.h>
#include <utils/runextensions.h>
#include <QCoreApplication>
@@ -84,6 +85,17 @@ CreateMarkers::CreateMarkers(SemanticMarker::Ptr semanticMarker,
CreateMarkers::~CreateMarkers()
{ }
+static QString commandLine(const QStringList &options, const QString &fileName)
+{
+ const QStringList allOptions = QStringList(options)
+ << QLatin1String("-fsyntax-only") << fileName;
+ QStringList allOptionsQuoted;
+ foreach (const QString &option, allOptions)
+ allOptionsQuoted.append(QLatin1Char('\'') + option + QLatin1Char('\''));
+ return ::Utils::HostOsInfo::withExecutableSuffix(QLatin1String("clang"))
+ + QLatin1Char(' ') + allOptionsQuoted.join(QLatin1String(" "));
+}
+
void CreateMarkers::run()
{
QMutexLocker lock(m_marker->mutex());
@@ -95,7 +107,8 @@ void CreateMarkers::run()
QTime t;
if (DebugTiming) {
qDebug() << "*** Highlighting from" << m_firstLine << "to" << m_lastLine << "of" << m_fileName;
- qDebug() << "***** Options: " << m_options.join(QLatin1String(" "));
+ qDebug("***** Options (cmd line equivalent): %s",
+ commandLine(m_options, m_fileName).toUtf8().constData());
t.start();
}
diff --git a/src/plugins/classview/classview.qbs b/src/plugins/classview/classview.qbs
index 757ba232c4..6e1d594241 100644
--- a/src/plugins/classview/classview.qbs
+++ b/src/plugins/classview/classview.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/clearcase/clearcase.qbs b/src/plugins/clearcase/clearcase.qbs
index 3533c93629..8321bbb53b 100644
--- a/src/plugins/clearcase/clearcase.qbs
+++ b/src/plugins/clearcase/clearcase.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/clearcase/clearcaseplugin.cpp b/src/plugins/clearcase/clearcaseplugin.cpp
index 0177f740f8..170821b28d 100644
--- a/src/plugins/clearcase/clearcaseplugin.cpp
+++ b/src/plugins/clearcase/clearcaseplugin.cpp
@@ -1658,7 +1658,8 @@ bool ClearCasePlugin::vcsSetActivity(const QString &workingDir, const QString &t
const ClearCaseResponse actResponse =
runCleartool(workingDir, args, m_settings.timeOutMS(), ShowStdOutInLogWindow);
if (actResponse.error) {
- QMessageBox::warning(0, title, tr("Set current activity failed: %1").arg(actResponse.message), QMessageBox::Ok);
+ QMessageBox::warning(ICore::dialogParent(), title,
+ tr("Set current activity failed: %1").arg(actResponse.message), QMessageBox::Ok);
return false;
}
m_activity = activity;
@@ -1821,7 +1822,7 @@ bool ClearCasePlugin::vcsAdd(const QString &workingDir, const QString &fileName)
bool ClearCasePlugin::vcsDelete(const QString &workingDir, const QString &fileName)
{
const QString title(tr("ClearCase Remove Element %1").arg(baseName(fileName)));
- if (QMessageBox::warning(0, title, tr("This operation is irreversible. Are you sure?"),
+ if (QMessageBox::warning(ICore::dialogParent(), title, tr("This operation is irreversible. Are you sure?"),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::No)
return true;
diff --git a/src/plugins/clearcase/settingspage.ui b/src/plugins/clearcase/settingspage.ui
index 9d80e2b4ef..47c89abfa5 100644
--- a/src/plugins/clearcase/settingspage.ui
+++ b/src/plugins/clearcase/settingspage.ui
@@ -193,7 +193,7 @@
<item row="5" column="0">
<widget class="QCheckBox" name="autoAssignActivityCheckBox">
<property name="toolTip">
- <string>Check this if you have a trigger that renames the activity automatically. You will not be prompted for activity name</string>
+ <string>Check this if you have a trigger that renames the activity automatically. You will not be prompted for activity name.</string>
</property>
<property name="text">
<string>Aut&amp;o assign activity names</string>
@@ -227,7 +227,7 @@
<item row="9" column="1">
<widget class="QLineEdit" name="indexOnlyVOBsEdit">
<property name="toolTip">
- <string>VOBs list, separated by comma. Indexer will only traverse the specified VOBs. If left blank, all active VOBs will be indexed</string>
+ <string>VOBs list, separated by comma. Indexer will only traverse the specified VOBs. If left blank, all active VOBs will be indexed.</string>
</property>
</widget>
</item>
diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp
index f76881dcaa..5b72f4237d 100644
--- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp
@@ -65,7 +65,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(ProjectExplorer::Target *parent
CMakeBuildConfiguration *source) :
BuildConfiguration(parent, source),
m_msvcVersion(source->m_msvcVersion),
- m_useNinja(false)
+ m_useNinja(source->m_useNinja)
{
Q_ASSERT(parent);
cloneSteps(source);
diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs
index 18ccd17481..aaa7e9c65b 100644
--- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs
+++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp
index 405b598990..ec7abf0d90 100644
--- a/src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp
@@ -37,7 +37,7 @@ CMakeProjectNode::CMakeProjectNode(const QString &fileName)
{
}
-bool CMakeProjectNode::hasBuildTargets() const
+bool CMakeProjectNode::showInSimpleTree() const
{
// TODO
return true;
diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectnodes.h b/src/plugins/cmakeprojectmanager/cmakeprojectnodes.h
index d34989ef22..f2bfe1c869 100644
--- a/src/plugins/cmakeprojectmanager/cmakeprojectnodes.h
+++ b/src/plugins/cmakeprojectmanager/cmakeprojectnodes.h
@@ -41,7 +41,7 @@ class CMakeProjectNode : public ProjectExplorer::ProjectNode
friend class CMakeProject;
public:
CMakeProjectNode(const QString &fileName);
- virtual bool hasBuildTargets() const;
+ virtual bool showInSimpleTree() const;
virtual QList<ProjectExplorer::ProjectAction> supportedActions(Node *node) const;
virtual bool canAddSubProject(const QString &proFilePath) const;
diff --git a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp
index e8b4fee8a6..5c9df61af8 100644
--- a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp
@@ -260,7 +260,7 @@ CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration *
m_workingDirectoryEdit->setPromptDialogTitle(tr("Select Working Directory"));
QToolButton *resetButton = new QToolButton();
- resetButton->setToolTip(tr("Reset to default"));
+ resetButton->setToolTip(tr("Reset to default."));
resetButton->setIcon(QIcon(QLatin1String(Core::Constants::ICON_RESET)));
QHBoxLayout *boxlayout = new QHBoxLayout();
diff --git a/src/plugins/coreplugin/coreplugin.qbs b/src/plugins/coreplugin/coreplugin.qbs
index 23c10f9c2d..5220e3464e 100644
--- a/src/plugins/coreplugin/coreplugin.qbs
+++ b/src/plugins/coreplugin/coreplugin.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import qbs.FileInfo
import QtcPlugin
diff --git a/src/plugins/coreplugin/dialogs/externaltoolconfig.ui b/src/plugins/coreplugin/dialogs/externaltoolconfig.ui
index fa952c92bc..c330213978 100644
--- a/src/plugins/coreplugin/dialogs/externaltoolconfig.ui
+++ b/src/plugins/coreplugin/dialogs/externaltoolconfig.ui
@@ -37,7 +37,7 @@
<item>
<widget class="QPushButton" name="addButton">
<property name="toolTip">
- <string>Add tool</string>
+ <string>Add tool.</string>
</property>
<property name="text">
<string>Add</string>
@@ -47,7 +47,7 @@
<item>
<widget class="QPushButton" name="removeButton">
<property name="toolTip">
- <string>Remove tool</string>
+ <string>Remove tool.</string>
</property>
<property name="text">
<string>Remove</string>
@@ -70,7 +70,7 @@
<item>
<widget class="QPushButton" name="revertButton">
<property name="toolTip">
- <string>Revert tool to default</string>
+ <string>Revert tool to default.</string>
</property>
<property name="text">
<string>Reset</string>
@@ -149,7 +149,7 @@
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;
&lt;p&gt;What to do with the executable's standard output.
-&lt;ul&gt;&lt;li&gt;Ignore: Do nothing with it&lt;/li&gt;&lt;li&gt;Show in pane: Show it in the general output pane&lt;/li&gt;&lt;li&gt;Replace selection: Replace the current selection in the current document with it&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;
+&lt;ul&gt;&lt;li&gt;Ignore: Do nothing with it.&lt;/li&gt;&lt;li&gt;Show in pane: Show it in the general output pane.&lt;/li&gt;&lt;li&gt;Replace selection: Replace the current selection in the current document with it.&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;
</string>
</property>
<property name="text">
@@ -181,9 +181,9 @@
<property name="toolTip">
<string>&lt;html&gt;&lt;head&gt;&lt;body&gt;
&lt;p &gt;What to do with the executable's standard error output.&lt;/p&gt;
-&lt;ul&gt;&lt;li&gt;Ignore: Do nothing with it&lt;/li&gt;
-&lt;li&gt;Show in pane: Show it in the general output pane&lt;/li&gt;
-&lt;li&gt;Replace selection: Replace the current selection in the current document with it&lt;/li&gt;
+&lt;ul&gt;&lt;li&gt;Ignore: Do nothing with it.&lt;/li&gt;
+&lt;li&gt;Show in pane: Show it in the general output pane.&lt;/li&gt;
+&lt;li&gt;Replace selection: Replace the current selection in the current document with it.&lt;/li&gt;
&lt;/ul&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
diff --git a/src/plugins/coreplugin/find/searchresultwidget.cpp b/src/plugins/coreplugin/find/searchresultwidget.cpp
index b59994c974..b604909b66 100644
--- a/src/plugins/coreplugin/find/searchresultwidget.cpp
+++ b/src/plugins/coreplugin/find/searchresultwidget.cpp
@@ -81,6 +81,7 @@ using namespace Core::Internal;
SearchResultWidget::SearchResultWidget(QWidget *parent) :
QWidget(parent),
m_count(0),
+ m_preserveCaseSupported(true),
m_isShowingReplaceUI(false),
m_searchAgainSupported(false)
{
@@ -294,13 +295,18 @@ QString SearchResultWidget::textToReplace() const
return m_replaceTextEdit->text();
}
+void SearchResultWidget::setSupportPreserveCase(bool enabled)
+{
+ m_preserveCaseSupported = enabled;
+}
+
void SearchResultWidget::setShowReplaceUI(bool visible)
{
m_searchResultTreeView->model()->setShowReplaceUI(visible);
m_replaceLabel->setVisible(visible);
m_replaceTextEdit->setVisible(visible);
m_replaceButton->setVisible(visible);
- m_preserveCaseCheck->setVisible(visible);
+ m_preserveCaseCheck->setVisible(visible && m_preserveCaseSupported);
m_isShowingReplaceUI = visible;
}
@@ -446,7 +452,8 @@ void SearchResultWidget::handleReplaceButton()
// by pressing return in replace line edit
if (m_replaceButton->isEnabled()) {
m_infoBar.clear();
- emit replaceButtonClicked(m_replaceTextEdit->text(), checkedItems(), m_preserveCaseCheck->isChecked());
+ emit replaceButtonClicked(m_replaceTextEdit->text(), checkedItems(),
+ m_preserveCaseSupported && m_preserveCaseCheck->isChecked());
}
}
diff --git a/src/plugins/coreplugin/find/searchresultwidget.h b/src/plugins/coreplugin/find/searchresultwidget.h
index e9f64b4164..88bdbaef26 100644
--- a/src/plugins/coreplugin/find/searchresultwidget.h
+++ b/src/plugins/coreplugin/find/searchresultwidget.h
@@ -70,6 +70,7 @@ public:
void setTextToReplace(const QString &textToReplace);
QString textToReplace() const;
+ void setSupportPreserveCase(bool enabled);
void setShowReplaceUI(bool visible);
bool hasFocusInternally() const;
@@ -123,6 +124,7 @@ private:
SearchResultTreeView *m_searchResultTreeView;
int m_count;
QString m_dontAskAgainGroup;
+ bool m_preserveCaseSupported;
QFrame *m_messageWidget;
Core::InfoBar m_infoBar;
Core::InfoBarDisplay m_infoBarDisplay;
diff --git a/src/plugins/coreplugin/find/searchresultwindow.cpp b/src/plugins/coreplugin/find/searchresultwindow.cpp
index dd4f87475f..4b9b3ae7a3 100644
--- a/src/plugins/coreplugin/find/searchresultwindow.cpp
+++ b/src/plugins/coreplugin/find/searchresultwindow.cpp
@@ -375,6 +375,7 @@ SearchResult *SearchResultWindow::startNewSearch(const QString &label,
const QString &toolTip,
const QString &searchTerm,
SearchMode searchOrSearchAndReplace,
+ PreserveCaseMode preserveCaseMode,
const QString &cfgGroup)
{
if (d->m_searchResults.size() >= MAX_SEARCH_HISTORY) {
@@ -395,6 +396,7 @@ SearchResult *SearchResultWindow::startNewSearch(const QString &label,
connect(widget, SIGNAL(restarted()), d, SLOT(moveWidgetToTop()));
connect(widget, SIGNAL(requestPopup(bool)), d, SLOT(popupRequested(bool)));
widget->setTextEditorFont(d->m_font, d->m_color);
+ widget->setSupportPreserveCase(preserveCaseMode == PreserveCaseEnabled);
widget->setShowReplaceUI(searchOrSearchAndReplace != SearchOnly);
widget->setAutoExpandResults(d->m_expandCollapseAction->isChecked());
widget->setInfo(label, toolTip, searchTerm);
diff --git a/src/plugins/coreplugin/find/searchresultwindow.h b/src/plugins/coreplugin/find/searchresultwindow.h
index c13b9ce32f..53febb5fb3 100644
--- a/src/plugins/coreplugin/find/searchresultwindow.h
+++ b/src/plugins/coreplugin/find/searchresultwindow.h
@@ -137,6 +137,11 @@ public:
SearchAndReplace
};
+ enum PreserveCaseMode {
+ PreserveCaseEnabled,
+ PreserveCaseDisabled
+ };
+
SearchResultWindow(QWidget *newSearchPanel);
virtual ~SearchResultWindow();
@@ -173,6 +178,7 @@ public:
const QString &toolTip,
const QString &searchTerm,
SearchMode searchOrSearchAndReplace = SearchOnly,
+ PreserveCaseMode preserveCaseMode = PreserveCaseEnabled,
const QString &cfgGroup = QString());
public slots:
diff --git a/src/plugins/coreplugin/generalsettings.ui b/src/plugins/coreplugin/generalsettings.ui
index 088111ab4d..562fa3d784 100644
--- a/src/plugins/coreplugin/generalsettings.ui
+++ b/src/plugins/coreplugin/generalsettings.ui
@@ -110,10 +110,10 @@
<item row="3" column="0">
<widget class="QPushButton" name="resetWarningsButton">
<property name="toolTip">
- <string>Re-enable all warnings which were suppressed using &quot;Don't show again&quot; button (e.g. missing highlighter).</string>
+ <string>Re-enable warnings that were suppressed by selecting &quot;Do Not Show Again&quot; (for example, missing highlighter).</string>
</property>
<property name="text">
- <string comment="Button text">Reset warnings</string>
+ <string comment="Button text">Reset Warnings</string>
</property>
</widget>
</item>
@@ -232,7 +232,7 @@
<item>
<widget class="QCheckBox" name="autoSaveCheckBox">
<property name="toolTip">
- <string>Automatically create temporary copies of modified files. If Qt Creator is restarted after a crash or power failure, it asks whether to recover the auto-saved content.</string>
+ <string>Automatically creates temporary copies of modified files. If Qt Creator is restarted after a crash or power failure, it asks whether to recover the auto-saved content.</string>
</property>
<property name="text">
<string>Auto-save modified files</string>
diff --git a/src/plugins/coreplugin/images/logo/logo.qbs b/src/plugins/coreplugin/images/logo/logo.qbs
index 47472d9bd0..09780ee514 100644
--- a/src/plugins/coreplugin/images/logo/logo.qbs
+++ b/src/plugins/coreplugin/images/logo/logo.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
Product {
condition: qbs.targetOS.contains("linux")
diff --git a/src/plugins/coreplugin/infobar.cpp b/src/plugins/coreplugin/infobar.cpp
index 20a3bb2789..cfcadaf728 100644
--- a/src/plugins/coreplugin/infobar.cpp
+++ b/src/plugins/coreplugin/infobar.cpp
@@ -235,7 +235,7 @@ void InfoBarDisplay::update()
if (info.globalSuppression == InfoBarEntry::GlobalSuppressionEnabled) {
infoWidgetSuppressButton = new QToolButton;
infoWidgetSuppressButton->setProperty("infoId", info.id.uniqueIdentifier());
- infoWidgetSuppressButton->setText(tr("Do not show again"));
+ infoWidgetSuppressButton->setText(tr("Do Not Show Again"));
connect(infoWidgetSuppressButton, SIGNAL(clicked()), SLOT(suppressButtonClicked()));
}
diff --git a/src/plugins/coreplugin/locator/executefilter.cpp b/src/plugins/coreplugin/locator/executefilter.cpp
index 5c2dc3223b..795335c806 100644
--- a/src/plugins/coreplugin/locator/executefilter.cpp
+++ b/src/plugins/coreplugin/locator/executefilter.cpp
@@ -108,7 +108,7 @@ void ExecuteFilter::accept(LocatorFilterEntry selection) const
if (m_process->state() != QProcess::NotRunning) {
const QString info(tr("Previous command is still running ('%1').\nDo you want to kill it?")
.arg(p->headCommand()));
- int r = QMessageBox::question(0, tr("Kill Previous Process?"), info,
+ int r = QMessageBox::question(ICore::dialogParent(), tr("Kill Previous Process?"), info,
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,
QMessageBox::Yes);
if (r == QMessageBox::Yes)
diff --git a/src/plugins/coreplugin/vcsmanager.cpp b/src/plugins/coreplugin/vcsmanager.cpp
index ca0376a22d..18455010da 100644
--- a/src/plugins/coreplugin/vcsmanager.cpp
+++ b/src/plugins/coreplugin/vcsmanager.cpp
@@ -382,7 +382,7 @@ bool VcsManager::promptToDelete(IVersionControl *vc, const QString &fileName)
const QString msg = tr("Would you like to remove this file from the version control system (%1)?\n"
"Note: This might remove the local file.").arg(vc->displayName());
const QMessageBox::StandardButton button =
- QMessageBox::question(0, title, msg, QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
+ QMessageBox::question(ICore::dialogParent(), title, msg, QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
if (button != QMessageBox::Yes)
return true;
return vc->vcsDelete(fileName);
diff --git a/src/plugins/cpaster/cpaster.qbs b/src/plugins/cpaster/cpaster.qbs
index 21a3f2c91c..433153b007 100644
--- a/src/plugins/cpaster/cpaster.qbs
+++ b/src/plugins/cpaster/cpaster.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/cpaster/frontend/frontend.qbs b/src/plugins/cpaster/frontend/frontend.qbs
index e425a88560..d8619be380 100644
--- a/src/plugins/cpaster/frontend/frontend.qbs
+++ b/src/plugins/cpaster/frontend/frontend.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcTool
QtcTool {
diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp
index 66b90a4f91..a82a95bcaf 100644
--- a/src/plugins/cppeditor/cppeditor.cpp
+++ b/src/plugins/cppeditor/cppeditor.cpp
@@ -963,7 +963,7 @@ void CPPEditorWidget::renameSymbolUnderCursor()
return;
CppEditorSupport *edSup = m_modelManager->cppEditorSupport(editor());
- updateSemanticInfo(edSup->recalculateSemanticInfo(/* emitSignalWhenFinished = */ false));
+ updateSemanticInfo(edSup->recalculateSemanticInfo());
abortRename();
QTextCursor c = textCursor();
@@ -1157,11 +1157,6 @@ void CPPEditorWidget::updateOutlineToolTip()
void CPPEditorWidget::updateUses()
{
- if (m_highlightWatcher) {
- m_highlightWatcher->cancel();
- m_highlightWatcher.reset();
- }
-
// Block premature semantic info calculation when editor is created.
if (m_modelManager && m_modelManager->cppEditorSupport(editor())->initialized())
m_updateUsesTimer->start();
@@ -1595,8 +1590,12 @@ bool CPPEditorWidget::openCppEditorAt(const Link &link, bool inNextSplit)
void CPPEditorWidget::semanticRehighlight(bool force)
{
- if (m_modelManager)
- m_modelManager->cppEditorSupport(editor())->recalculateSemanticInfoDetached(force);
+ if (m_modelManager) {
+ const CppEditorSupport::ForceReason forceReason = force
+ ? CppEditorSupport::ForceDueEditorRequest
+ : CppEditorSupport::NoForce;
+ m_modelManager->cppEditorSupport(editor())->recalculateSemanticInfoDetached(forceReason);
+ }
}
void CPPEditorWidget::highlighterStarted(QFuture<TextEditor::HighlightingResult> *highlighter,
diff --git a/src/plugins/cppeditor/cppeditor.qbs b/src/plugins/cppeditor/cppeditor.qbs
index 2319e75be4..b877922511 100644
--- a/src/plugins/cppeditor/cppeditor.qbs
+++ b/src/plugins/cppeditor/cppeditor.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import qbs.FileInfo
import QtcPlugin
diff --git a/src/plugins/cpptools/builtinindexingsupport.cpp b/src/plugins/cpptools/builtinindexingsupport.cpp
index 0e7542a2d7..51c3bde556 100644
--- a/src/plugins/cpptools/builtinindexingsupport.cpp
+++ b/src/plugins/cpptools/builtinindexingsupport.cpp
@@ -47,6 +47,8 @@ static void parse(QFutureInterface<void> &future,
const QString conf = CppModelManagerInterface::configurationFileName();
bool processingHeaders = false;
+ CppModelManager *cmm = CppModelManager::instance();
+ const QStringList fallbackIncludePaths = cmm->includePaths();
for (int i = 0; i < files.size(); ++i) {
if (future.isPaused())
future.waitForResume();
@@ -65,6 +67,11 @@ static void parse(QFutureInterface<void> &future,
processingHeaders = true;
}
+ QList<ProjectPart::Ptr> parts = cmm->projectPart(fileName);
+ QStringList includePaths = parts.isEmpty()
+ ? fallbackIncludePaths
+ : parts.first()->includePaths;
+ preproc->setIncludePaths(includePaths);
preproc->run(fileName);
future.setProgressValue(files.size() - preproc->todo().size());
diff --git a/src/plugins/cpptools/completionsettingspage.ui b/src/plugins/cpptools/completionsettingspage.ui
index 653ac42fc0..570cdfe88b 100644
--- a/src/plugins/cpptools/completionsettingspage.ui
+++ b/src/plugins/cpptools/completionsettingspage.ui
@@ -205,7 +205,7 @@
<item>
<widget class="QCheckBox" name="enableDoxygenCheckBox">
<property name="toolTip">
- <string>Automatically creates a Doxygen comment upon pressing enter after a /**, /*!, //! or ///</string>
+ <string>Automatically creates a Doxygen comment upon pressing enter after a '/**', '/*!', '//!' or '///'.</string>
</property>
<property name="text">
<string>Enable Doxygen blocks</string>
@@ -245,7 +245,7 @@
<item>
<widget class="QCheckBox" name="leadingAsterisksCheckBox">
<property name="toolTip">
- <string>Adds leading asterisks when continuing Qt (/*!) and Java (/**) style comments on new lines.</string>
+ <string>Adds leading asterisks when continuing Qt '/*!' and Java '/**' style comments on new lines.</string>
</property>
<property name="text">
<string>Add leading asterisks</string>
diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp
index 7b78ac901a..eb657f783b 100644
--- a/src/plugins/cpptools/cppcompletion_test.cpp
+++ b/src/plugins/cpptools/cppcompletion_test.cpp
@@ -1425,7 +1425,9 @@ void CppToolsPlugin::test_completion_data()
" @\n"
"}\n"
) << _("s.") << (QStringList()
- << QLatin1String("S"));
+ << QLatin1String("S")
+ << QLatin1String("i")
+ << QLatin1String("c"));
QTest::newRow("instantiate_template_function") << _(
"template <typename T>\n"
@@ -1439,6 +1441,65 @@ void CppToolsPlugin::test_completion_data()
<< QLatin1String("A")
<< QLatin1String("a"));
+ QTest::newRow("nested_anonymous_class_QTCREATORBUG10876_1") << _(
+ "struct EnclosingStruct\n"
+ "{\n"
+ " int memberOfEnclosingStruct;\n"
+ " struct\n"
+ " {\n"
+ " int memberNestedAnonymousClass;\n"
+ " };\n"
+ " void fun()\n"
+ " {\n"
+ " @\n"
+ " }\n"
+ "};\n"
+ ) << _("member") << (QStringList()
+ << QLatin1String("memberNestedAnonymousClass")
+ << QLatin1String("memberOfEnclosingStruct"));
+
+ QTest::newRow("nested_anonymous_class_QTCREATORBUG10876_2") << _(
+ "struct EnclosingStruct\n"
+ "{\n"
+ " int memberOfEnclosingStruct;\n"
+ " struct\n"
+ " {\n"
+ " int memberOfNestedAnonymousClass;\n"
+ " struct\n"
+ " {\n"
+ " int memberOfNestedOfNestedAnonymousClass;\n"
+ " };\n"
+ " };\n"
+ " void fun()\n"
+ " {\n"
+ " @\n"
+ " }\n"
+ "};\n"
+ ) << _("member") << (QStringList()
+ << QLatin1String("memberOfNestedAnonymousClass")
+ << QLatin1String("memberOfNestedOfNestedAnonymousClass")
+ << QLatin1String("memberOfEnclosingStruct"));
+
+ QTest::newRow("nested_anonymous_class_QTCREATORBUG10876_3") << _(
+ "struct EnclosingStruct\n"
+ "{\n"
+ " int memberOfEnclosingStruct;\n"
+ " struct\n"
+ " {\n"
+ " int memberOfNestedAnonymousClass;\n"
+ " struct\n"
+ " {\n"
+ " int memberOfNestedOfNestedAnonymousClass;\n"
+ " } nestedOfNestedAnonymousClass;\n"
+ " };\n"
+ " void fun()\n"
+ " {\n"
+ " @\n"
+ " }\n"
+ "};\n"
+ ) << _("nestedOfNestedAnonymousClass.") << (QStringList()
+ << QLatin1String("memberOfNestedOfNestedAnonymousClass"));
+
QTest::newRow("crash_cloning_template_class_QTCREATORBUG9329") << _(
"struct A {};\n"
"template <typename T>\n"
diff --git a/src/plugins/cpptools/cppcompletionassist.cpp b/src/plugins/cpptools/cppcompletionassist.cpp
index c65c0f22ef..d0eb4af103 100644
--- a/src/plugins/cpptools/cppcompletionassist.cpp
+++ b/src/plugins/cpptools/cppcompletionassist.cpp
@@ -1554,25 +1554,44 @@ void CppCompletionAssistProcessor::completeClass(CPlusPlus::ClassOrNamespace *b,
if (staticLookup)
addCompletionItem(scope, InjectedClassNameOrder); // add a completion item for the injected class name.
- for (Scope::iterator it = scope->firstMember(); it != scope->lastMember(); ++it) {
- Symbol *member = *it;
- if (member->isFriend()
- || member->isQtPropertyDeclaration()
- || member->isQtEnum()) {
- continue;
- } else if (!staticLookup && (member->isTypedef() ||
- member->isEnum() ||
- member->isClass())) {
- continue;
- }
+ addClassMembersToCompletion(scope, staticLookup);
+ }
+ }
+}
- if (member->isPublic())
- addCompletionItem(member, PublicClassMemberOrder);
- else
- addCompletionItem(member);
- }
+void CppCompletionAssistProcessor::addClassMembersToCompletion(Scope *scope, bool staticLookup)
+{
+ if (!scope)
+ return;
+
+ std::set<Class *> nestedAnonymouses;
+
+ for (Scope::iterator it = scope->firstMember(); it != scope->lastMember(); ++it) {
+ Symbol *member = *it;
+ if (member->isFriend()
+ || member->isQtPropertyDeclaration()
+ || member->isQtEnum()) {
+ continue;
+ } else if (!staticLookup && (member->isTypedef() ||
+ member->isEnum() ||
+ member->isClass())) {
+ continue;
+ } else if (member->isClass() && member->name()->isAnonymousNameId()) {
+ nestedAnonymouses.insert(member->asClass());
+ } else if (member->isDeclaration()) {
+ Class *declTypeAsClass = member->asDeclaration()->type()->asClassType();
+ if (declTypeAsClass && declTypeAsClass->name()->isAnonymousNameId())
+ nestedAnonymouses.erase(declTypeAsClass);
}
+
+ if (member->isPublic())
+ addCompletionItem(member, PublicClassMemberOrder);
+ else
+ addCompletionItem(member);
}
+ std::set<Class *>::const_iterator citEnd = nestedAnonymouses.end();
+ for (std::set<Class *>::const_iterator cit = nestedAnonymouses.begin(); cit != citEnd; ++cit)
+ addClassMembersToCompletion(*cit, staticLookup);
}
bool CppCompletionAssistProcessor::completeQtMethod(const QList<CPlusPlus::LookupItem> &results, bool wantSignals)
diff --git a/src/plugins/cpptools/cppcompletionassist.h b/src/plugins/cpptools/cppcompletionassist.h
index 0e0268b74b..ae2e45a23e 100644
--- a/src/plugins/cpptools/cppcompletionassist.h
+++ b/src/plugins/cpptools/cppcompletionassist.h
@@ -136,6 +136,7 @@ private:
bool completeScope(const QList<CPlusPlus::LookupItem> &results);
void completeNamespace(CPlusPlus::ClassOrNamespace *binding);
void completeClass(CPlusPlus::ClassOrNamespace *b, bool staticLookup = true);
+ void addClassMembersToCompletion(CPlusPlus::Scope *scope, bool staticLookup);
bool completeQtMethod(const QList<CPlusPlus::LookupItem> &results, bool wantSignals);
bool completeSignal(const QList<CPlusPlus::LookupItem> &results)
{ return completeQtMethod(results, true); }
diff --git a/src/plugins/cpptools/cppfindreferences.cpp b/src/plugins/cpptools/cppfindreferences.cpp
index 8f846a90c2..e7cbfceccb 100644
--- a/src/plugins/cpptools/cppfindreferences.cpp
+++ b/src/plugins/cpptools/cppfindreferences.cpp
@@ -330,6 +330,7 @@ void CppFindReferences::findUsages(CPlusPlus::Symbol *symbol,
overview.prettyName(context.fullyQualifiedName(symbol)),
replace ? Core::SearchResultWindow::SearchAndReplace
: Core::SearchResultWindow::SearchOnly,
+ Core::SearchResultWindow::PreserveCaseDisabled,
QLatin1String("CppEditor"));
search->setTextToReplace(replacement);
connect(search, SIGNAL(replaceButtonClicked(QString,QList<Core::SearchResultItem>,bool)),
@@ -640,6 +641,7 @@ void CppFindReferences::findMacroUses(const Macro &macro, const QString &replace
QString::fromUtf8(macro.name()),
replace ? Core::SearchResultWindow::SearchAndReplace
: Core::SearchResultWindow::SearchOnly,
+ Core::SearchResultWindow::PreserveCaseDisabled,
QLatin1String("CppEditor"));
search->setTextToReplace(replacement);
diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp
index cec5b6772c..640e8bfa07 100644
--- a/src/plugins/cpptools/cppmodelmanager.cpp
+++ b/src/plugins/cpptools/cppmodelmanager.cpp
@@ -802,6 +802,7 @@ ProjectPart::Ptr CppModelManager::projectPartForProjectFile(const QString &proje
QList<ProjectPart::Ptr> CppModelManager::projectPart(const QString &fileName) const
{
+ QMutexLocker locker(&m_projectMutex);
return m_fileToProjectParts.value(fileName);
}
diff --git a/src/plugins/cpptools/cppsemanticinfo.cpp b/src/plugins/cpptools/cppsemanticinfo.cpp
index 1607251074..09407681c3 100644
--- a/src/plugins/cpptools/cppsemanticinfo.cpp
+++ b/src/plugins/cpptools/cppsemanticinfo.cpp
@@ -32,6 +32,6 @@
using namespace CppTools;
SemanticInfo::SemanticInfo()
- : revision(0), forced(false)
+ : revision(0), forced(false), complete(true)
{
}
diff --git a/src/plugins/cpptools/cppsemanticinfo.h b/src/plugins/cpptools/cppsemanticinfo.h
index cbb1734496..c0968edb3a 100644
--- a/src/plugins/cpptools/cppsemanticinfo.h
+++ b/src/plugins/cpptools/cppsemanticinfo.h
@@ -78,7 +78,8 @@ public:
SemanticInfo();
unsigned revision;
- bool forced: 1;
+ bool forced;
+ bool complete;
CPlusPlus::Snapshot snapshot;
CPlusPlus::Document::Ptr doc;
LocalUseMap localUses;
diff --git a/src/plugins/cpptools/cpptools.qbs b/src/plugins/cpptools/cpptools.qbs
index f305a77f4d..311945755d 100644
--- a/src/plugins/cpptools/cpptools.qbs
+++ b/src/plugins/cpptools/cpptools.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import qbs.FileInfo
import QtcPlugin
diff --git a/src/plugins/cpptools/cpptoolseditorsupport.cpp b/src/plugins/cpptools/cpptoolseditorsupport.cpp
index 5af358eadf..4932b21e9a 100644
--- a/src/plugins/cpptools/cpptoolseditorsupport.cpp
+++ b/src/plugins/cpptools/cpptoolseditorsupport.cpp
@@ -120,6 +120,7 @@ CppEditorSupport::CppEditorSupport(CppModelManager *modelManager, BaseTextEditor
, m_fileIsBeingReloaded(false)
, m_initialized(false)
, m_lastHighlightRevision(0)
+ , m_lastHighlightOnCompleteSemanticInfo(true)
, m_highlightingSupport(modelManager->highlightingSupport(textEditor))
, m_completionAssistProvider(m_modelManager->completionAssistProvider(textEditor))
{
@@ -220,12 +221,12 @@ bool CppEditorSupport::initialized()
return m_initialized;
}
-SemanticInfo CppEditorSupport::recalculateSemanticInfo(bool emitSignalWhenFinished)
+SemanticInfo CppEditorSupport::recalculateSemanticInfo()
{
m_futureSemanticInfo.cancel();
SemanticInfo::Source source = currentSource(false);
- recalculateSemanticInfoNow(source, emitSignalWhenFinished);
+ recalculateSemanticInfoNow(source, /*emitSignalWhenFinished=*/ false);
return m_lastSemanticInfo;
}
@@ -236,7 +237,7 @@ Document::Ptr CppEditorSupport::lastSemanticInfoDocument() const
return m_lastSemanticInfo.doc;
}
-void CppEditorSupport::recalculateSemanticInfoDetached(bool force)
+void CppEditorSupport::recalculateSemanticInfoDetached(ForceReason forceReason)
{
// Block premature calculation caused by CppEditorPlugin::currentEditorChanged
// when the editor is created.
@@ -244,12 +245,13 @@ void CppEditorSupport::recalculateSemanticInfoDetached(bool force)
return;
m_futureSemanticInfo.cancel();
+ const bool force = forceReason != NoForce;
SemanticInfo::Source source = currentSource(force);
m_futureSemanticInfo = QtConcurrent::run<CppEditorSupport, void>(
&CppEditorSupport::recalculateSemanticInfoDetached_helper, this, source);
if (force && m_highlightingSupport && !m_highlightingSupport->requiresSemanticInfo())
- startHighlighting();
+ startHighlighting(forceReason);
}
CppCompletionAssistProvider *CppEditorSupport::completionAssistProvider() const
@@ -351,14 +353,14 @@ void CppEditorSupport::onDocumentUpdated(Document::Ptr doc)
|| m_lastSemanticInfo.doc->translationUnit()->ast() == 0
|| m_lastSemanticInfo.doc->fileName() != fileName()))) {
m_initialized = true;
- recalculateSemanticInfoDetached(/* force = */ true);
+ recalculateSemanticInfoDetached(ForceDueToMissingSemanticInfo);
}
// notify the editor that the document is updated
emit documentUpdated();
}
-void CppEditorSupport::startHighlighting()
+void CppEditorSupport::startHighlighting(ForceReason forceReason)
{
if (!m_highlightingSupport)
return;
@@ -368,6 +370,7 @@ void CppEditorSupport::startHighlighting()
Document::Ptr doc;
unsigned revision;
bool forced;
+ bool complete;
{
QMutexLocker locker(&m_lastSemanticInfoLock);
@@ -375,26 +378,33 @@ void CppEditorSupport::startHighlighting()
doc = m_lastSemanticInfo.doc;
revision = m_lastSemanticInfo.revision;
forced = m_lastSemanticInfo.forced;
+ complete = m_lastSemanticInfo.complete;
}
if (doc.isNull())
return;
+
+ if (!m_lastHighlightOnCompleteSemanticInfo)
+ forced = true;
+
if (!forced && m_lastHighlightRevision == revision)
return;
- m_highlighter.cancel();
+ m_highlighter.cancel();
m_highlighter = m_highlightingSupport->highlightingFuture(doc, snapshot);
m_lastHighlightRevision = revision;
+ m_lastHighlightOnCompleteSemanticInfo = complete;
emit highlighterStarted(&m_highlighter, m_lastHighlightRevision);
} else {
- const unsigned revision = currentSource(false).revision;
- if (m_lastHighlightRevision == revision)
+ const unsigned revision = editorRevision();
+ if (forceReason != ForceDueEditorRequest && m_lastHighlightRevision == revision)
return;
- m_lastHighlightRevision = revision;
+ m_highlighter.cancel();
static const Document::Ptr dummyDoc;
static const Snapshot dummySnapshot;
m_highlighter = m_highlightingSupport->highlightingFuture(dummyDoc, dummySnapshot);
+ m_lastHighlightRevision = revision;
emit highlighterStarted(&m_highlighter, m_lastHighlightRevision);
}
}
@@ -500,6 +510,7 @@ void CppEditorSupport::releaseResources()
snapshotUpdater()->releaseSnapshot();
QMutexLocker semanticLocker(&m_lastSemanticInfoLock);
m_lastSemanticInfo = SemanticInfo();
+ m_lastHighlightOnCompleteSemanticInfo = true;
}
SemanticInfo::Source CppEditorSupport::currentSource(bool force)
@@ -520,7 +531,7 @@ SemanticInfo::Source CppEditorSupport::currentSource(bool force)
void CppEditorSupport::recalculateSemanticInfoNow(const SemanticInfo::Source &source,
bool emitSignalWhenFinished,
- TopLevelDeclarationProcessor *processor)
+ FuturizedTopLevelDeclarationProcessor *processor)
{
SemanticInfo semanticInfo;
@@ -546,6 +557,8 @@ void CppEditorSupport::recalculateSemanticInfoNow(const SemanticInfo::Source &so
if (processor)
doc->control()->setTopLevelDeclarationProcessor(processor);
doc->check();
+ if (processor && processor->isCanceled())
+ semanticInfo.complete = false;
semanticInfo.doc = doc;
} else {
return;
@@ -575,21 +588,8 @@ void CppEditorSupport::recalculateSemanticInfoNow(const SemanticInfo::Source &so
void CppEditorSupport::recalculateSemanticInfoDetached_helper(QFutureInterface<void> &future, SemanticInfo::Source source)
{
- class TLDProc: public TopLevelDeclarationProcessor
- {
- QFutureInterface<void> m_theFuture;
-
- public:
- TLDProc(QFutureInterface<void> &aFuture): m_theFuture(aFuture) {}
- virtual ~TLDProc() {}
- virtual bool processDeclaration(DeclarationAST *ast) {
- Q_UNUSED(ast);
- return m_theFuture.isCanceled();
- }
- };
-
- TLDProc tldProc(future);
- recalculateSemanticInfoNow(source, true, &tldProc);
+ FuturizedTopLevelDeclarationProcessor processor(future);
+ recalculateSemanticInfoNow(source, true, &processor);
}
void CppEditorSupport::onMimeTypeChanged()
diff --git a/src/plugins/cpptools/cpptoolseditorsupport.h b/src/plugins/cpptools/cpptoolseditorsupport.h
index f9ba876256..29cfb508e0 100644
--- a/src/plugins/cpptools/cpptoolseditorsupport.h
+++ b/src/plugins/cpptools/cpptoolseditorsupport.h
@@ -35,6 +35,7 @@
#include "cppsemanticinfo.h"
#include "cppsnapshotupdater.h"
+#include <cplusplus/Control.h>
#include <cplusplus/CppDocument.h>
#include <QFuture>
@@ -43,7 +44,10 @@
#include <QSharedPointer>
#include <QTimer>
-namespace CPlusPlus { class AST; }
+namespace CPlusPlus {
+class AST;
+class DeclarationAST;
+} // namespace CPlusPlus
namespace TextEditor {
class BaseTextEditor;
@@ -110,16 +114,22 @@ public:
bool initialized();
/// Retrieve the semantic info, which will get recalculated on the current
- /// thread if it is outdate.
- SemanticInfo recalculateSemanticInfo(bool emitSignalWhenFinished = true);
+ /// thread if it is outdate. Will not emit the semanticInfoUpdated() signal.
+ SemanticInfo recalculateSemanticInfo();
CPlusPlus::Document::Ptr lastSemanticInfoDocument() const;
+ enum ForceReason {
+ NoForce,
+ ForceDueToMissingSemanticInfo,
+ ForceDueEditorRequest
+ };
+
/// Recalculates the semantic info in a future, and will emit the
/// semanticInfoUpdated() signal when finished.
/// Requires that initialized() is true.
- /// \param force do not check if the old semantic info is still valid
- void recalculateSemanticInfoDetached(bool force = false);
+ /// \param forceReason the reason to force, if any
+ void recalculateSemanticInfoDetached(ForceReason forceReason);
CppCompletionAssistProvider *completionAssistProvider() const;
@@ -144,7 +154,7 @@ private slots:
void updateDocumentNow();
void onDocumentUpdated(CPlusPlus::Document::Ptr doc);
- void startHighlighting();
+ void startHighlighting(ForceReason forceReason = NoForce);
void onDiagnosticsChanged();
@@ -171,9 +181,19 @@ private:
};
private:
+ class FuturizedTopLevelDeclarationProcessor: public CPlusPlus::TopLevelDeclarationProcessor
+ {
+ public:
+ FuturizedTopLevelDeclarationProcessor(QFutureInterface<void> &future): m_future(future) {}
+ bool processDeclaration(CPlusPlus::DeclarationAST *) { return !isCanceled(); }
+ bool isCanceled() { return m_future.isCanceled(); }
+ private:
+ QFutureInterface<void> m_future;
+ };
+
SemanticInfo::Source currentSource(bool force);
void recalculateSemanticInfoNow(const SemanticInfo::Source &source, bool emitSignalWhenFinished,
- CPlusPlus::TopLevelDeclarationProcessor *processor = 0);
+ FuturizedTopLevelDeclarationProcessor *processor = 0);
void recalculateSemanticInfoDetached_helper(QFutureInterface<void> &future,
SemanticInfo::Source source);
@@ -209,6 +229,7 @@ private:
// Highlighting:
unsigned m_lastHighlightRevision;
+ bool m_lastHighlightOnCompleteSemanticInfo;
QFuture<TextEditor::HighlightingResult> m_highlighter;
QScopedPointer<CppTools::CppHighlightingSupport> m_highlightingSupport;
diff --git a/src/plugins/cvs/cvs.qbs b/src/plugins/cvs/cvs.qbs
index 90b0e46951..8d4dfc564d 100644
--- a/src/plugins/cvs/cvs.qbs
+++ b/src/plugins/cvs/cvs.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/cvs/cvsplugin.cpp b/src/plugins/cvs/cvsplugin.cpp
index 7dacfd0631..af1d5d2728 100644
--- a/src/plugins/cvs/cvsplugin.cpp
+++ b/src/plugins/cvs/cvsplugin.cpp
@@ -151,9 +151,9 @@ static inline QString debugCodec(const QTextCodec *c)
return c ? QString::fromLatin1(c->name()) : QString::fromLatin1("Null codec");
}
-static inline bool messageBoxQuestion(const QString &title, const QString &question, QWidget *parent = 0)
+static inline bool messageBoxQuestion(const QString &title, const QString &question)
{
- return QMessageBox::question(parent, title, question, QMessageBox::Yes|QMessageBox::No) == QMessageBox::Yes;
+ return QMessageBox::question(ICore::dialogParent(), title, question, QMessageBox::Yes|QMessageBox::No) == QMessageBox::Yes;
}
// ------------- CVSPlugin
@@ -579,7 +579,8 @@ void CvsPlugin::revertAll()
if (revertResponse.result == CvsResponse::Ok)
cvsVersionControl()->emitRepositoryChanged(state.topLevel());
else
- QMessageBox::warning(0, title, tr("Revert failed: %1").arg(revertResponse.message), QMessageBox::Ok);
+ QMessageBox::warning(ICore::dialogParent(), title,
+ tr("Revert failed: %1").arg(revertResponse.message), QMessageBox::Ok);
}
void CvsPlugin::revertCurrentFile()
diff --git a/src/plugins/debugger/cdb/cdboptionspagewidget.ui b/src/plugins/debugger/cdb/cdboptionspagewidget.ui
index 7221f342e4..457123277f 100644
--- a/src/plugins/debugger/cdb/cdboptionspagewidget.ui
+++ b/src/plugins/debugger/cdb/cdboptionspagewidget.ui
@@ -44,7 +44,7 @@
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="consoleCheckBox">
<property name="toolTip">
- <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Use CDB's native console instead of Qt Creator's console for console applications. The native console does not prompt on application exit. It is suitable for diagnosing cases in which the application does not start up properly in Qt Creator's console and the subsequent attach fails.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Uses CDB's native console instead of Qt Creator's console for console applications. The native console does not prompt on application exit. It is suitable for diagnosing cases in which the application does not start up properly in Qt Creator's console and the subsequent attach fails.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Use CDB &amp;console</string>
@@ -82,7 +82,7 @@
<item>
<widget class="QCheckBox" name="breakpointCorrectionCheckBox">
<property name="toolTip">
- <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Attempt to correct the location of a breakpoint based on file and line number should it be in a comment or in a line for which no code is generated. The correction is based on the code model.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Attempts to correct the location of a breakpoint based on file and line number should it be in a comment or in a line for which no code is generated. The correction is based on the code model.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Correct breakpoint location</string>
diff --git a/src/plugins/debugger/commonoptionspage.cpp b/src/plugins/debugger/commonoptionspage.cpp
index bd4fe189e3..93e7586bf2 100644
--- a/src/plugins/debugger/commonoptionspage.cpp
+++ b/src/plugins/debugger/commonoptionspage.cpp
@@ -58,14 +58,14 @@ CommonOptionsPageWidget::CommonOptionsPageWidget
checkBoxUseAlternatingRowColors->setText(tr("Use alternating row colors in debug views"));
checkBoxFontSizeFollowsEditor = new QCheckBox(behaviorBox);
- checkBoxFontSizeFollowsEditor->setToolTip(tr("Change the font size in the debugger views when the font size in the main editor changes."));
+ checkBoxFontSizeFollowsEditor->setToolTip(tr("Changes the font size in the debugger views when the font size in the main editor changes."));
checkBoxFontSizeFollowsEditor->setText(tr("Debugger font size follows main editor"));
checkBoxUseToolTipsInMainEditor = new QCheckBox(behaviorBox);
checkBoxUseToolTipsInMainEditor->setText(tr("Use tooltips in main editor while debugging"));
checkBoxListSourceFiles = new QCheckBox(behaviorBox);
- checkBoxListSourceFiles->setToolTip(tr("Populate the source file view automatically. This might slow down debugger startup considerably."));
+ checkBoxListSourceFiles->setToolTip(tr("Populates the source file view automatically. This might slow down debugger startup considerably."));
checkBoxListSourceFiles->setText(tr("Populate source file view automatically"));
checkBoxCloseBuffersOnExit = new QCheckBox(behaviorBox);
@@ -82,20 +82,20 @@ CommonOptionsPageWidget::CommonOptionsPageWidget
checkBoxBringToForegroundOnInterrrupt->setText(tr("Bring Qt Creator to foreground when application interrupts"));
checkBoxShowQmlObjectTree = new QCheckBox(behaviorBox);
- checkBoxShowQmlObjectTree->setToolTip(tr("Show QML object tree in Locals & Expressions when connected and not stepping."));
+ checkBoxShowQmlObjectTree->setToolTip(tr("Shows QML object tree in Locals & Expressions when connected and not stepping."));
checkBoxShowQmlObjectTree->setText(tr("Show QML object tree"));
checkBoxBreakpointsFullPath = new QCheckBox(behaviorBox);
- checkBoxBreakpointsFullPath->setToolTip(tr("Enable a full file path in breakpoints by default also for GDB."));
+ checkBoxBreakpointsFullPath->setToolTip(tr("Enables a full file path in breakpoints by default also for GDB."));
checkBoxBreakpointsFullPath->setText(tr("Set breakpoints using a full absolute path"));
checkBoxRegisterForPostMortem = new QCheckBox(behaviorBox);
- checkBoxRegisterForPostMortem->setToolTip(tr("Register Qt Creator for debugging crashed applications."));
+ checkBoxRegisterForPostMortem->setToolTip(tr("Registers Qt Creator for debugging crashed applications."));
checkBoxRegisterForPostMortem->setText(tr("Use Qt Creator for post-mortem debugging"));
checkBoxWarnOnReleaseBuilds = new QCheckBox(behaviorBox);
checkBoxWarnOnReleaseBuilds->setText(tr("Warn when debugging \"Release\" builds"));
- checkBoxWarnOnReleaseBuilds->setToolTip(tr("Show a warning when starting the debugger "
+ checkBoxWarnOnReleaseBuilds->setToolTip(tr("Shows a warning when starting the debugger "
"on a binary with insufficient debug information."));
labelMaximalStackDepth = new QLabel(tr("Maximum stack depth:"), behaviorBox);
diff --git a/src/plugins/debugger/debugger.qbs b/src/plugins/debugger/debugger.qbs
index d8b66490a7..4cd091e42b 100644
--- a/src/plugins/debugger/debugger.qbs
+++ b/src/plugins/debugger/debugger.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index b4160c8375..2b381184b4 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -1739,7 +1739,7 @@ DebuggerRunControl *DebuggerPluginPrivate::attachToRunningProcess(Kit *kit,
if (device->type() != PE::DESKTOP_DEVICE_TYPE) {
QMessageBox::warning(ICore::mainWindow(), tr("Not a Desktop Device Type"),
- tr("It is only possible to attach to local running process."));
+ tr("It is only possible to attach to a locally running process."));
return 0;
}
diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp
index 91bd58cc1c..781602ddf0 100644
--- a/src/plugins/debugger/debuggerrunner.cpp
+++ b/src/plugins/debugger/debuggerrunner.cpp
@@ -193,26 +193,28 @@ void DebuggerRunControl::start()
}
if (d->m_engine->startParameters().startMode == StartInternal) {
+ QStringList unhandledIds;
foreach (const BreakpointModelId &id, debuggerCore()->breakHandler()->allBreakpointIds()) {
if (d->m_engine->breakHandler()->breakpointData(id).enabled
- && !d->m_engine->acceptsBreakpoint(id)) {
-
- QString warningMessage =
- DebuggerPlugin::tr("Some breakpoints cannot be handled by the debugger "
- "languages currently active, and will be ignored.");
+ && !d->m_engine->acceptsBreakpoint(id))
+ unhandledIds.append(id.toString());
+ }
+ if (!unhandledIds.isEmpty()) {
+ QString warningMessage =
+ DebuggerPlugin::tr("Some breakpoints cannot be handled by the debugger "
+ "languages currently active, and will be ignored.\n"
+ "Affected are breakpoints %1")
+ .arg(unhandledIds.join(QLatin1String(", ")));
- debuggerCore()->showMessage(warningMessage, LogWarning);
+ debuggerCore()->showMessage(warningMessage, LogWarning);
- static bool checked = true;
- if (!checked)
- break;
+ static bool checked = true;
+ if (checked)
CheckableMessageBox::information(Core::ICore::mainWindow(),
tr("Debugger"),
warningMessage,
tr("&Show this message again."),
&checked, QDialogButtonBox::Ok);
- break;
- }
}
}
diff --git a/src/plugins/debugger/gdb/gdboptionspage.cpp b/src/plugins/debugger/gdb/gdboptionspage.cpp
index 719778a743..5836ecf302 100644
--- a/src/plugins/debugger/gdb/gdboptionspage.cpp
+++ b/src/plugins/debugger/gdb/gdboptionspage.cpp
@@ -152,7 +152,7 @@ GdbOptionsPageWidget::GdbOptionsPageWidget(QWidget *parent)
checkBoxLoadGdbDumpers->setText(GdbOptionsPage::tr("Load system GDB pretty printers"));
checkBoxLoadGdbDumpers->setToolTip(GdbOptionsPage::tr(
"Uses the default GDB pretty printers installed in your "
- "system or linked to the libraries your application uses.\n"));
+ "system or linked to the libraries your application uses."));
checkBoxIntelFlavor = new QCheckBox(groupBoxGeneral);
checkBoxIntelFlavor->setText(GdbOptionsPage::tr("Use Intel style disassembly"));
diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp
index d2bad378b1..ad61ccacf8 100644
--- a/src/plugins/debugger/lldb/lldbengine.cpp
+++ b/src/plugins/debugger/lldb/lldbengine.cpp
@@ -108,7 +108,7 @@ LldbEngine::LldbEngine(const DebuggerStartParameters &startParameters)
connect(debuggerCore()->action(AutoDerefPointers), SIGNAL(valueChanged(QVariant)),
SLOT(updateLocals()));
connect(debuggerCore()->action(CreateFullBacktrace), SIGNAL(triggered()),
- SLOT(updateAll()));
+ SLOT(createFullBacktrace()));
connect(debuggerCore()->action(UseDebuggingHelpers), SIGNAL(valueChanged(QVariant)),
SLOT(updateLocals()));
connect(debuggerCore()->action(UseDynamicType), SIGNAL(valueChanged(QVariant)),
@@ -320,7 +320,6 @@ void LldbEngine::setupInferior()
}
runCommand(cmd);
- updateLocals(); // update display options
}
void LldbEngine::runEngine()
@@ -433,6 +432,8 @@ void LldbEngine::handleResponse(const QByteArray &response)
refreshMemory(item);
else if (name == "continuation")
runContinuation(item);
+ else if (name == "full-backtrace")
+ showFullBacktrace(item);
else if (name == "statusmessage") {
QString msg = QString::fromUtf8(item.data());
if (msg.size())
@@ -442,6 +443,12 @@ void LldbEngine::handleResponse(const QByteArray &response)
}
}
+void LldbEngine::showFullBacktrace(const GdbMi &data)
+{
+ debuggerCore()->openTextEditor(_("Backtrace $"),
+ QString::fromUtf8(QByteArray::fromHex(data.data())));
+}
+
void LldbEngine::runContinuation(const GdbMi &data)
{
const QByteArray target = data.data();
@@ -493,6 +500,8 @@ void LldbEngine::activateFrame(int frameIndex)
cmd.arg("thread", threadsHandler()->currentThread().raw());
cmd.arg("stacklimit", limit);
runCommand(cmd);
+
+ updateAll();
}
void LldbEngine::selectThread(ThreadId threadId)
@@ -872,6 +881,7 @@ bool LldbEngine::setToolTipExpression(const QPoint &mousePos,
void LldbEngine::updateAll()
{
+ reloadRegisters();
updateLocals();
}
@@ -1181,6 +1191,8 @@ void LldbEngine::refreshState(const GdbMi &reportedState)
if (m_continueAtNextSpontaneousStop) {
m_continueAtNextSpontaneousStop = false;
continueInferior();
+ } else {
+ updateAll();
}
} else if (newState == "inferiorstopok")
notifyInferiorStopOk();
@@ -1248,6 +1260,10 @@ void LldbEngine::fetchDisassembler(DisassemblerAgent *agent)
runCommand(cmd);
}
+void LldbEngine::createFullBacktrace()
+{
+ runCommand("createFullBacktrace");
+}
void LldbEngine::fetchMemory(MemoryAgent *agent, QObject *editorToken,
quint64 addr, quint64 length)
diff --git a/src/plugins/debugger/lldb/lldbengine.h b/src/plugins/debugger/lldb/lldbengine.h
index df6c132ed1..f8ba142094 100644
--- a/src/plugins/debugger/lldb/lldbengine.h
+++ b/src/plugins/debugger/lldb/lldbengine.h
@@ -162,6 +162,7 @@ private:
Q_SLOT void runEngine2();
Q_SLOT void updateAll();
Q_SLOT void updateLocals();
+ Q_SLOT void createFullBacktrace();
void doUpdateLocals(UpdateParameters params);
void refreshAll(const GdbMi &all);
void refreshThreads(const GdbMi &threads);
@@ -181,10 +182,10 @@ private:
void refreshChangedBreakpoint(const GdbMi &bkpts);
void refreshRemovedBreakpoint(const GdbMi &bkpts);
void runContinuation(const GdbMi &data);
+ void showFullBacktrace(const GdbMi &data);
typedef void (LldbEngine::*LldbCommandContinuation)();
- void handleStop(const QByteArray &response);
void handleListLocals(const QByteArray &response);
void handleListModules(const QByteArray &response);
void handleListSymbols(const QByteArray &response);
diff --git a/src/plugins/debugger/ptracepreload.qbs b/src/plugins/debugger/ptracepreload.qbs
index 0f31a6c55d..90a323d4d5 100644
--- a/src/plugins/debugger/ptracepreload.qbs
+++ b/src/plugins/debugger/ptracepreload.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcLibrary
QtcLibrary {
diff --git a/src/plugins/designer/designer.qbs b/src/plugins/designer/designer.qbs
index af9c273c7b..7e1460b7d7 100644
--- a/src/plugins/designer/designer.qbs
+++ b/src/plugins/designer/designer.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import qbs.FileInfo
import QtcPlugin
diff --git a/src/plugins/designer/formeditorfactory.cpp b/src/plugins/designer/formeditorfactory.cpp
index a005946fe3..cc43bfaf02 100644
--- a/src/plugins/designer/formeditorfactory.cpp
+++ b/src/plugins/designer/formeditorfactory.cpp
@@ -63,7 +63,7 @@ Core::IEditor *FormEditorFactory::createEditor()
if (data.formWindowEditor) {
Core::InfoBarEntry info(Core::Id(Constants::INFO_READ_ONLY),
tr("This file can only be edited in <b>Design</b> mode."));
- info.setCustomButtonInfo(tr("Switch mode"), this, SLOT(designerModeClicked()));
+ info.setCustomButtonInfo(tr("Switch Mode"), this, SLOT(designerModeClicked()));
data.formWindowEditor->document()->infoBar()->addInfo(info);
}
return data.formWindowEditor;
diff --git a/src/plugins/diffeditor/diffeditor.qbs b/src/plugins/diffeditor/diffeditor.qbs
index 3ea42e4b79..e561e1cd9c 100644
--- a/src/plugins/diffeditor/diffeditor.qbs
+++ b/src/plugins/diffeditor/diffeditor.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/diffeditor/diffeditorplugin.cpp b/src/plugins/diffeditor/diffeditorplugin.cpp
index 7cd49c5680..1a9f5c2bc7 100644
--- a/src/plugins/diffeditor/diffeditorplugin.cpp
+++ b/src/plugins/diffeditor/diffeditorplugin.cpp
@@ -133,15 +133,4 @@ QString DiffEditorPlugin::getFileContents(const QString &fileName) const
} // namespace Internal
} // namespace DiffEditor
-#ifdef WITH_TESTS
-
-#include "sidebysidediffeditorwidget.h"
-
-void DiffEditor::Internal::DiffEditorPlugin::testFixPositions()
-{
- SideBySideDiffEditorWidget::testFixPositions();
-}
-
-#endif // WITH_TESTS
-
Q_EXPORT_PLUGIN(DiffEditor::Internal::DiffEditorPlugin)
diff --git a/src/plugins/diffeditor/diffeditorplugin.h b/src/plugins/diffeditor/diffeditorplugin.h
index 703c97496f..ba347213af 100644
--- a/src/plugins/diffeditor/diffeditorplugin.h
+++ b/src/plugins/diffeditor/diffeditorplugin.h
@@ -53,10 +53,6 @@ public:
private slots:
void diff();
-#ifdef WITH_TESTS
- void testFixPositions();
-#endif // WITH_TESTS
-
private:
QString getFileContents(const QString &fileName) const;
diff --git a/src/plugins/diffeditor/diffutils.cpp b/src/plugins/diffeditor/diffutils.cpp
index a967fb9e86..ed15a283d3 100644
--- a/src/plugins/diffeditor/diffutils.cpp
+++ b/src/plugins/diffeditor/diffutils.cpp
@@ -35,7 +35,7 @@
namespace DiffEditor {
namespace Internal {
-static QList<TextLineData> assemblyRows(const QStringList &lines,
+static QList<TextLineData> assemblyRows(const QList<TextLineData> &lines,
const QMap<int, int> &lineSpans)
{
QList<TextLineData> data;
@@ -50,49 +50,51 @@ static QList<TextLineData> assemblyRows(const QStringList &lines,
return data;
}
-static bool lastLinesEqual(const QStringList &leftLines,
- const QStringList &rightLines)
+static bool lastLinesEqual(const QList<TextLineData> &leftLines,
+ const QList<TextLineData> &rightLines)
{
const bool leftLineEqual = leftLines.count()
- ? leftLines.last().isEmpty()
+ ? leftLines.last().text.isEmpty()
: true;
const bool rightLineEqual = rightLines.count()
- ? rightLines.last().isEmpty()
+ ? rightLines.last().text.isEmpty()
: true;
return leftLineEqual && rightLineEqual;
}
static void handleLine(const QStringList &newLines,
int line,
- QStringList *lines,
- int *lineNumber,
- int *charNumber)
+ QList<TextLineData> *lines,
+ int *lineNumber)
{
if (line < newLines.count()) {
const QString text = newLines.at(line);
if (lines->isEmpty() || line > 0) {
if (line > 0)
++*lineNumber;
- lines->append(text);
+ lines->append(TextLineData(text));
} else {
- lines->last() += text;
+ lines->last().text += text;
}
- *charNumber += text.count();
}
}
static void handleDifference(const QString &text,
- QStringList *lines,
- QMap<int, int> *changedPositions,
- int *lineNumber,
- int *charNumber)
+ QList<TextLineData> *lines,
+ int *lineNumber)
{
- const int oldPosition = *lineNumber + *charNumber;
- const QStringList newLeftLines = text.split(QLatin1Char('\n'));
- for (int line = 0; line < newLeftLines.count(); ++line)
- handleLine(newLeftLines, line, lines, lineNumber, charNumber);
- const int newPosition = *lineNumber + *charNumber;
- changedPositions->insert(oldPosition, newPosition);
+ const QStringList newLines = text.split(QLatin1Char('\n'));
+ for (int line = 0; line < newLines.count(); ++line) {
+ const int startPos = line > 0
+ ? -1
+ : lines->isEmpty() ? 0 : lines->last().text.count();
+ handleLine(newLines, line, lines, lineNumber);
+ const int endPos = line < newLines.count() - 1
+ ? -1
+ : lines->isEmpty() ? 0 : lines->last().text.count();
+ if (!lines->isEmpty())
+ lines->last().changedPositions.insert(startPos, endPos);
+ }
}
/*
@@ -108,8 +110,8 @@ ChunkData calculateOriginalData(const QList<Diff> &leftDiffList,
int i = 0;
int j = 0;
- QStringList leftLines;
- QStringList rightLines;
+ QList<TextLineData> leftLines;
+ QList<TextLineData> rightLines;
// <line number, span count>
QMap<int, int> leftSpans;
@@ -119,8 +121,6 @@ ChunkData calculateOriginalData(const QList<Diff> &leftDiffList,
int leftLineNumber = 0;
int rightLineNumber = 0;
- int leftCharNumber = 0;
- int rightCharNumber = 0;
int leftLineAligned = -1;
int rightLineAligned = -1;
bool lastLineEqual = true;
@@ -135,13 +135,13 @@ ChunkData calculateOriginalData(const QList<Diff> &leftDiffList,
if (leftDiff.command == Diff::Delete) {
// process delete
- handleDifference(leftDiff.text, &leftLines, &chunkData.changedLeftPositions, &leftLineNumber, &leftCharNumber);
+ handleDifference(leftDiff.text, &leftLines, &leftLineNumber);
lastLineEqual = lastLinesEqual(leftLines, rightLines);
i++;
}
if (rightDiff.command == Diff::Insert) {
// process insert
- handleDifference(rightDiff.text, &rightLines, &chunkData.changedRightPositions, &rightLineNumber, &rightCharNumber);
+ handleDifference(rightDiff.text, &rightLines, &rightLineNumber);
lastLineEqual = lastLinesEqual(leftLines, rightLines);
j++;
}
@@ -153,8 +153,8 @@ ChunkData calculateOriginalData(const QList<Diff> &leftDiffList,
int line = 0;
while (line < qMax(newLeftLines.count(), newRightLines.count())) {
- handleLine(newLeftLines, line, &leftLines, &leftLineNumber, &leftCharNumber);
- handleLine(newRightLines, line, &rightLines, &rightLineNumber, &rightCharNumber);
+ handleLine(newLeftLines, line, &leftLines, &leftLineNumber);
+ handleLine(newRightLines, line, &rightLines, &rightLineNumber);
const int commonLineCount = qMin(newLeftLines.count(), newRightLines.count());
if (line < commonLineCount) {
@@ -172,7 +172,7 @@ ChunkData calculateOriginalData(const QList<Diff> &leftDiffList,
if (line == commonLineCount - 1) {
// omit alignment when last lines of equalities are empty
- if (leftLines.last().isEmpty() || rightLines.last().isEmpty())
+ if (leftLines.last().text.isEmpty() || rightLines.last().text.isEmpty())
doAlign = false;
// unless it's the last dummy line (don't omit in that case)
@@ -283,72 +283,41 @@ FileData calculateContextData(const ChunkData &originalData, int contextLinesNum
}
}
i = 0;
- int leftCharCounter = 0;
- int rightCharCounter = 0;
- QMap<int, int>::ConstIterator leftChangedIt = originalData.changedLeftPositions.constBegin();
- QMap<int, int>::ConstIterator rightChangedIt = originalData.changedRightPositions.constBegin();
- const QMap<int, int>::ConstIterator leftChangedItEnd = originalData.changedLeftPositions.constEnd();
- const QMap<int, int>::ConstIterator rightChangedItEnd = originalData.changedRightPositions.constEnd();
while (i < originalData.rows.count()) {
- if (!hiddenRows.contains(i)) {
- ChunkData chunkData;
- int leftOffset = leftCharCounter;
- int rightOffset = rightCharCounter;
- chunkData.contextChunk = false;
- while (i < originalData.rows.count()) {
- if (hiddenRows.contains(i))
- break;
- RowData rowData = originalData.rows.at(i);
- chunkData.rows.append(rowData);
-
- if (rowData.leftLine.textLineType == TextLineData::TextLine)
- leftCharCounter += rowData.leftLine.text.count() + 1; // +1 for '\n'
- if (rowData.rightLine.textLineType == TextLineData::TextLine)
- rightCharCounter += rowData.rightLine.text.count() + 1; // +1 for '\n'
- i++;
- }
- while (leftChangedIt != leftChangedItEnd) {
- if (leftChangedIt.key() < leftOffset
- || leftChangedIt.key() > leftCharCounter)
- break;
-
- const int startPos = leftChangedIt.key();
- const int endPos = leftChangedIt.value();
- chunkData.changedLeftPositions.insert(startPos - leftOffset, endPos - leftOffset);
- leftChangedIt++;
- }
- while (rightChangedIt != rightChangedItEnd) {
- if (rightChangedIt.key() < rightOffset
- || rightChangedIt.key() > rightCharCounter)
- break;
-
- const int startPos = rightChangedIt.key();
- const int endPos = rightChangedIt.value();
- chunkData.changedRightPositions.insert(startPos - rightOffset, endPos - rightOffset);
- rightChangedIt++;
- }
- fileData.chunks.append(chunkData);
- } else {
- ChunkData chunkData;
- chunkData.contextChunk = true;
- while (i < originalData.rows.count()) {
- if (!hiddenRows.contains(i))
- break;
- RowData rowData = originalData.rows.at(i);
- chunkData.rows.append(rowData);
-
- if (rowData.leftLine.textLineType == TextLineData::TextLine)
- leftCharCounter += rowData.leftLine.text.count() + 1; // +1 for '\n'
- if (rowData.rightLine.textLineType == TextLineData::TextLine)
- rightCharCounter += rowData.rightLine.text.count() + 1; // +1 for '\n'
- i++;
- }
- fileData.chunks.append(chunkData);
+ const bool contextChunk = hiddenRows.contains(i);
+ ChunkData chunkData;
+ chunkData.contextChunk = contextChunk;
+ while (i < originalData.rows.count()) {
+ if (contextChunk != hiddenRows.contains(i))
+ break;
+ RowData rowData = originalData.rows.at(i);
+ chunkData.rows.append(rowData);
+ ++i;
}
+ fileData.chunks.append(chunkData);
}
+
return fileData;
}
+void addChangedPositions(int positionOffset, const QMap<int, int> &originalChangedPositions, QMap<int, int> *changedPositions)
+{
+ QMapIterator<int, int> it(originalChangedPositions);
+ while (it.hasNext()) {
+ it.next();
+ const int startPos = it.key();
+ const int endPos = it.value();
+ const int newStartPos = startPos < 0 ? -1 : startPos + positionOffset;
+ const int newEndPos = endPos < 0 ? -1 : endPos + positionOffset;
+ if (startPos < 0 && !changedPositions->isEmpty()) {
+ QMap<int, int>::iterator last = changedPositions->end();
+ --last;
+ last.value() = newEndPos;
+ } else
+ changedPositions->insert(newStartPos, newEndPos);
+ }
+}
+
QList<QTextEdit::ExtraSelection> colorPositions(
const QTextCharFormat &format,
QTextCursor &cursor,
diff --git a/src/plugins/diffeditor/diffutils.h b/src/plugins/diffeditor/diffutils.h
index aedcd891fd..75102c7406 100644
--- a/src/plugins/diffeditor/diffutils.h
+++ b/src/plugins/diffeditor/diffutils.h
@@ -57,6 +57,13 @@ public:
TextLineData(TextLineType t) : textLineType(t) {}
TextLineType textLineType;
QString text;
+ /*
+ * <start position, end position>
+ * <-1, n> means this is a continuation from the previous line
+ * <n, -1> means this will be continued in the next line
+ * <-1, -1> the whole line is a continuation (from the previous line to the next line)
+ */
+ QMap<int, int> changedPositions; // counting from the beginning of the line
};
class RowData {
@@ -76,9 +83,6 @@ public:
ChunkData() : contextChunk(false) {}
QList<RowData> rows;
bool contextChunk;
- // start position, end position, TextLineData::Separator lines not taken into account
- QMap<int, int> changedLeftPositions; // counting from the beginning of the chunk
- QMap<int, int> changedRightPositions; // counting from the beginning of the chunk
};
class FileData {
@@ -94,6 +98,9 @@ ChunkData calculateOriginalData(const QList<Diff> &leftDiffList,
const QList<Diff> &rightDiffList);
FileData calculateContextData(const ChunkData &originalData,
int contextLinesNumber);
+void addChangedPositions(int positionOffset,
+ const QMap<int, int> &originalChangedPositions,
+ QMap<int, int> *changedPositions);
QList<QTextEdit::ExtraSelection> colorPositions(const QTextCharFormat &format,
QTextCursor &cursor,
const QMap<int, int> &positions);
diff --git a/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp b/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp
index e8b00191f1..7e4e8ddf34 100644
--- a/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp
+++ b/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp
@@ -1037,86 +1037,6 @@ void SideBySideDiffEditorWidget::showDiff()
m_rightEditor->updateFoldingHighlight(QPoint(-1, -1));
}
-static void fixPositions(QMap<int, int>::ConstIterator *it,
- const QMap<int, int>::ConstIterator &itEnd,
- int fileOffset,
- int charCounter,
- int spanCounter,
- int *lastSpanCounter,
- QMap<int, int> *changedPositions)
-{
- while (*it != itEnd) {
- if (it->key() >= charCounter)
- break;
-
- if (it->value() >= charCounter) {
- if (*lastSpanCounter != -1)
- break;
-
- *lastSpanCounter = spanCounter;
- break;
- }
-
- const int startSpanOffset = *lastSpanCounter != -1
- ? *lastSpanCounter : spanCounter;
- *lastSpanCounter = -1;
-
- const int startPos = it->key() + startSpanOffset + fileOffset;
- const int endPos = it->value() + spanCounter + fileOffset;
- changedPositions->insert(startPos, endPos);
- ++(*it);
- }
-}
-
-static void fixPositions(const ChunkData &chunkData,
- const int leftFileOffset,
- const int rightFileOffset,
- QMap<int, int> *leftCharPos,
- QMap<int, int> *rightCharPos)
-{
- QMap<int, int>::ConstIterator leftIt = chunkData.changedLeftPositions.constBegin();
- const QMap<int, int>::ConstIterator leftItEnd = chunkData.changedLeftPositions.constEnd();
- QMap<int, int>::ConstIterator rightIt = chunkData.changedRightPositions.constBegin();
- const QMap<int, int>::ConstIterator rightItEnd = chunkData.changedRightPositions.constEnd();
- if (leftIt == leftItEnd && rightIt == rightItEnd)
- return;
-
- int leftCharCounter = 0;
- int rightCharCounter = 0;
- int leftSpanCounter = 0;
- int rightSpanCounter = 0;
- int leftLastSpanCounter = -1;
- int rightLastSpanCounter = -1;
- for (int i = 0; i < chunkData.rows.count(); i++) {
- const RowData &row = chunkData.rows.at(i);
-
- if (row.leftLine.textLineType == TextLineData::TextLine)
- leftCharCounter += row.leftLine.text.count() + 1; // +1 for '\n'
- else
- ++leftSpanCounter;
-
- if (row.rightLine.textLineType == TextLineData::TextLine)
- rightCharCounter += row.rightLine.text.count() + 1; // +1 for '\n'
- else
- ++rightSpanCounter;
-
- fixPositions(&leftIt,
- leftItEnd,
- leftFileOffset,
- leftCharCounter,
- leftSpanCounter,
- &leftLastSpanCounter,
- leftCharPos);
- fixPositions(&rightIt,
- rightItEnd,
- rightFileOffset,
- rightCharCounter,
- rightSpanCounter,
- &rightLastSpanCounter,
- rightCharPos);
- }
-}
-
void SideBySideDiffEditorWidget::colorDiff(const QList<FileData> &fileDataList)
{
QPalette pal = m_leftEditor->extraArea()->palette();
@@ -1144,31 +1064,30 @@ void SideBySideDiffEditorWidget::colorDiff(const QList<FileData> &fileDataList)
int rightLastSkippedBlockStartPos = 0;
for (int i = 0; i < fileDataList.count(); i++) {
+ const FileData &fileData = fileDataList.at(i);
leftFilePos[leftPos] = leftPos + 1;
rightFilePos[rightPos] = rightPos + 1;
leftPos++; // for file line
rightPos++; // for file line
- const FileData &fileData = fileDataList.at(i);
for (int j = 0; j < fileData.chunks.count(); j++) {
- ChunkData chunkData = fileData.chunks.at(j);
+ const ChunkData &chunkData = fileData.chunks.at(j);
if (chunkData.contextChunk) {
leftChunkPos[leftPos] = leftPos + 1;
rightChunkPos[rightPos] = rightPos + 1;
leftPos++; // for chunk line
rightPos++; // for chunk line
}
- const int leftFileOffset = leftPos;
- const int rightFileOffset = rightPos;
leftLastDiffBlockStartPos = leftPos;
rightLastDiffBlockStartPos = rightPos;
leftLastSkippedBlockStartPos = leftPos;
rightLastSkippedBlockStartPos = rightPos;
- fixPositions(chunkData, leftFileOffset, rightFileOffset, &leftCharPos, &rightCharPos);
-
for (int k = 0; k < chunkData.rows.count(); k++) {
- RowData rowData = chunkData.rows.at(k);
+ const RowData &rowData = chunkData.rows.at(k);
+
+ addChangedPositions(leftPos, rowData.leftLine.changedPositions, &leftCharPos);
+ addChangedPositions(rightPos, rowData.rightLine.changedPositions, &rightCharPos);
leftPos += rowData.leftLine.text.count() + 1; // +1 for '\n'
rightPos += rowData.rightLine.text.count() + 1; // +1 for '\n'
@@ -1201,27 +1120,19 @@ void SideBySideDiffEditorWidget::colorDiff(const QList<FileData> &fileDataList)
QTextCursor leftCursor = m_leftEditor->textCursor();
QTextCursor rightCursor = m_rightEditor->textCursor();
- QList<QTextEdit::ExtraSelection> leftSelections
- = colorPositions(m_leftLineFormat, leftCursor, leftLinePos);
- leftSelections
- += colorPositions(spanLineFormat, leftCursor, leftSkippedPos);
- leftSelections
- += colorPositions(m_chunkLineFormat, leftCursor, leftChunkPos);
- leftSelections
- += colorPositions(m_fileLineFormat, leftCursor, leftFilePos);
- leftSelections
- += colorPositions(m_leftCharFormat, leftCursor, leftCharPos);
-
- QList<QTextEdit::ExtraSelection> rightSelections
- = colorPositions(m_rightLineFormat, rightCursor, rightLinePos);
- rightSelections
- += colorPositions(spanLineFormat, rightCursor, rightSkippedPos);
- rightSelections
- += colorPositions(m_chunkLineFormat, rightCursor, rightChunkPos);
- rightSelections
- += colorPositions(m_fileLineFormat, rightCursor, rightFilePos);
- rightSelections
- += colorPositions(m_rightCharFormat, rightCursor, rightCharPos);
+ QList<QTextEdit::ExtraSelection> leftSelections;
+ leftSelections += colorPositions(m_leftLineFormat, leftCursor, leftLinePos);
+ leftSelections += colorPositions(m_leftCharFormat, leftCursor, leftCharPos);
+ leftSelections += colorPositions(spanLineFormat, leftCursor, leftSkippedPos);
+ leftSelections += colorPositions(m_chunkLineFormat, leftCursor, leftChunkPos);
+ leftSelections += colorPositions(m_fileLineFormat, leftCursor, leftFilePos);
+
+ QList<QTextEdit::ExtraSelection> rightSelections;
+ rightSelections += colorPositions(m_rightLineFormat, rightCursor, rightLinePos);
+ rightSelections += colorPositions(m_rightCharFormat, rightCursor, rightCharPos);
+ rightSelections += colorPositions(spanLineFormat, rightCursor, rightSkippedPos);
+ rightSelections += colorPositions(m_chunkLineFormat, rightCursor, rightChunkPos);
+ rightSelections += colorPositions(m_fileLineFormat, rightCursor, rightFilePos);
m_leftEditor->setExtraSelections(BaseTextEditorWidget::OtherSelection, leftSelections);
m_rightEditor->setExtraSelections(BaseTextEditorWidget::OtherSelection, rightSelections);
@@ -1485,44 +1396,6 @@ void SideBySideDiffEditorWidget::synchronizeFoldings(SideDiffEditorWidget *sourc
m_foldingBlocker = false;
}
-
} // namespace DiffEditor
-#ifdef WITH_TESTS
-#include <QTest>
-
-void DiffEditor::SideBySideDiffEditorWidget::testFixPositions()
-{
- ChunkData chunkData;
- chunkData.rows.append(RowData(TextLineData(QLatin1String("abcd efgh")), TextLineData(QLatin1String("abcd "))));
- chunkData.rows.append(RowData(TextLineData(TextLineData::Separator), TextLineData(QLatin1String(""))));
- chunkData.rows.append(RowData(TextLineData(TextLineData::Separator), TextLineData(QLatin1String(""))));
- chunkData.rows.append(RowData(TextLineData(TextLineData::Separator), TextLineData(QLatin1String(""))));
- chunkData.rows.append(RowData(TextLineData(TextLineData::Separator), TextLineData(QLatin1String(""))));
- chunkData.rows.append(RowData(TextLineData(TextLineData::Separator), TextLineData(QLatin1String(""))));
- chunkData.rows.append(RowData(TextLineData(TextLineData::Separator), TextLineData(QLatin1String(""))));
- chunkData.rows.append(RowData(TextLineData(QLatin1String("ijkl mnop")), TextLineData(QLatin1String(" mnop"))));
-
- chunkData.changedLeftPositions.insert(5, 14); // changed text from position 5 to position 14, occupy 9 characters: "efgh\nijkl"
-
- QMap<int, int> expectedLeftChangedPositions;
- expectedLeftChangedPositions[5] = 20; // "efgh\n[\n\n\n\n\n\n]ijkl" - [\n] means inserted span
-
- QMap<int, int> outputLeftChangedPositions;
- QMap<int, int> outputRightChangedPositions;
-
- fixPositions(chunkData, 0, 0, &outputLeftChangedPositions, &outputRightChangedPositions);
- QVERIFY(outputLeftChangedPositions == expectedLeftChangedPositions);
-
- QMap<int, int> expectedLeftMovedPositions;
- expectedLeftMovedPositions[15] = 30; // moved by 10
- outputLeftChangedPositions.clear();
- outputRightChangedPositions.clear();
-
- fixPositions(chunkData, 10, 0, &outputLeftChangedPositions, &outputRightChangedPositions);
- QVERIFY(outputLeftChangedPositions == expectedLeftMovedPositions);
-}
-
-#endif // WITH_TESTS
-
#include "sidebysidediffeditorwidget.moc"
diff --git a/src/plugins/diffeditor/sidebysidediffeditorwidget.h b/src/plugins/diffeditor/sidebysidediffeditorwidget.h
index 17b5756ee3..a25809e475 100644
--- a/src/plugins/diffeditor/sidebysidediffeditorwidget.h
+++ b/src/plugins/diffeditor/sidebysidediffeditorwidget.h
@@ -62,10 +62,6 @@ public:
void setDiffEditorGuiController(DiffEditorGuiController *controller);
DiffEditorGuiController *diffEditorGuiController() const;
-#ifdef WITH_TESTS
- static void testFixPositions();
-#endif // WITH_TESTS
-
private slots:
void clear(const QString &message = QString());
void setDiff(const QList<DiffEditorController::DiffFilesContents> &diffFileList, const QString &workingDirectory);
diff --git a/src/plugins/fakevim/fakevim.qbs b/src/plugins/fakevim/fakevim.qbs
index 6b2f675366..e1eb89c4a8 100644
--- a/src/plugins/fakevim/fakevim.qbs
+++ b/src/plugins/fakevim/fakevim.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/fakevim/fakevimoptions.ui b/src/plugins/fakevim/fakevimoptions.ui
index 8aa972b88a..8db93d585f 100644
--- a/src/plugins/fakevim/fakevimoptions.ui
+++ b/src/plugins/fakevim/fakevimoptions.ui
@@ -187,7 +187,7 @@
<item>
<widget class="QLabel" name="labelTabulator">
<property name="toolTip">
- <string>Vim tabstop option</string>
+ <string>Vim tabstop option.</string>
</property>
<property name="text">
<string>Tabulator size:</string>
diff --git a/src/plugins/find/find.qbs b/src/plugins/find/find.qbs
index e0acdc006f..8e28788ff2 100644
--- a/src/plugins/find/find.qbs
+++ b/src/plugins/find/find.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/genericprojectmanager/genericprojectmanager.qbs b/src/plugins/genericprojectmanager/genericprojectmanager.qbs
index 359215d54f..5e345dd8f8 100644
--- a/src/plugins/genericprojectmanager/genericprojectmanager.qbs
+++ b/src/plugins/genericprojectmanager/genericprojectmanager.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/genericprojectmanager/genericprojectnodes.cpp b/src/plugins/genericprojectmanager/genericprojectnodes.cpp
index e3ecda4434..294505a981 100644
--- a/src/plugins/genericprojectmanager/genericprojectnodes.cpp
+++ b/src/plugins/genericprojectmanager/genericprojectnodes.cpp
@@ -225,7 +225,7 @@ FolderNode *GenericProjectNode::findFolderByName(const QStringList &components,
return 0;
}
-bool GenericProjectNode::hasBuildTargets() const
+bool GenericProjectNode::showInSimpleTree() const
{
return true;
}
diff --git a/src/plugins/genericprojectmanager/genericprojectnodes.h b/src/plugins/genericprojectmanager/genericprojectnodes.h
index a7c25c0b30..c8763e049f 100644
--- a/src/plugins/genericprojectmanager/genericprojectnodes.h
+++ b/src/plugins/genericprojectmanager/genericprojectnodes.h
@@ -51,7 +51,7 @@ public:
Core::IDocument *projectFile() const;
QString projectFilePath() const;
- bool hasBuildTargets() const;
+ bool showInSimpleTree() const;
QList<ProjectExplorer::ProjectAction> supportedActions(Node *node) const;
diff --git a/src/plugins/git/branchdialog.ui b/src/plugins/git/branchdialog.ui
index 320c78bbd6..36d07c7dfc 100644
--- a/src/plugins/git/branchdialog.ui
+++ b/src/plugins/git/branchdialog.ui
@@ -173,7 +173,7 @@
<item>
<widget class="QPushButton" name="trackButton">
<property name="toolTip">
- <string>Sets current branch to track the selected one.</string>
+ <string>Set current branch to track the selected one.</string>
</property>
<property name="text">
<string>&amp;Track</string>
diff --git a/src/plugins/git/commitdata.cpp b/src/plugins/git/commitdata.cpp
index 9a1fefcbaf..0ac0c5d1de 100644
--- a/src/plugins/git/commitdata.cpp
+++ b/src/plugins/git/commitdata.cpp
@@ -80,6 +80,7 @@ QDebug operator<<(QDebug d, const GitSubmitEditorPanelData &data)
CommitData::CommitData(CommitType type)
: commitType(type)
+ , commitEncoding(0)
, enablePush(false)
{
}
diff --git a/src/plugins/git/commitdata.h b/src/plugins/git/commitdata.h
index 8fbee2b5d9..d921eb726d 100644
--- a/src/plugins/git/commitdata.h
+++ b/src/plugins/git/commitdata.h
@@ -111,7 +111,7 @@ public:
CommitType commitType;
QString amendSHA1;
- QString commitEncoding;
+ QTextCodec *commitEncoding;
GitSubmitEditorPanelInfo panelInfo;
GitSubmitEditorPanelData panelData;
bool enablePush;
diff --git a/src/plugins/git/gerrit/gerritplugin.cpp b/src/plugins/git/gerrit/gerritplugin.cpp
index f51adbb511..45ccb65de3 100644
--- a/src/plugins/git/gerrit/gerritplugin.cpp
+++ b/src/plugins/git/gerrit/gerritplugin.cpp
@@ -356,7 +356,7 @@ void GerritPlugin::openView()
{
if (m_dialog.isNull()) {
while (!m_parameters->isValid()) {
- QMessageBox::warning(0, tr("Error"),
+ QMessageBox::warning(ICore::dialogParent(), tr("Error"),
tr("Invalid Gerrit configuration. Host, user and ssh binary are mandatory."));
const Id group = VcsBase::Constants::VCS_SETTINGS_CATEGORY;
if (!ICore::showOptionsDialog(group, "Gerrit"))
diff --git a/src/plugins/git/git.qbs b/src/plugins/git/git.qbs
index eacdf24f83..75a3357c1d 100644
--- a/src/plugins/git/git.qbs
+++ b/src/plugins/git/git.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp
index 2860cc5da2..76d2edd144 100644
--- a/src/plugins/git/gitclient.cpp
+++ b/src/plugins/git/gitclient.cpp
@@ -424,7 +424,8 @@ void GitDiffHandler::collectShowDescription(const QString &id)
m_editorController->clear(m_waitMessage);
VcsBase::Command *command = new VcsBase::Command(m_gitPath, m_workingDirectory, m_processEnvironment);
- command->setCodec(Core::EditorManager::defaultTextCodec());
+ command->setCodec(GitPlugin::instance()->gitClient()->encoding(m_workingDirectory,
+ "i18n.commitEncoding"));
connect(command, SIGNAL(output(QString)), this, SLOT(slotShowDescriptionReceived(QString)));
QStringList arguments;
arguments << QLatin1String("show") << QLatin1String("-s")
@@ -1132,14 +1133,10 @@ VcsBase::VcsBaseEditorWidget *GitClient::createVcsEditor(
this, SLOT(slotBlameRevisionRequested(QString,QString,QString,int)));
QTC_ASSERT(rc, return 0);
rc->setSource(source);
- if (codecType == CodecSource) {
+ if (codecType == CodecSource)
rc->setCodec(getSourceCodec(source));
- } else if (codecType == CodecLogOutput) {
- QString encodingName = readConfigValue(source, QLatin1String("i18n.logOutputEncoding"));
- if (encodingName.isEmpty())
- encodingName = QLatin1String("utf-8");
- rc->setCodec(QTextCodec::codecForName(encodingName.toLocal8Bit()));
- }
+ else if (codecType == CodecLogOutput)
+ rc->setCodec(encoding(source, "i18n.logOutputEncoding"));
rc->setForceReadOnly(true);
@@ -1556,12 +1553,8 @@ void GitClient::slotBlameRevisionRequested(const QString &workingDirectory, cons
QTextCodec *GitClient::getSourceCodec(const QString &file) const
{
- if (QFileInfo(file).isFile())
- return VcsBase::VcsBaseEditorWidget::getCodec(file);
- QString encodingName = readConfigValue(file, QLatin1String("gui.encoding"));
- if (encodingName.isEmpty())
- encodingName = QLatin1String("utf-8");
- return QTextCodec::codecForName(encodingName.toLocal8Bit());
+ return QFileInfo(file).isFile() ? VcsBase::VcsBaseEditorWidget::getCodec(file)
+ : encoding(file, "gui.encoding");
}
void GitClient::blame(const QString &workingDirectory,
@@ -1625,7 +1618,7 @@ QStringList GitClient::setupCheckoutArguments(const QString &workingDirectory,
return arguments;
if (QMessageBox::question(Core::ICore::mainWindow(), tr("Create Local Branch"),
- tr("Would you like to create local branch?"),
+ tr("Would you like to create a local branch?"),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::No) {
return arguments;
}
@@ -1705,11 +1698,7 @@ bool GitClient::synchronousLog(const QString &workingDirectory, const QStringLis
const bool rc = fullySynchronousGit(workingDirectory, allArguments, &outputText, &errorText,
flags);
if (rc) {
- QString encodingName = readConfigValue(workingDirectory, QLatin1String("i18n.logOutputEncoding"));
- if (encodingName.isEmpty())
- encodingName = QLatin1String("utf-8");
- QTextCodec *codec = QTextCodec::codecForName(encodingName.toLocal8Bit());
- if (codec)
+ if (QTextCodec *codec = encoding(workingDirectory, "i18n.logOutputEncoding"))
*output = codec->toUnicode(outputText);
else
*output = commandOutputFromLocal8Bit(outputText);
@@ -2411,9 +2400,10 @@ SubmoduleDataMap GitClient::submoduleList(const QString &workingDirectory)
if (cachedSubmoduleData.contains(workingDirectory))
return cachedSubmoduleData.value(workingDirectory);
- QStringList args(QLatin1String("-l"));
- QStringList allConfigs = readConfig(workingDirectory, args).split(QLatin1Char('\n'));
+ QStringList allConfigs =
+ commandOutputFromLocal8Bit(readConfig(workingDirectory, QLatin1String("-l")))
+ .split(QLatin1Char('\n'));
const QString submoduleLineStart = QLatin1String("submodule.");
foreach (const QString &configLine, allConfigs) {
if (!configLine.startsWith(submoduleLineStart))
@@ -3027,6 +3017,16 @@ QString GitClient::gitBinaryPath(bool *ok, QString *errorMessage) const
return settings()->gitBinaryPath(ok, errorMessage);
}
+QTextCodec *GitClient::encoding(const QString &workingDirectory, const QByteArray &configVar) const
+{
+ QByteArray codecName = readConfig(workingDirectory, QLatin1String(configVar)).trimmed();
+ // Set default commit encoding to 'UTF-8', when it's not set,
+ // to solve displaying error of commit log with non-latin characters.
+ if (codecName.isEmpty())
+ codecName = "UTF-8";
+ return QTextCodec::codecForName(codecName);
+}
+
bool GitClient::getCommitData(const QString &workingDirectory,
QString *commitTemplate,
CommitData &commitData,
@@ -3106,12 +3106,7 @@ bool GitClient::getCommitData(const QString &workingDirectory,
}
}
- commitData.commitEncoding = readConfigValue(workingDirectory, QLatin1String("i18n.commitEncoding"));
-
- // Set default commit encoding to 'UTF-8', when it's not set,
- // to solve displaying error of commit log with non-latin characters.
- if (commitData.commitEncoding.isEmpty())
- commitData.commitEncoding = QLatin1String("UTF-8");
+ commitData.commitEncoding = encoding(workingDirectory, "i18n.commitEncoding");
// Get the commit template or the last commit message
switch (commitData.commitType) {
@@ -3119,8 +3114,8 @@ bool GitClient::getCommitData(const QString &workingDirectory,
// Amend: get last commit data as "SHA1<tab>author<tab>email<tab>message".
QStringList args(QLatin1String("log"));
args << QLatin1String("--max-count=1") << QLatin1String("--pretty=format:%h\t%an\t%ae\t%B");
- QTextCodec *codec = QTextCodec::codecForName(commitData.commitEncoding.toLocal8Bit());
- const Utils::SynchronousProcessResponse sp = synchronousGit(repoDirectory, args, 0, codec);
+ const Utils::SynchronousProcessResponse sp = synchronousGit(repoDirectory, args, 0,
+ commitData.commitEncoding);
if (sp.result != Utils::SynchronousProcessResponse::Finished) {
*errorMessage = tr("Cannot retrieve last commit data of repository \"%1\".").arg(repoDirectory);
return false;
@@ -3748,7 +3743,7 @@ bool GitClient::synchronousStashList(const QString &workingDirectory,
return true;
}
-QString GitClient::readConfig(const QString &workingDirectory, const QStringList &configVar) const
+QByteArray GitClient::readConfig(const QString &workingDirectory, const QString &configVar) const
{
QStringList arguments;
arguments << QLatin1String("config") << configVar;
@@ -3757,16 +3752,16 @@ QString GitClient::readConfig(const QString &workingDirectory, const QStringList
QByteArray errorText;
if (!fullySynchronousGit(workingDirectory, arguments, &outputText, &errorText,
VcsBasePlugin::SuppressCommandLogging))
- return QString();
+ return QByteArray();
if (Utils::HostOsInfo::isWindowsHost())
- return Utils::SynchronousProcess::normalizeNewlines(QString::fromUtf8(outputText));
- return commandOutputFromLocal8Bit(outputText);
+ outputText.replace("\r\n", "\n");
+ return outputText;
}
// Read a single-line config value, return trimmed
QString GitClient::readConfigValue(const QString &workingDirectory, const QString &configVar) const
{
- return readConfig(workingDirectory, QStringList(configVar)).remove(QLatin1Char('\n'));
+ return commandOutputFromLocal8Bit(readConfig(workingDirectory, configVar).trimmed());
}
bool GitClient::cloneRepository(const QString &directory,const QByteArray &url)
diff --git a/src/plugins/git/gitclient.h b/src/plugins/git/gitclient.h
index 5ca5424225..b5dd5fd474 100644
--- a/src/plugins/git/gitclient.h
+++ b/src/plugins/git/gitclient.h
@@ -281,10 +281,11 @@ public:
const QString &messge, QString *name,
QString *errorMessage = 0);
- QString readConfig(const QString &workingDirectory, const QStringList &configVar) const;
+ QByteArray readConfig(const QString &workingDirectory, const QString &configVar) const;
QString readConfigValue(const QString &workingDirectory, const QString &configVar) const;
+ QTextCodec *encoding(const QString &workingDirectory, const QByteArray &configVar) const;
bool getCommitData(const QString &workingDirectory, QString *commitTemplate,
CommitData &commitData, QString *errorMessage);
diff --git a/src/plugins/git/giteditor.cpp b/src/plugins/git/giteditor.cpp
index 07328f34a7..d281ad9e48 100644
--- a/src/plugins/git/giteditor.cpp
+++ b/src/plugins/git/giteditor.cpp
@@ -46,6 +46,7 @@
#include <QRegExp>
#include <QSet>
#include <QTemporaryFile>
+#include <QTextCodec>
#include <QDir>
#include <QTextCursor>
@@ -325,14 +326,16 @@ void GitEditor::addDiffActions(QMenu *menu, const VcsBase::DiffChunk &chunk)
bool GitEditor::open(QString *errorString, const QString &fileName, const QString &realFileName)
{
- bool res = VcsBaseEditorWidget::open(errorString, fileName, realFileName);
Core::Id editorId = editor()->document()->id();
if (editorId == Git::Constants::GIT_COMMIT_TEXT_EDITOR_ID
|| editorId == Git::Constants::GIT_REBASE_EDITOR_ID) {
QFileInfo fi(fileName);
- setSource(fi.absolutePath());
+ const QString gitPath = fi.absolutePath();
+ setSource(gitPath);
+ baseTextDocument()->setCodec(
+ GitPlugin::instance()->gitClient()->encoding(gitPath, "i18n.commitEncoding"));
}
- return res;
+ return VcsBaseEditorWidget::open(errorString, fileName, realFileName);
}
QString GitEditor::decorateVersion(const QString &revision) const
diff --git a/src/plugins/git/gitsubmiteditor.cpp b/src/plugins/git/gitsubmiteditor.cpp
index 0c785fcfb5..7857171768 100644
--- a/src/plugins/git/gitsubmiteditor.cpp
+++ b/src/plugins/git/gitsubmiteditor.cpp
@@ -88,6 +88,7 @@ private:
GitSubmitEditor::GitSubmitEditor(const VcsBase::VcsBaseSubmitEditorParameters *parameters, QWidget *parent) :
VcsBaseSubmitEditor(parameters, new GitSubmitEditorWidget(parent)),
m_model(0),
+ m_commitEncoding(0),
m_commitType(SimpleCommit),
m_forceClose(false)
{
@@ -153,7 +154,9 @@ void GitSubmitEditor::slotDiffSelected(const QList<int> &rows)
unmergedFiles.push_back(fileName);
else if (state & StagedFile)
stagedFiles.push_back(fileName);
- else if (state != UntrackedFile)
+ else if (state == UntrackedFile)
+ Core::EditorManager::openEditor(m_workingDirectory + QLatin1Char('/') + fileName);
+ else
unstagedFiles.push_back(fileName);
}
if (!unstagedFiles.empty() || !stagedFiles.empty())
@@ -200,13 +203,10 @@ QByteArray GitSubmitEditor::fileContents() const
{
const QString &text = submitEditorWidget()->descriptionText();
- if (!m_commitEncoding.isEmpty()) {
- // Do the encoding convert, When use user-defined encoding
- // e.g. git config --global i18n.commitencoding utf-8
- QTextCodec *codec = QTextCodec::codecForName(m_commitEncoding.toLocal8Bit());
- if (codec)
- return codec->fromUnicode(text);
- }
+ // Do the encoding convert, When use user-defined encoding
+ // e.g. git config --global i18n.commitencoding utf-8
+ if (m_commitEncoding)
+ return m_commitEncoding->fromUnicode(text);
// Using utf-8 as the default encoding
return text.toUtf8();
diff --git a/src/plugins/git/gitsubmiteditor.h b/src/plugins/git/gitsubmiteditor.h
index 629ae4fcbc..e2e093cfe2 100644
--- a/src/plugins/git/gitsubmiteditor.h
+++ b/src/plugins/git/gitsubmiteditor.h
@@ -75,7 +75,7 @@ private:
inline const GitSubmitEditorWidget *submitEditorWidget() const;
VcsBase::SubmitFileModel *m_model;
- QString m_commitEncoding;
+ QTextCodec *m_commitEncoding;
CommitType m_commitType;
QString m_amendSHA1;
bool m_forceClose;
diff --git a/src/plugins/git/mergetool.cpp b/src/plugins/git/mergetool.cpp
index 44190b7981..a3263b0440 100644
--- a/src/plugins/git/mergetool.cpp
+++ b/src/plugins/git/mergetool.cpp
@@ -33,6 +33,7 @@
#include "gitversioncontrol.h"
#include <coreplugin/documentmanager.h>
+#include <coreplugin/icore.h>
#include <vcsbase/vcsbaseoutputwindow.h>
#include <QMessageBox>
@@ -89,7 +90,8 @@ bool MergeTool::start(const QString &workingDirectory, const QStringList &files)
arguments << QLatin1String("mergetool") << QLatin1String("-y");
if (!files.isEmpty()) {
if (m_gitClient->gitVersion() < 0x010708) {
- QMessageBox::warning(0, tr("Error"), tr("File input for the merge tool requires Git 1.7.8, or later."));
+ QMessageBox::warning(Core::ICore::dialogParent(), tr("Error"),
+ tr("File input for the merge tool requires Git 1.7.8, or later."));
return false;
}
arguments << files;
@@ -244,7 +246,7 @@ void MergeTool::readData()
m_remoteState = waitAndReadStatus(m_remoteInfo);
chooseAction();
} else if (m_merging && line.startsWith("Continue merging")) {
- if (QMessageBox::question(0, tr("Continue Merging"),
+ if (QMessageBox::question(Core::ICore::dialogParent(), tr("Continue Merging"),
tr("Continue merging other unresolved paths?"),
QMessageBox::Yes | QMessageBox::No,
QMessageBox::No) == QMessageBox::Yes) {
@@ -262,7 +264,7 @@ void MergeTool::done()
const QString workingDirectory = m_process->workingDirectory();
int exitCode = m_process->exitCode();
if (!exitCode) {
- outputWindow->appendMessage(tr("Merge tool process finished successully."));
+ outputWindow->appendMessage(tr("Merge tool process finished successfully."));
m_gitClient->continueCommandIfNeeded(workingDirectory);
} else {
outputWindow->appendError(tr("Merge tool process terminated with exit code %1")
diff --git a/src/plugins/glsleditor/glsleditor.qbs b/src/plugins/glsleditor/glsleditor.qbs
index 4bce00cfaa..7bdb706924 100644
--- a/src/plugins/glsleditor/glsleditor.qbs
+++ b/src/plugins/glsleditor/glsleditor.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/helloworld/helloworld.qbs b/src/plugins/helloworld/helloworld.qbs
index a2c677c8be..ee28546281 100644
--- a/src/plugins/helloworld/helloworld.qbs
+++ b/src/plugins/helloworld/helloworld.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/help/generalsettingspage.ui b/src/plugins/help/generalsettingspage.ui
index fff9fad77e..ae3b4a361f 100644
--- a/src/plugins/help/generalsettingspage.ui
+++ b/src/plugins/help/generalsettingspage.ui
@@ -268,7 +268,7 @@
<item>
<widget class="QPushButton" name="defaultPageButton">
<property name="toolTip">
- <string>Reset to default</string>
+ <string>Reset to default.</string>
</property>
<property name="text">
<string>Reset</string>
@@ -291,7 +291,7 @@
<item>
<widget class="QCheckBox" name="m_returnOnClose">
<property name="toolTip">
- <string>Switch to editor context after last help page is closed.</string>
+ <string>Switches to editor context after last help page is closed.</string>
</property>
<property name="text">
<string>Return to editor on closing the last page</string>
diff --git a/src/plugins/help/help.qbs b/src/plugins/help/help.qbs
index bedbc11a50..5786458f95 100644
--- a/src/plugins/help/help.qbs
+++ b/src/plugins/help/help.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/imageviewer/imageviewer.qbs b/src/plugins/imageviewer/imageviewer.qbs
index 3fb6057e17..d12d2b5345 100644
--- a/src/plugins/imageviewer/imageviewer.qbs
+++ b/src/plugins/imageviewer/imageviewer.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/ios/ios.qbs b/src/plugins/ios/ios.qbs
index 9dab73cc78..1f351427cd 100644
--- a/src/plugins/ios/ios.qbs
+++ b/src/plugins/ios/ios.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/ios/iosconstants.h b/src/plugins/ios/iosconstants.h
index 3bdab989eb..cd76cc12e8 100644
--- a/src/plugins/ios/iosconstants.h
+++ b/src/plugins/ios/iosconstants.h
@@ -55,6 +55,14 @@ const char IOS_DEVICE_TYPE[] = "Ios.Device.Type";
const char IOS_SIMULATOR_TYPE[] = "Ios.Simulator.Type";
const char IOS_DEVICE_ID[] = "iOS Device ";
const char IOS_SIMULATOR_DEVICE_ID[] = "iOS Simulator Device ";
+
+const quint16 IOS_DEVICE_PORT_START = 30000;
+const quint16 IOS_DEVICE_PORT_END = 31000;
+const quint16 IOS_SIMULATOR_PORT_START = 30000;
+const quint16 IOS_SIMULATOR_PORT_END = 31000;
+
+const char EXTRA_INFO_KEY[] = "extraInfo";
+
} // namespace Constants;
} // namespace Ios
diff --git a/src/plugins/ios/iosdevice.cpp b/src/plugins/ios/iosdevice.cpp
index 9dda6e05d2..ce54715970 100644
--- a/src/plugins/ios/iosdevice.cpp
+++ b/src/plugins/ios/iosdevice.cpp
@@ -34,6 +34,7 @@
#include <projectexplorer/devicesupport/devicemanager.h>
#include <projectexplorer/kitinformation.h>
#include <coreplugin/helpmanager.h>
+#include <utils/portlist.h>
#include <QCoreApplication>
#include <QVariant>
@@ -78,27 +79,32 @@ static QString CFStringRef2QString(CFStringRef s)
namespace Ios {
namespace Internal {
-const char extraInfoKey[] = "extraInfo";
-
IosDevice::IosDevice()
: IDevice(Core::Id(Constants::IOS_DEVICE_TYPE),
IDevice::AutoDetected,
IDevice::Hardware,
- Constants::IOS_DEVICE_ID)
+ Constants::IOS_DEVICE_ID),
+ m_lastPort(Constants::IOS_DEVICE_PORT_START)
{
setDisplayName(IosDevice::name());
setDeviceState(DeviceDisconnected);
+ Utils::PortList ports;
+ ports.addRange(Constants::IOS_DEVICE_PORT_START,
+ Constants::IOS_DEVICE_PORT_END);
+ setFreePorts(ports);
}
IosDevice::IosDevice(const IosDevice &other)
- : IDevice(other), m_extraInfo(other.m_extraInfo), m_ignoreDevice(other.m_ignoreDevice)
+ : IDevice(other), m_extraInfo(other.m_extraInfo), m_ignoreDevice(other.m_ignoreDevice),
+ m_lastPort(other.m_lastPort)
{ }
IosDevice::IosDevice(const QString &uid)
: IDevice(Core::Id(Constants::IOS_DEVICE_TYPE),
IDevice::AutoDetected,
IDevice::Hardware,
- Core::Id(Constants::IOS_DEVICE_ID).withSuffix(uid))
+ Core::Id(Constants::IOS_DEVICE_ID).withSuffix(uid)),
+ m_lastPort(Constants::IOS_DEVICE_PORT_START)
{
setDisplayName(IosDevice::name());
setDeviceState(DeviceDisconnected);
@@ -158,7 +164,7 @@ IDevice::Ptr IosDevice::clone() const
void IosDevice::fromMap(const QVariantMap &map)
{
IDevice::fromMap(map);
- QVariantMap vMap = map.value(QLatin1String(extraInfoKey)).toMap();
+ QVariantMap vMap = map.value(QLatin1String(Constants::EXTRA_INFO_KEY)).toMap();
QMapIterator<QString, QVariant> i(vMap);
m_extraInfo.clear();
while (i.hasNext()) {
@@ -176,7 +182,7 @@ QVariantMap IosDevice::toMap() const
i.next();
vMap.insert(i.key(), i.value());
}
- res.insert(QLatin1String(extraInfoKey), vMap);
+ res.insert(QLatin1String(Constants::EXTRA_INFO_KEY), vMap);
return res;
}
@@ -195,6 +201,19 @@ QString IosDevice::osVersion() const
return m_extraInfo.value(QLatin1String("osVersion"));
}
+quint16 IosDevice::nextPort() const
+{
+ // use qrand instead?
+ if (++m_lastPort >= Constants::IOS_DEVICE_PORT_END)
+ m_lastPort = Constants::IOS_DEVICE_PORT_START;
+ return m_lastPort;
+}
+
+bool IosDevice::canAutoDetectPorts() const
+{
+ return true;
+}
+
// IosDeviceManager
@@ -260,7 +279,10 @@ void IosDeviceManager::deviceDisconnected(const QString &uid)
qDebug() << "ignoring disconnection of ios device " << uid; // should neve happen
} else {
const IosDevice *iosDev = static_cast<const IosDevice *>(dev.data());
- if (iosDev->deviceState() != IDevice::DeviceDisconnected) {
+ if (iosDev->m_extraInfo.isEmpty()
+ || iosDev->m_extraInfo.value(QLatin1String("deviceName")) == QLatin1String("*unknown*")) {
+ devManager->removeDevice(iosDev->id());
+ } else if (iosDev->deviceState() != IDevice::DeviceDisconnected) {
if (debugDeviceDetection)
qDebug() << "disconnecting device " << iosDev->uniqueDeviceID();
devManager->setDeviceState(iosDev->id(), IDevice::DeviceDisconnected);
diff --git a/src/plugins/ios/iosdevice.h b/src/plugins/ios/iosdevice.h
index 12d11b0c37..10ff7cc97f 100644
--- a/src/plugins/ios/iosdevice.h
+++ b/src/plugins/ios/iosdevice.h
@@ -71,6 +71,8 @@ public:
QString uniqueDeviceID() const;
IosDevice(const QString &uid);
QString osVersion() const;
+ quint16 nextPort() const;
+ bool canAutoDetectPorts() const QTC_OVERRIDE;
static QString name();
@@ -81,6 +83,7 @@ protected:
IosDevice(const IosDevice &other);
Dict m_extraInfo;
bool m_ignoreDevice;
+ mutable quint16 m_lastPort;
};
class IosDeviceManager : public QObject {
diff --git a/src/plugins/ios/iosdevicefactory.cpp b/src/plugins/ios/iosdevicefactory.cpp
index a78a74adb6..c9fcf3ecfb 100644
--- a/src/plugins/ios/iosdevicefactory.cpp
+++ b/src/plugins/ios/iosdevicefactory.cpp
@@ -63,7 +63,13 @@ ProjectExplorer::IDevice::Ptr IosDeviceFactory::create(Core::Id id) const
bool IosDeviceFactory::canRestore(const QVariantMap &map) const
{
- return ProjectExplorer::IDevice::typeFromMap(map) == Constants::IOS_DEVICE_TYPE;
+ if (ProjectExplorer::IDevice::typeFromMap(map) != Constants::IOS_DEVICE_TYPE)
+ return false;
+ QVariantMap vMap = map.value(QLatin1String(Constants::EXTRA_INFO_KEY)).toMap();
+ if (vMap.isEmpty()
+ || vMap.value(QLatin1String("deviceName")).toString() == QLatin1String("*unknown*"))
+ return false; // transient device (probably generated during an activation)
+ return true;
}
ProjectExplorer::IDevice::Ptr IosDeviceFactory::restore(const QVariantMap &map) const
diff --git a/src/plugins/ios/iosrunconfiguration.cpp b/src/plugins/ios/iosrunconfiguration.cpp
index 8b8fea5882..f2f8db6703 100644
--- a/src/plugins/ios/iosrunconfiguration.cpp
+++ b/src/plugins/ios/iosrunconfiguration.cpp
@@ -227,7 +227,7 @@ Utils::FileName IosRunConfiguration::bundleDir() const
if (isDevice)
res.appendPath(QLatin1String("Release-iphoneos"));
else
- res.appendPath(QLatin1String("/Release-iphonesimulator"));
+ res.appendPath(QLatin1String("Release-iphonesimulator"));
break;
default:
qDebug() << "IosBuildStep had an unknown buildType "
diff --git a/src/plugins/ios/iossimulator.cpp b/src/plugins/ios/iossimulator.cpp
index 792acc871d..f647438d67 100644
--- a/src/plugins/ios/iossimulator.cpp
+++ b/src/plugins/ios/iossimulator.cpp
@@ -33,6 +33,7 @@
#include <projectexplorer/kitinformation.h>
#include <QCoreApplication>
+#include <QProcess>
using namespace ProjectExplorer;
@@ -46,7 +47,8 @@ IosSimulator::IosSimulator(Core::Id id, Utils::FileName simulatorPath)
IDevice::AutoDetected,
IDevice::Emulator,
id),
- m_simulatorPath(simulatorPath)
+ m_simulatorPath(simulatorPath),
+ m_lastPort(Constants::IOS_SIMULATOR_PORT_START)
{
setDisplayName(QCoreApplication::translate("Ios::Internal::IosSimulator", "iOS Simulator"));
setDeviceState(DeviceReadyToUse);
@@ -56,14 +58,15 @@ IosSimulator::IosSimulator()
: IDevice(Core::Id(Constants::IOS_SIMULATOR_TYPE),
IDevice::AutoDetected,
IDevice::Emulator,
- Core::Id(Constants::IOS_SIMULATOR_DEVICE_ID))
+ Core::Id(Constants::IOS_SIMULATOR_DEVICE_ID)),
+ m_lastPort(Constants::IOS_SIMULATOR_PORT_START)
{
setDisplayName(QCoreApplication::translate("Ios::Internal::IosSimulator", "iOS Simulator"));
setDeviceState(DeviceReadyToUse);
}
IosSimulator::IosSimulator(const IosSimulator &other)
- : IDevice(other)
+ : IDevice(other), m_lastPort(other.m_lastPort)
{
setDisplayName(QCoreApplication::translate("Ios::Internal::IosSimulator", "iOS Simulator"));
setDeviceState(DeviceReadyToUse);
@@ -131,6 +134,35 @@ QVariantMap IosSimulator::toMap() const
return res;
}
+quint16 IosSimulator::nextPort() const
+{
+ for (int i = 0; i < 100; ++i) {
+ // use qrand instead?
+ if (++m_lastPort >= Constants::IOS_SIMULATOR_PORT_END)
+ m_lastPort = Constants::IOS_SIMULATOR_PORT_START;
+ QProcess portVerifier;
+ // this is a bit too broad (it does not check just listening sockets, but also connections
+ // to that port from this computer)
+ portVerifier.start(QLatin1String("lsof"), QStringList() << QLatin1String("-n")
+ << QLatin1String("-P") << QLatin1String("-i")
+ << QString::fromLatin1(":%1").arg(m_lastPort));
+ if (!portVerifier.waitForStarted())
+ break;
+ portVerifier.closeWriteChannel();
+ if (!portVerifier.waitForFinished())
+ break;
+ if (portVerifier.exitStatus() != QProcess::NormalExit
+ || portVerifier.exitCode() != 0)
+ break;
+ }
+ return m_lastPort;
+}
+
+bool IosSimulator::canAutoDetectPorts() const
+{
+ return true;
+}
+
IosSimulator::ConstPtr IosKitInformation::simulator(Kit *kit)
{
if (!kit)
diff --git a/src/plugins/ios/iossimulator.h b/src/plugins/ios/iossimulator.h
index e34125461b..0fee860250 100644
--- a/src/plugins/ios/iossimulator.h
+++ b/src/plugins/ios/iossimulator.h
@@ -57,6 +57,8 @@ public:
Utils::FileName simulatorPath() const;
void fromMap(const QVariantMap &map) QTC_OVERRIDE;
QVariantMap toMap() const QTC_OVERRIDE;
+ quint16 nextPort() const;
+ bool canAutoDetectPorts() const QTC_OVERRIDE;
ProjectExplorer::IDevice::Ptr clone() const QTC_OVERRIDE;
@@ -68,6 +70,7 @@ protected:
IosSimulator(const IosSimulator &other);
private:
Utils::FileName m_simulatorPath;
+ mutable quint16 m_lastPort;
};
namespace IosKitInformation {
diff --git a/src/plugins/ios/iostoolhandler.cpp b/src/plugins/ios/iostoolhandler.cpp
index 7a4ffe9f50..26de448afb 100644
--- a/src/plugins/ios/iostoolhandler.cpp
+++ b/src/plugins/ios/iostoolhandler.cpp
@@ -728,7 +728,13 @@ QString IosToolHandler::iosDeviceToolPath()
QString IosToolHandler::iosSimulatorToolPath()
{
+ Utils::FileName devPath = Internal::IosConfigurations::developerPath();
+ bool version182 = devPath.appendPath(QLatin1String(
+ "Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/iPhoneSimulatorRemoteClient.framework"))
+ .toFileInfo().exists();
QString res = Core::ICore::libexecPath() + QLatin1String("/ios/iossim");
+ if (version182)
+ res = res.append(QLatin1String("_1_8_2"));
return res;
}
diff --git a/src/plugins/locator/locator.qbs b/src/plugins/locator/locator.qbs
index b32738a9f7..0c52b46eed 100644
--- a/src/plugins/locator/locator.qbs
+++ b/src/plugins/locator/locator.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import qbs.FileInfo
import QtcPlugin
diff --git a/src/plugins/macros/macros.qbs b/src/plugins/macros/macros.qbs
index 97a81becec..541b356e00 100644
--- a/src/plugins/macros/macros.qbs
+++ b/src/plugins/macros/macros.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/mercurial/mercurial.qbs b/src/plugins/mercurial/mercurial.qbs
index 11a9354a5f..77aaa39ea2 100644
--- a/src/plugins/mercurial/mercurial.qbs
+++ b/src/plugins/mercurial/mercurial.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/mercurial/srcdestdialog.ui b/src/plugins/mercurial/srcdestdialog.ui
index 3d20f31f68..b560d4857d 100644
--- a/src/plugins/mercurial/srcdestdialog.ui
+++ b/src/plugins/mercurial/srcdestdialog.ui
@@ -36,7 +36,7 @@
<item row="2" column="0">
<widget class="QRadioButton" name="urlButton">
<property name="toolTip">
- <string>e.g. https://[user[:pass]@]host[:port]/[path]</string>
+ <string>For example: 'https://[user[:pass]@]host[:port]/[path]'.</string>
</property>
<property name="text">
<string>Specify URL:</string>
@@ -56,7 +56,7 @@
<bool>false</bool>
</property>
<property name="toolTip">
- <string>e.g. https://[user[:pass]@]host[:port]/[path]</string>
+ <string>For example: 'https://[user[:pass]@]host[:port]/[path]'.</string>
</property>
</widget>
</item>
diff --git a/src/plugins/perforce/perforce.qbs b/src/plugins/perforce/perforce.qbs
index 6999147c9e..2a0ac5bd98 100644
--- a/src/plugins/perforce/perforce.qbs
+++ b/src/plugins/perforce/perforce.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp
index 641590ae58..5bfae7a878 100644
--- a/src/plugins/perforce/perforceplugin.cpp
+++ b/src/plugins/perforce/perforceplugin.cpp
@@ -462,7 +462,7 @@ void PerforcePlugin::revertCurrentFile()
bool doNotRevert = false;
if (!result.stdOut.isEmpty())
- doNotRevert = (QMessageBox::warning(0, tr("p4 revert"),
+ doNotRevert = (QMessageBox::warning(Core::ICore::dialogParent(), tr("p4 revert"),
tr("The file has been changed. Do you want to revert it?"),
QMessageBox::Yes, QMessageBox::No) == QMessageBox::No);
if (doNotRevert)
@@ -514,7 +514,7 @@ void PerforcePlugin::revertCurrentProject()
QTC_ASSERT(state.hasProject(), return);
const QString msg = tr("Do you want to revert all changes to the project \"%1\"?").arg(state.currentProjectName());
- if (QMessageBox::warning(0, tr("p4 revert"), msg, QMessageBox::Yes, QMessageBox::No) == QMessageBox::No)
+ if (QMessageBox::warning(Core::ICore::dialogParent(), tr("p4 revert"), msg, QMessageBox::Yes, QMessageBox::No) == QMessageBox::No)
return;
revertProject(state.currentProjectTopLevel(), perforceRelativeProjectDirectory(state), false);
}
diff --git a/src/plugins/projectexplorer/customtoolchain.cpp b/src/plugins/projectexplorer/customtoolchain.cpp
index 104da390d4..033dffa2e4 100644
--- a/src/plugins/projectexplorer/customtoolchain.cpp
+++ b/src/plugins/projectexplorer/customtoolchain.cpp
@@ -495,7 +495,7 @@ CustomToolChainConfigWidget::CustomToolChainConfigWidget(CustomToolChain *tc) :
QHBoxLayout *parserLayout = new QHBoxLayout(parserLayoutWidget);
parserLayout->setContentsMargins(0, 0, 0, 0);
m_predefinedMacros->setTabChangesFocus(true);
- m_predefinedMacros->setToolTip(tr("Each line defines a macro. Format is MACRO[=VALUE]"));
+ m_predefinedMacros->setToolTip(tr("Each line defines a macro. Format is MACRO[=VALUE]."));
m_headerPaths->setTabChangesFocus(true);
m_headerPaths->setToolTip(tr("Each line adds a global header lookup path."));
m_cxx11Flags->setToolTip(tr("Comma-separated list of flags that turn on C++11 support."));
diff --git a/src/plugins/projectexplorer/dependenciespanel.cpp b/src/plugins/projectexplorer/dependenciespanel.cpp
index 3982d0e383..c10e66f747 100644
--- a/src/plugins/projectexplorer/dependenciespanel.cpp
+++ b/src/plugins/projectexplorer/dependenciespanel.cpp
@@ -32,6 +32,7 @@
#include "session.h"
#include <coreplugin/fileiconprovider.h>
+#include <coreplugin/icore.h>
#include <utils/detailswidget.h>
#include <QDebug>
@@ -114,7 +115,7 @@ bool DependenciesModel::setData(const QModelIndex &index, const QVariant &value,
emit dataChanged(index, index);
return true;
} else {
- QMessageBox::warning(0, QCoreApplication::translate("DependenciesModel", "Unable to Add Dependency"),
+ QMessageBox::warning(Core::ICore::dialogParent(), QCoreApplication::translate("DependenciesModel", "Unable to Add Dependency"),
QCoreApplication::translate("DependenciesModel", "This would create a circular dependency."));
}
} else if (c == Qt::Unchecked) {
diff --git a/src/plugins/projectexplorer/kit.cpp b/src/plugins/projectexplorer/kit.cpp
index b1a7c70a1f..b2a48ad379 100644
--- a/src/plugins/projectexplorer/kit.cpp
+++ b/src/plugins/projectexplorer/kit.cpp
@@ -54,6 +54,7 @@ const char SDK_PROVIDED_KEY[] = "PE.Profile.SDK";
const char DATA_KEY[] = "PE.Profile.Data";
const char ICON_KEY[] = "PE.Profile.Icon";
const char MUTABLE_INFO_KEY[] = "PE.Profile.MutableInfo";
+const char STICKY_INFO_KEY[] = "PE.Profile.StickyInfo";
} // namespace
@@ -151,6 +152,10 @@ Kit::Kit(const QVariantMap &data) :
QStringList mutableInfoList = data.value(QLatin1String(MUTABLE_INFO_KEY)).toStringList();
foreach (const QString &mutableInfo, mutableInfoList)
d->m_mutable.insert(Core::Id::fromString(mutableInfo));
+
+ QStringList stickyInfoList = data.value(QLatin1String(STICKY_INFO_KEY)).toStringList();
+ foreach (const QString &stickyInfo, stickyInfoList)
+ d->m_sticky.insert(Core::Id::fromString(stickyInfo));
}
Kit::~Kit()
@@ -437,6 +442,11 @@ QVariantMap Kit::toMap() const
mutableInfo << id.toString();
data.insert(QLatin1String(MUTABLE_INFO_KEY), mutableInfo);
+ QStringList stickyInfo;
+ foreach (const Core::Id &id, d->m_sticky)
+ stickyInfo << id.toString();
+ data.insert(QLatin1String(STICKY_INFO_KEY), stickyInfo);
+
QVariantMap extra;
const IdVariantConstIt cend = d->m_data.constEnd();
diff --git a/src/plugins/projectexplorer/kitinformationconfigwidget.cpp b/src/plugins/projectexplorer/kitinformationconfigwidget.cpp
index a5d119dd1a..dffc0d31ab 100644
--- a/src/plugins/projectexplorer/kitinformationconfigwidget.cpp
+++ b/src/plugins/projectexplorer/kitinformationconfigwidget.cpp
@@ -90,7 +90,7 @@ void SysRootInformationConfigWidget::refresh()
void SysRootInformationConfigWidget::makeReadOnly()
{
- m_chooser->setEnabled(false);
+ m_chooser->setReadOnly(true);
}
QWidget *SysRootInformationConfigWidget::mainWidget() const
diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp
index b706012ff1..80613b7d1f 100644
--- a/src/plugins/projectexplorer/msvctoolchain.cpp
+++ b/src/plugins/projectexplorer/msvctoolchain.cpp
@@ -190,6 +190,8 @@ QByteArray MsvcToolChain::msvcPredefinedMacros(const QStringList cxxflags,
predefinedMacros += "#undef ";
predefinedMacros += arg.mid(2).toLocal8Bit();
predefinedMacros += '\n';
+ } else if (arg.startsWith(QLatin1String("-I"))) {
+ // Include paths should not have any effect on defines
} else {
toProcess.append(arg);
}
diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp
index 61669ea6b4..a3aab42bbd 100644
--- a/src/plugins/projectexplorer/projectexplorer.cpp
+++ b/src/plugins/projectexplorer/projectexplorer.cpp
@@ -2785,6 +2785,12 @@ QString pathOrDirectoryFor(Node *node, bool dir)
list << f->path() + QLatin1Char('/');
location = Utils::commonPath(list);
}
+
+ QFileInfo fi(location);
+ while ((!fi.exists() || !fi.isDir())
+ && !fi.isRoot())
+ fi.setFile(fi.absolutePath());
+ location = fi.absoluteFilePath();
} else {
QFileInfo fi(path);
// remove any /suffixes, which e.g. ResourceNode uses
diff --git a/src/plugins/projectexplorer/projectexplorer.qbs b/src/plugins/projectexplorer/projectexplorer.qbs
index 1b7c4dfdf9..9ecac8b701 100644
--- a/src/plugins/projectexplorer/projectexplorer.qbs
+++ b/src/plugins/projectexplorer/projectexplorer.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcFunctions
import QtcPlugin
diff --git a/src/plugins/projectexplorer/projectexplorersettingspage.ui b/src/plugins/projectexplorer/projectexplorersettingspage.ui
index 8f7816f84c..55bb9fad10 100644
--- a/src/plugins/projectexplorer/projectexplorersettingspage.ui
+++ b/src/plugins/projectexplorer/projectexplorersettingspage.ui
@@ -175,7 +175,7 @@
<item row="6" column="0">
<widget class="QCheckBox" name="promptToStopRunControlCheckBox">
<property name="toolTip">
- <string>Ask before terminating the running application in response to clicking the stop button in Application Output.</string>
+ <string>Asks before terminating the running application in response to clicking the stop button in Application Output.</string>
</property>
<property name="text">
<string>Always ask before stopping applications</string>
diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp
index 6ab2786edb..5eece06532 100644
--- a/src/plugins/projectexplorer/projectmodels.cpp
+++ b/src/plugins/projectexplorer/projectmodels.cpp
@@ -175,11 +175,11 @@ FlatModel::FlatModel(SessionNode *rootNode, QObject *parent)
NodesWatcher *watcher = new NodesWatcher(this);
m_rootNode->registerWatcher(watcher);
- connect(watcher, SIGNAL(aboutToChangeHasBuildTargets(ProjectExplorer::ProjectNode*)),
- this, SLOT(aboutToHasBuildTargetsChanged(ProjectExplorer::ProjectNode*)));
+ connect(watcher, SIGNAL(aboutToChangeShowInSimpleTree(ProjectExplorer::FolderNode*)),
+ this, SLOT(aboutToShowInSimpleTreeChanged(ProjectExplorer::FolderNode*)));
- connect(watcher, SIGNAL(hasBuildTargetsChanged(ProjectExplorer::ProjectNode*)),
- this, SLOT(hasBuildTargetsChanged(ProjectExplorer::ProjectNode*)));
+ connect(watcher, SIGNAL(showInSimpleTreeChanged(ProjectExplorer::FolderNode*)),
+ this, SLOT(showInSimpleTreeChanged(ProjectExplorer::FolderNode*)));
connect(watcher, SIGNAL(foldersAboutToBeAdded(FolderNode*,QList<FolderNode*>)),
this, SLOT(foldersAboutToBeAdded(FolderNode*,QList<FolderNode*>)));
@@ -566,14 +566,9 @@ FolderNode *FlatModel::visibleFolderNode(FolderNode *node) const
bool FlatModel::filter(Node *node) const
{
bool isHidden = false;
- if (node->nodeType() == SessionNodeType) {
- isHidden = false;
- } else if (ProjectNode *projectNode = qobject_cast<ProjectNode*>(node)) {
- if (m_filterProjects && projectNode->parentFolderNode() != m_rootNode)
- isHidden = !projectNode->hasBuildTargets();
- } else if (node->nodeType() == FolderNodeType || node->nodeType() == VirtualFolderNodeType) {
+ if (FolderNode *folderNode = qobject_cast<FolderNode*>(node)) {
if (m_filterProjects)
- isHidden = true;
+ isHidden = !folderNode->showInSimpleTree();
} else if (FileNode *fileNode = qobject_cast<FileNode*>(node)) {
if (m_filterGeneratedFiles)
isHidden = fileNode->isGenerated();
@@ -762,7 +757,7 @@ void FlatModel::removed(FolderNode* parentNode, const QList<Node*> &newNodeList)
}
}
-void FlatModel::aboutToHasBuildTargetsChanged(ProjectExplorer::ProjectNode* node)
+void FlatModel::aboutToShowInSimpleTreeChanged(ProjectExplorer::FolderNode* node)
{
if (!m_filterProjects)
return;
@@ -777,7 +772,7 @@ void FlatModel::aboutToHasBuildTargetsChanged(ProjectExplorer::ProjectNode* node
m_childNodes.remove(fn);
}
-void FlatModel::hasBuildTargetsChanged(ProjectExplorer::ProjectNode *node)
+void FlatModel::showInSimpleTreeChanged(ProjectExplorer::FolderNode *node)
{
if (!m_filterProjects)
return;
diff --git a/src/plugins/projectexplorer/projectmodels.h b/src/plugins/projectexplorer/projectmodels.h
index bcddc21153..98d83649b9 100644
--- a/src/plugins/projectexplorer/projectmodels.h
+++ b/src/plugins/projectexplorer/projectmodels.h
@@ -78,8 +78,8 @@ public slots:
void setGeneratedFilesFilterEnabled(bool filter);
private slots:
- void aboutToHasBuildTargetsChanged(ProjectExplorer::ProjectNode *node);
- void hasBuildTargetsChanged(ProjectExplorer::ProjectNode *node);
+ void aboutToShowInSimpleTreeChanged(ProjectExplorer::FolderNode *node);
+ void showInSimpleTreeChanged(ProjectExplorer::FolderNode *node);
void foldersAboutToBeAdded(FolderNode *parentFolder, const QList<FolderNode*> &newFolders);
void foldersAdded();
diff --git a/src/plugins/projectexplorer/projectnodes.cpp b/src/plugins/projectexplorer/projectnodes.cpp
index a9401f40d2..e3470d259b 100644
--- a/src/plugins/projectexplorer/projectnodes.cpp
+++ b/src/plugins/projectexplorer/projectnodes.cpp
@@ -509,6 +509,23 @@ void FolderNode::removeFolderNodes(const QList<FolderNode*> &subFolders)
emit watcher->foldersRemoved();
}
+void FolderNode::aboutToChangeShowInSimpleTree()
+{
+ foreach (NodesWatcher *watcher, projectNode()->watchers())
+ emit watcher->aboutToChangeShowInSimpleTree(this);
+}
+
+void FolderNode::showInSimpleTreeChanged()
+{
+ foreach (NodesWatcher *watcher, projectNode()->watchers())
+ emit watcher->showInSimpleTreeChanged(this);
+}
+
+bool FolderNode::showInSimpleTree() const
+{
+ return false;
+}
+
/*!
\class ProjectExplorer::VirtualFolderNode
@@ -572,18 +589,6 @@ QList<ProjectNode*> ProjectNode::subProjectNodes() const
return m_subProjectNodes;
}
-void ProjectNode::aboutToChangeHasBuildTargets()
-{
- foreach (NodesWatcher *watcher, watchers())
- emit watcher->aboutToChangeHasBuildTargets(this);
-}
-
-void ProjectNode::hasBuildTargetsChanged()
-{
- foreach (NodesWatcher *watcher, watchers())
- emit watcher->hasBuildTargetsChanged(this);
-}
-
/*!
\function bool ProjectNode::addSubProjects(const QStringList &)
*/
@@ -790,6 +795,11 @@ void SessionNode::accept(NodesVisitor *visitor)
project->accept(visitor);
}
+bool SessionNode::showInSimpleTree() const
+{
+ return true;
+}
+
QList<ProjectNode*> SessionNode::projectNodes() const
{
return m_projectNodes;
diff --git a/src/plugins/projectexplorer/projectnodes.h b/src/plugins/projectexplorer/projectnodes.h
index 6661dfa0af..d6dd28dfb8 100644
--- a/src/plugins/projectexplorer/projectnodes.h
+++ b/src/plugins/projectexplorer/projectnodes.h
@@ -193,12 +193,19 @@ public:
virtual AddNewInformation addNewInformation(const QStringList &files, Node *context) const;
+
+ // determines if node will be shown in the flat view, by default folder and projects aren't shown
+ void aboutToChangeShowInSimpleTree();
+ void showInSimpleTreeChanged();
+ virtual bool showInSimpleTree() const;
+
void addFileNodes(const QList<FileNode*> &files);
void removeFileNodes(const QList<FileNode*> &files);
void addFolderNodes(const QList<FolderNode*> &subFolders);
void removeFolderNodes(const QList<FolderNode*> &subFolders);
+
protected:
QList<FolderNode*> m_subFolderNodes;
QList<FileNode*> m_fileNodes;
@@ -233,12 +240,6 @@ public:
// all subFolders that are projects
QList<ProjectNode*> subProjectNodes() const;
- // determines if the project will be shown in the flat view
- // TODO find a better name
- void aboutToChangeHasBuildTargets();
- void hasBuildTargetsChanged();
- virtual bool hasBuildTargets() const = 0;
-
virtual bool canAddSubProject(const QString &proFilePath) const = 0;
virtual bool addSubProjects(const QStringList &proFilePaths) = 0;
@@ -300,6 +301,7 @@ public:
bool isEnabled() const { return true; }
+ bool showInSimpleTree() const;
protected:
void addProjectNodes(const QList<ProjectNode*> &projectNodes);
void removeProjectNodes(const QList<ProjectNode*> &projectNodes);
@@ -325,8 +327,8 @@ signals:
void nodeUpdated(ProjectExplorer::Node *node);
// projects
- void aboutToChangeHasBuildTargets(ProjectExplorer::ProjectNode*);
- void hasBuildTargetsChanged(ProjectExplorer::ProjectNode *node);
+ void aboutToChangeShowInSimpleTree(ProjectExplorer::FolderNode*);
+ void showInSimpleTreeChanged(ProjectExplorer::FolderNode *node);
// folders & projects
void foldersAboutToBeAdded(FolderNode *parentFolder,
diff --git a/src/plugins/projectexplorer/removetaskhandler.cpp b/src/plugins/projectexplorer/removetaskhandler.cpp
index d2c7d7ba82..2f8ea19bae 100644
--- a/src/plugins/projectexplorer/removetaskhandler.cpp
+++ b/src/plugins/projectexplorer/removetaskhandler.cpp
@@ -44,7 +44,7 @@ void RemoveTaskHandler::handle(const ProjectExplorer::Task &task)
QAction *RemoveTaskHandler::createAction(QObject *parent) const
{
QAction *removeAction = new QAction(tr("Remove", "Name of the action triggering the removetaskhandler"), parent);
- removeAction->setToolTip(tr("Remove task from the task list"));
+ removeAction->setToolTip(tr("Remove task from the task list."));
removeAction->setShortcut(QKeySequence(QKeySequence::Delete));
removeAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
return removeAction;
diff --git a/src/plugins/projectexplorer/session.cpp b/src/plugins/projectexplorer/session.cpp
index c6f6f49e55..3a164ed3bc 100644
--- a/src/plugins/projectexplorer/session.cpp
+++ b/src/plugins/projectexplorer/session.cpp
@@ -395,7 +395,7 @@ bool SessionManager::save()
bool result = d->m_writer->save(data, Core::ICore::mainWindow());
if (!result) {
- QMessageBox::warning(0, tr("Error while saving session"),
+ QMessageBox::warning(ICore::dialogParent(), tr("Error while saving session"),
tr("Could not save session to file %1").arg(d->m_writer->fileName().toUserOutput()));
}
@@ -864,7 +864,7 @@ bool SessionManager::loadSession(const QString &session)
PersistentSettingsReader reader;
if (fileName.toFileInfo().exists()) {
if (!reader.load(fileName)) {
- QMessageBox::warning(0, tr("Error while restoring session"),
+ QMessageBox::warning(ICore::dialogParent(), tr("Error while restoring session"),
tr("Could not restore session %1").arg(fileName.toUserOutput()));
return false;
}
diff --git a/src/plugins/projectexplorer/sessiondialog.ui b/src/plugins/projectexplorer/sessiondialog.ui
index 9a9ad068df..e677951d98 100644
--- a/src/plugins/projectexplorer/sessiondialog.ui
+++ b/src/plugins/projectexplorer/sessiondialog.ui
@@ -88,7 +88,7 @@
<item row="1" column="0">
<widget class="QCheckBox" name="autoLoadCheckBox">
<property name="toolTip">
- <string>Automatically restore the last session when Qt Creator is started.</string>
+ <string>Automatically restores the last session when Qt Creator is started.</string>
</property>
<property name="text">
<string>Restore last session on startup</string>
diff --git a/src/plugins/projectexplorer/toolchainoptionspage.cpp b/src/plugins/projectexplorer/toolchainoptionspage.cpp
index aa5a3fffbd..fb2e03a09f 100644
--- a/src/plugins/projectexplorer/toolchainoptionspage.cpp
+++ b/src/plugins/projectexplorer/toolchainoptionspage.cpp
@@ -34,6 +34,7 @@
#include "toolchainconfigwidget.h"
#include "toolchainmanager.h"
+#include <coreplugin/icore.h>
#include <extensionsystem/pluginmanager.h>
#include <utils/detailswidget.h>
@@ -308,7 +309,7 @@ void ToolChainModel::apply()
qDeleteAll(m_toAddList);
if (removedTcs.count() == 1) {
- QMessageBox::warning(0,
+ QMessageBox::warning(Core::ICore::dialogParent(),
tr("Duplicate Compilers Detected"),
tr("The following compiler was already configured:<br>"
"&nbsp;%1<br>"
@@ -316,7 +317,7 @@ void ToolChainModel::apply()
.arg(removedTcs.at(0)));
} else if (!removedTcs.isEmpty()) {
- QMessageBox::warning(0,
+ QMessageBox::warning(Core::ICore::dialogParent(),
tr("Duplicate Compilers Detected"),
tr("The following compilers were already configured:<br>"
"&nbsp;%1<br>"
diff --git a/src/plugins/projectexplorer/vcsannotatetaskhandler.cpp b/src/plugins/projectexplorer/vcsannotatetaskhandler.cpp
index 37b9481610..58c2168a13 100644
--- a/src/plugins/projectexplorer/vcsannotatetaskhandler.cpp
+++ b/src/plugins/projectexplorer/vcsannotatetaskhandler.cpp
@@ -66,7 +66,7 @@ void VcsAnnotateTaskHandler::handle(const Task &task)
QAction *VcsAnnotateTaskHandler::createAction(QObject *parent) const
{
QAction *vcsannotateAction = new QAction(tr("&Annotate"), parent);
- vcsannotateAction->setToolTip(tr("Annotate using version control system"));
+ vcsannotateAction->setToolTip(tr("Annotate using version control system."));
return vcsannotateAction;
}
diff --git a/src/plugins/pythoneditor/pythoneditor.qbs b/src/plugins/pythoneditor/pythoneditor.qbs
index c7e5c3b685..f7452298c5 100644
--- a/src/plugins/pythoneditor/pythoneditor.qbs
+++ b/src/plugins/pythoneditor/pythoneditor.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/qbsprojectmanager/qbsnodes.cpp b/src/plugins/qbsprojectmanager/qbsnodes.cpp
index 8ea6551dcd..213fd4afe3 100644
--- a/src/plugins/qbsprojectmanager/qbsnodes.cpp
+++ b/src/plugins/qbsprojectmanager/qbsnodes.cpp
@@ -250,7 +250,7 @@ QbsBaseProjectNode::QbsBaseProjectNode(const QString &path) :
ProjectExplorer::ProjectNode(path)
{ }
-bool QbsBaseProjectNode::hasBuildTargets() const
+bool QbsBaseProjectNode::showInSimpleTree() const
{
return false;
}
@@ -493,7 +493,7 @@ bool QbsProductNode::isEnabled() const
return m_qbsProductData.isEnabled();
}
-bool QbsProductNode::hasBuildTargets() const
+bool QbsProductNode::showInSimpleTree() const
{
return true;
}
@@ -666,6 +666,11 @@ const qbs::ProjectData QbsProjectNode::qbsProjectData() const
return m_qbsProjectData;
}
+bool QbsProjectNode::showInSimpleTree() const
+{
+ return true;
+}
+
void QbsProjectNode::ctor()
{
if (m_projectIcon.isNull())
diff --git a/src/plugins/qbsprojectmanager/qbsnodes.h b/src/plugins/qbsprojectmanager/qbsnodes.h
index fe8ed9a65d..fe4315b63f 100644
--- a/src/plugins/qbsprojectmanager/qbsnodes.h
+++ b/src/plugins/qbsprojectmanager/qbsnodes.h
@@ -74,7 +74,7 @@ class QbsBaseProjectNode : public ProjectExplorer::ProjectNode
public:
explicit QbsBaseProjectNode(const QString &path);
- bool hasBuildTargets() const;
+ bool showInSimpleTree() const;
QList<ProjectExplorer::ProjectAction> supportedActions(Node *node) const;
@@ -138,7 +138,7 @@ public:
explicit QbsProductNode(const qbs::ProductData &prd);
bool isEnabled() const;
- bool hasBuildTargets() const;
+ bool showInSimpleTree() const;
void setQbsProductData(const qbs::ProductData prd);
const qbs::ProductData qbsProductData() const { return m_qbsProductData; }
@@ -172,6 +172,7 @@ public:
const qbs::Project qbsProject() const;
const qbs::ProjectData qbsProjectData() const;
+ bool showInSimpleTree() const;
private:
void ctor();
diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanager.qbs b/src/plugins/qbsprojectmanager/qbsprojectmanager.qbs
index 1d12592c82..4ef8fee1fb 100644
--- a/src/plugins/qbsprojectmanager/qbsprojectmanager.qbs
+++ b/src/plugins/qbsprojectmanager/qbsprojectmanager.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import qbs.FileInfo
import QtcPlugin
diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.cpp b/src/plugins/qmakeprojectmanager/qmakenodes.cpp
index 8589fe4977..1ec71254ff 100644
--- a/src/plugins/qmakeprojectmanager/qmakenodes.cpp
+++ b/src/plugins/qmakeprojectmanager/qmakenodes.cpp
@@ -1568,9 +1568,9 @@ bool QmakeProFileNode::isParent(QmakeProFileNode *node)
return false;
}
-bool QmakeProFileNode::hasBuildTargets() const
+bool QmakeProFileNode::showInSimpleTree() const
{
- return hasBuildTargets(projectType());
+ return showInSimpleTree(projectType()) || m_project->rootProjectNode() == this;
}
ProjectExplorer::FolderNode::AddNewInformation QmakeProFileNode::addNewInformation(const QStringList &files, Node *context) const
@@ -1579,7 +1579,7 @@ ProjectExplorer::FolderNode::AddNewInformation QmakeProFileNode::addNewInformati
return AddNewInformation(QFileInfo(path()).fileName(), context == this ? 120 : 100);
}
-bool QmakeProFileNode::hasBuildTargets(QmakeProjectType projectType) const
+bool QmakeProFileNode::showInSimpleTree(QmakeProjectType projectType) const
{
return (projectType == ApplicationTemplate || projectType == LibraryTemplate);
}
@@ -1789,15 +1789,15 @@ void QmakeProFileNode::applyEvaluate(EvalResult evalResult, bool async)
removeProjectNodes(subProjectNodes());
removeFolderNodes(subFolderNodes());
- bool changesHasBuildTargets = hasBuildTargets() ^ hasBuildTargets(projectType);
+ bool changesShowInSimpleTree = showInSimpleTree() ^ showInSimpleTree(projectType);
- if (changesHasBuildTargets)
- aboutToChangeHasBuildTargets();
+ if (changesShowInSimpleTree)
+ aboutToChangeShowInSimpleTree();
m_projectType = projectType;
- if (changesHasBuildTargets)
- hasBuildTargetsChanged();
+ if (changesShowInSimpleTree)
+ showInSimpleTreeChanged();
// really emit here? or at the end? Nobody is connected to this signal at the moment
// so we kind of can ignore that question for now
diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.h b/src/plugins/qmakeprojectmanager/qmakenodes.h
index 71e78b169e..305d16380c 100644
--- a/src/plugins/qmakeprojectmanager/qmakenodes.h
+++ b/src/plugins/qmakeprojectmanager/qmakenodes.h
@@ -147,7 +147,7 @@ public:
// ProjectNode interface
QList<ProjectExplorer::ProjectAction> supportedActions(Node *node) const;
- bool hasBuildTargets() const { return false; }
+ bool showInSimpleTree() const { return false; }
bool canAddSubProject(const QString &proFilePath) const;
@@ -366,7 +366,7 @@ public:
bool isParent(QmakeProFileNode *node);
- bool hasBuildTargets() const;
+ bool showInSimpleTree() const;
AddNewInformation addNewInformation(const QStringList &files, Node *context) const;
@@ -404,7 +404,7 @@ public:
bool validParse() const;
bool parseInProgress() const;
- bool hasBuildTargets(QmakeProjectType projectType) const;
+ bool showInSimpleTree(QmakeProjectType projectType) const;
bool isDebugAndRelease() const;
void setParseInProgress(bool b);
diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp
index 94f4396ada..217ceddaa5 100644
--- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp
+++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp
@@ -42,6 +42,7 @@
#include "wizards/html5app.h"
#include <coreplugin/icontext.h>
+#include <coreplugin/icore.h>
#include <coreplugin/progressmanager/progressmanager.h>
#include <coreplugin/documentmanager.h>
#include <cpptools/cppmodelmanagerinterface.h>
@@ -101,7 +102,7 @@ void updateBoilerPlateCodeFiles(const AbstractMobileApp *app, const QString &pro
"outdated or have been modified:<br><br>%2<br><br>Do you want "
"Qt Creator to update the files? Any changes will be lost.")
.arg(nativeProFile, fileNames.join(QLatin1String(", ")));
- if (QMessageBox::question(0, title, message, QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
+ if (QMessageBox::question(Core::ICore::dialogParent(), title, message, QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
QString error;
if (!app->updateFiles(updates, error))
QMessageBox::critical(0, title, error);
diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectmanager.qbs b/src/plugins/qmakeprojectmanager/qmakeprojectmanager.qbs
index e41dfdc770..4d7af8f967 100644
--- a/src/plugins/qmakeprojectmanager/qmakeprojectmanager.qbs
+++ b/src/plugins/qmakeprojectmanager/qmakeprojectmanager.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp
index e17b470872..cea39f8b5d 100644
--- a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp
+++ b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp
@@ -31,7 +31,6 @@
#include "modelnodecontextmenu_helper.h"
#include <cmath>
-#include <QMessageBox>
#include <QByteArray>
#include <nodeabstractproperty.h>
#include <nodemetainfo.h>
@@ -184,7 +183,7 @@ void toFront(const SelectionContext &selectionState)
node.setVariantProperty("z", maximumZ);
}
} catch (RewritingException &e) { //better save then sorry
- QMessageBox::warning(0, "Error", e.description());
+ e.showException();
}
}
@@ -202,7 +201,7 @@ void toBack(const SelectionContext &selectionState)
}
} catch (RewritingException &e) { //better save then sorry
- QMessageBox::warning(0, "Error", e.description());
+ e.showException();
}
}
@@ -222,7 +221,7 @@ void raise(const SelectionContext &selectionState)
}
}
} catch (RewritingException &e) { //better save then sorry
- QMessageBox::warning(0, "Error", e.description());
+ e.showException();
}
}
@@ -243,7 +242,7 @@ void lower(const SelectionContext &selectionState)
}
}
} catch (RewritingException &e) { //better save then sorry
- QMessageBox::warning(0, "Error", e.description());
+ e.showException();
}
}
@@ -267,7 +266,7 @@ void setVisible(const SelectionContext &selectionState)
try {
selectionState.selectedModelNodes().first().variantProperty("visible").setValue(selectionState.toggled());
} catch (RewritingException &e) { //better save then sorry
- QMessageBox::warning(0, "Error", e.description());
+ e.showException();
}
}
@@ -280,7 +279,7 @@ void setFillWidth(const SelectionContext &selectionState)
try {
selectionState.firstSelectedModelNode().variantProperty("Layout.fillWidth").setValue(selectionState.toggled());
} catch (RewritingException &e) { //better save then sorry
- QMessageBox::warning(0, "Error", e.description());
+ e.showException();
}
}
@@ -293,7 +292,7 @@ void setFillHeight(const SelectionContext &selectionState)
try {
selectionState.firstSelectedModelNode().variantProperty("Layout.fillHeight").setValue(selectionState.toggled());
} catch (RewritingException &e) { //better save then sorry
- QMessageBox::warning(0, "Error", e.description());
+ e.showException();
}
}
@@ -309,7 +308,7 @@ void resetSize(const SelectionContext &selectionState)
node.removeProperty("height");
}
} catch (RewritingException &e) { //better save then sorry
- QMessageBox::warning(0, "Error", e.description());
+ e.showException();
}
}
@@ -325,7 +324,7 @@ void resetPosition(const SelectionContext &selectionState)
node.removeProperty("y");
}
} catch (RewritingException &e) { //better save then sorry
- QMessageBox::warning(0, "Error", e.description());
+ e.showException();
}
}
@@ -390,7 +389,7 @@ void anchorsFill(const SelectionContext &selectionState)
transaction.commit();
} catch (RewritingException &e) { //better save then sorry
- QMessageBox::warning(0, "Error", e.description());
+ e.showException();
}
}
diff --git a/src/plugins/qmldesigner/components/formeditor/dragtool.cpp b/src/plugins/qmldesigner/components/formeditor/dragtool.cpp
index 8c08d7da65..a5eaa09287 100644
--- a/src/plugins/qmldesigner/components/formeditor/dragtool.cpp
+++ b/src/plugins/qmldesigner/components/formeditor/dragtool.cpp
@@ -38,7 +38,6 @@
#include <QGraphicsSceneMouseEvent>
#include <QDebug>
#include <QMimeData>
-#include <QMessageBox>
#include <QTimer>
namespace QmlDesigner {
@@ -275,7 +274,7 @@ void DragTool::commitTransaction()
try {
m_rewriterTransaction.commit();
} catch (RewritingException &e) {
- QMessageBox::warning(0, "Error", e.description());
+ e.showException();
}
}
diff --git a/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp b/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp
index 805948f053..07bd634dbf 100644
--- a/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp
+++ b/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp
@@ -233,29 +233,18 @@ void FormEditorItem::paintBoundingRect(QPainter *painter) const
painter->drawRect(m_boundingRect.adjusted(0., 0., -1., -1.));
}
-void FormEditorItem::paintPlaceHolderForInvisbleItem(QPainter *painter) const
+static void paintTextInPlaceHolderForInvisbleItem(QPainter *painter,
+ const QString &id,
+ const QString &typeName,
+ const QRectF &boundingRect)
{
- painter->save();
-
- qreal stripesWidth = 12;
-
- QRegion innerRegion = QRegion(m_boundingRect.adjusted(stripesWidth, stripesWidth, -stripesWidth, -stripesWidth).toRect());
- QRegion outerRegion = QRegion(m_boundingRect.toRect()) - innerRegion;
-
- painter->setClipRegion(outerRegion);
- painter->setClipping(true);
- painter->fillRect(m_boundingRect.adjusted(1, 1, -1, -1), Qt::BDiagPattern);
-
- QString displayText = qmlItemNode().id();
-
- if (displayText.isEmpty())
- displayText = qmlItemNode().simplifiedTypeName();
+ QString displayText = id.isEmpty() ? typeName : id;
QTextOption textOption;
textOption.setAlignment(Qt::AlignTop);
textOption.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
- if (m_boundingRect.height() > 60) {
+ if (boundingRect.height() > 60) {
QFont font;
font.setStyleHint(QFont::SansSerif);
font.setBold(true);
@@ -264,22 +253,41 @@ void FormEditorItem::paintPlaceHolderForInvisbleItem(QPainter *painter) const
QFontMetrics fm(font);
painter->rotate(90);
- if (fm.width(displayText) > (m_boundingRect.height() - 32) && displayText.length() > 4) {
+ if (fm.width(displayText) > (boundingRect.height() - 32) && displayText.length() > 4) {
- displayText = fm.elidedText(displayText, Qt::ElideRight, m_boundingRect.height() - 32, Qt::TextShowMnemonic);
+ displayText = fm.elidedText(displayText, Qt::ElideRight, boundingRect.height() - 32, Qt::TextShowMnemonic);
}
QRectF rotatedBoundingBox;
- rotatedBoundingBox.setWidth(m_boundingRect.height());
+ rotatedBoundingBox.setWidth(boundingRect.height());
rotatedBoundingBox.setHeight(12);
- rotatedBoundingBox.setY(-m_boundingRect.width() + 12);
+ rotatedBoundingBox.setY(-boundingRect.width() + 12);
rotatedBoundingBox.setX(20);
painter->setFont(font);
painter->setPen(QColor(48, 48, 96, 255));
+ painter->setClipping(false);
painter->drawText(rotatedBoundingBox, displayText, textOption);
}
+}
+void paintDecorationInPlaceHolderForInvisbleItem(QPainter *painter, const QRectF &boundingRect)
+{
+ qreal stripesWidth = 12;
+
+ QRegion innerRegion = QRegion(boundingRect.adjusted(stripesWidth, stripesWidth, -stripesWidth, -stripesWidth).toRect());
+ QRegion outerRegion = QRegion(boundingRect.toRect()) - innerRegion;
+
+ painter->setClipRegion(outerRegion);
+ painter->setClipping(true);
+ painter->fillRect(boundingRect.adjusted(1, 1, -1, -1), Qt::BDiagPattern);
+}
+
+void FormEditorItem::paintPlaceHolderForInvisbleItem(QPainter *painter) const
+{
+ painter->save();
+ paintDecorationInPlaceHolderForInvisbleItem(painter, m_boundingRect);
+ paintTextInPlaceHolderForInvisbleItem(painter, qmlItemNode().id(), qmlItemNode().simplifiedTypeName(), m_boundingRect);
painter->restore();
}
diff --git a/src/plugins/qmldesigner/components/importmanager/importmanagerview.cpp b/src/plugins/qmldesigner/components/importmanager/importmanagerview.cpp
index d7689c413e..6b75b3c4fe 100644
--- a/src/plugins/qmldesigner/components/importmanager/importmanagerview.cpp
+++ b/src/plugins/qmldesigner/components/importmanager/importmanagerview.cpp
@@ -32,8 +32,6 @@
#include <rewritingexception.h>
-#include <QMessageBox>
-
namespace QmlDesigner {
ImportManagerView::ImportManagerView(QObject *parent) :
@@ -252,7 +250,7 @@ void ImportManagerView::removeImport(const Import &import)
model()->changeImports(QList<Import>(), QList<Import>() << import);
}
catch (RewritingException &e) {
- QMessageBox::warning(0, "Error", e.description());
+ e.showException();
}
}
@@ -263,7 +261,7 @@ void ImportManagerView::addImport(const Import &import)
model()->changeImports(QList<Import>() << import, QList<Import>());
}
catch (RewritingException &e) {
- QMessageBox::warning(0, "Error", e.description());
+ e.showException();
}
}
diff --git a/src/plugins/qmldesigner/components/integration/componentaction.cpp b/src/plugins/qmldesigner/components/integration/componentaction.cpp
index 69c6718c9c..4898361838 100644
--- a/src/plugins/qmldesigner/components/integration/componentaction.cpp
+++ b/src/plugins/qmldesigner/components/integration/componentaction.cpp
@@ -54,7 +54,7 @@ QWidget *ComponentAction::createWidget(QWidget *parent)
{
QComboBox *comboBox = new QComboBox(parent);
comboBox->setMinimumWidth(120);
- comboBox->setToolTip(tr("Edit sub components defined in this file"));
+ comboBox->setToolTip(tr("Edit sub components defined in this file."));
comboBox->setModel(m_componentView->standardItemModel());
comboBox->setCurrentIndex(-1);
connect(comboBox, SIGNAL(activated(int)), SLOT(emitCurrentComponentChanged(int)));
diff --git a/src/plugins/qmldesigner/components/integration/designdocument.cpp b/src/plugins/qmldesigner/components/integration/designdocument.cpp
index e31c1147b5..39b34b4f26 100644
--- a/src/plugins/qmldesigner/components/integration/designdocument.cpp
+++ b/src/plugins/qmldesigner/components/integration/designdocument.cpp
@@ -52,7 +52,6 @@
#include <QUrl>
#include <QDebug>
-#include <QMessageBox>
#include <QPlainTextEdit>
#include <QApplication>
@@ -365,7 +364,7 @@ void DesignDocument::deleteSelected()
}
} catch (RewritingException &e) {
- QMessageBox::warning(0, tr("Error"), e.description());
+ e.showException();
}
}
diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp
index d3e15e01cd..3b685cd598 100644
--- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp
+++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp
@@ -205,7 +205,7 @@ QList<QToolButton *> ItemLibraryWidget::createToolBarWidgets()
buttons << new QToolButton();
buttons.first()->setText(tr("I "));
buttons.first()->setIcon(QIcon(QLatin1String(Core::Constants::ICON_FILTER)));
- buttons.first()->setToolTip(tr("Manage imports for components"));
+ buttons.first()->setToolTip(tr("Manage imports for components."));
buttons.first()->setPopupMode(QToolButton::InstantPopup);
QMenu * menu = new QMenu;
QAction * basicQtAction = new QAction(menu);
diff --git a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp
index 65ded05831..762c94a37a 100644
--- a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp
+++ b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp
@@ -41,6 +41,8 @@
#include <modelnodecontextmenu.h>
#include <qmlitemnode.h>
+#include <coreplugin/icore.h>
+
#include <QMimeData>
#include <QMessageBox>
#include <QApplication>
@@ -326,7 +328,7 @@ void NavigatorTreeModel::handleChangedItem(QStandardItem *item)
try {
node.setId(item->text());
} catch (InvalidIdException &e) { //better save then sorry
- QMessageBox::warning(0, tr("Invalid Id"), e.description());
+ QMessageBox::warning(Core::ICore::dialogParent(), tr("Invalid Id"), e.description());
}
} else { //there is already an id, so we refactor
if (node.view()->rewriterView())
@@ -335,9 +337,9 @@ void NavigatorTreeModel::handleChangedItem(QStandardItem *item)
} else {
if (!node.isValidId(item->text()))
- QMessageBox::warning(0, tr("Invalid Id"), tr("%1 is an invalid id.").arg(item->text()));
+ QMessageBox::warning(Core::ICore::dialogParent(), tr("Invalid Id"), tr("%1 is an invalid id.").arg(item->text()));
else
- QMessageBox::warning(0, tr("Invalid Id"), tr("%1 already exists.").arg(item->text()));
+ QMessageBox::warning(Core::ICore::dialogParent(), tr("Invalid Id"), tr("%1 already exists.").arg(item->text()));
bool blockSingals = blockItemChangedSignal(true);
item->setText(node.id());
blockItemChangedSignal(blockSingals);
@@ -535,7 +537,11 @@ void NavigatorTreeModel::moveNodesInteractive(NodeAbstractProperty parentPropert
continue;
if (propertyNode.isValid()) {
QApplication::setOverrideCursor(Qt::ArrowCursor);
- if (QMessageBox::warning(0, tr("Warning"), tr("Reparenting the component %1 here will cause the component %2 to be deleted. Do you want to proceed?").arg(node.id(), propertyNode.id()), QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Cancel) {
+ if (QMessageBox::warning(Core::ICore::dialogParent(), tr("Warning"),
+ tr("Reparenting the component %1 here will cause the "
+ "component %2 to be deleted. Do you want to proceed?")
+ .arg(node.id(), propertyNode.id()),
+ QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Cancel) {
QApplication::restoreOverrideCursor();
continue;
}
@@ -574,7 +580,7 @@ void NavigatorTreeModel::moveNodesInteractive(NodeAbstractProperty parentPropert
}
}
} catch (RewritingException &e) { //better safe than sorry! There always might be cases where we fail
- QMessageBox::warning(0, "Error", e.description());
+ e.showException();
}
}
diff --git a/src/plugins/qmldesigner/components/navigator/navigatorwidget.cpp b/src/plugins/qmldesigner/components/navigator/navigatorwidget.cpp
index 37693aa980..20117c222b 100644
--- a/src/plugins/qmldesigner/components/navigator/navigatorwidget.cpp
+++ b/src/plugins/qmldesigner/components/navigator/navigatorwidget.cpp
@@ -83,24 +83,24 @@ QList<QToolButton *> NavigatorWidget::createToolBarWidgets()
buttons << new QToolButton();
buttons.last()->setIcon(QIcon(":/navigator/icon/arrowleft.png"));
- buttons.last()->setToolTip(tr("Become first sibling of parent (CTRL + Left)"));
+ buttons.last()->setToolTip(tr("Become first sibling of parent (CTRL + Left)."));
buttons.last()->setShortcut(QKeySequence(Qt::Key_Left | Qt::CTRL));
connect(buttons.last(), SIGNAL(clicked()), this, SIGNAL(leftButtonClicked()));
buttons << new QToolButton();
buttons.last()->setIcon(QIcon(":/navigator/icon/arrowright.png"));
- buttons.last()->setToolTip(tr("Become child of first sibling (CTRL + Right)"));
+ buttons.last()->setToolTip(tr("Become child of first sibling (CTRL + Right)."));
buttons.last()->setShortcut(QKeySequence(Qt::Key_Right | Qt::CTRL));
connect(buttons.last(), SIGNAL(clicked()), this, SIGNAL(rightButtonClicked()));
buttons << new QToolButton();
buttons.last()->setIcon(QIcon(":/navigator/icon/arrowdown.png"));
- buttons.last()->setToolTip(tr("Move down (CTRL + Down)"));
+ buttons.last()->setToolTip(tr("Move down (CTRL + Down)."));
buttons.last()->setShortcut(QKeySequence(Qt::Key_Down | Qt::CTRL));
connect(buttons.last(), SIGNAL(clicked()), this, SIGNAL(downButtonClicked()));
buttons << new QToolButton();
buttons.last()->setIcon(QIcon(":/navigator/icon/arrowup.png"));
- buttons.last()->setToolTip(tr("Move up (CTRL + Up)"));
+ buttons.last()->setToolTip(tr("Move up (CTRL + Up)."));
buttons.last()->setShortcut(QKeySequence(Qt::Key_Up | Qt::CTRL));
connect(buttons.last(), SIGNAL(clicked()), this, SIGNAL(upButtonClicked()));
diff --git a/src/plugins/qmldesigner/components/propertyeditor/designerpropertymap.cpp b/src/plugins/qmldesigner/components/propertyeditor/designerpropertymap.cpp
index 4c91e28037..400211c052 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/designerpropertymap.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/designerpropertymap.cpp
@@ -31,7 +31,7 @@
namespace QmlDesigner {
-DesignerPropertyMap::DesignerPropertyMap(QObject *parent) : QQmlPropertyMap(parent), m_defaultValue(new PropertyEditorValue(this))
+DesignerPropertyMap::DesignerPropertyMap(QObject *parent) : QQmlPropertyMap(parent)
{
}
@@ -39,7 +39,7 @@ QVariant DesignerPropertyMap::value(const QString &key) const
{
if (contains(key))
return QQmlPropertyMap::value(key);
- return QVariant::fromValue(m_defaultValue);
+ return QVariant();
}
void DesignerPropertyMap::registerDeclarativeType(const QString &name)
diff --git a/src/plugins/qmldesigner/components/propertyeditor/designerpropertymap.h b/src/plugins/qmldesigner/components/propertyeditor/designerpropertymap.h
index e09e502632..a37936a295 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/designerpropertymap.h
+++ b/src/plugins/qmldesigner/components/propertyeditor/designerpropertymap.h
@@ -45,8 +45,6 @@ public:
QVariant value(const QString &key) const;
static void registerDeclarativeType(const QString &name);
-private:
- PropertyEditorValue *m_defaultValue;
};
} //QmlDesigner
diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp
index 126be7ad71..00a229d749 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp
@@ -45,6 +45,7 @@
#include <nodeabstractproperty.h>
#include <rewriterview.h>
+#include <coreplugin/icore.h>
#include <utils/fileutils.h>
#include <QCoreApplication>
@@ -155,7 +156,7 @@ void PropertyEditorView::changeValue(const QString &name)
m_locked = true;
value->setValue(m_selectedNode.id());
m_locked = false;
- QMessageBox::warning(0, tr("Invalid Id"), e.description());
+ e.showException(tr("Invalid Id"));
}
} else { //there is already an id, so we refactor
if (rewriterView())
@@ -166,9 +167,9 @@ void PropertyEditorView::changeValue(const QString &name)
value->setValue(m_selectedNode.id());
m_locked = false;
if (!m_selectedNode.isValidId(newId))
- QMessageBox::warning(0, tr("Invalid Id"), tr("%1 is an invalid id.").arg(newId));
+ QMessageBox::warning(Core::ICore::dialogParent(), tr("Invalid Id"), tr("%1 is an invalid id.").arg(newId));
else
- QMessageBox::warning(0, tr("Invalid Id"), tr("%1 already exists.").arg(newId));
+ QMessageBox::warning(Core::ICore::dialogParent(), tr("Invalid Id"), tr("%1 already exists.").arg(newId));
}
return;
}
@@ -226,7 +227,7 @@ void PropertyEditorView::changeValue(const QString &name)
}
}
catch (RewritingException &e) {
- QMessageBox::warning(0, "Error", e.description());
+ e.showException();
}
}
@@ -302,7 +303,7 @@ void PropertyEditorView::changeExpression(const QString &propertyName)
}
catch (RewritingException &e) {
- QMessageBox::warning(0, "Error", e.description());
+ e.showException();
}
}
diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp b/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp
index 9992b0fc9c..9cc907871a 100644
--- a/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp
+++ b/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp
@@ -37,6 +37,8 @@
#include <modelnode.h>
#include <variantproperty.h>
+#include <coreplugin/icore.h>
+
enum {
debug = false
};
@@ -169,7 +171,7 @@ void StatesEditorModel::renameState(int nodeId, const QString &newName)
return;
if (newName.isEmpty() ||! m_statesEditorView->validStateName(newName)) {
- QMessageBox::warning(0, tr("Invalid state name"),
+ QMessageBox::warning(Core::ICore::dialogParent(), tr("Invalid state name"),
newName.isEmpty() ?
tr("The empty string as a name is reserved for the base state.") :
tr("Name already used in another state"));
diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp
index bf01960358..b314dabd65 100644
--- a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp
+++ b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp
@@ -32,7 +32,6 @@
#include "stateseditormodel.h"
#include <rewritingexception.h>
-#include <QMessageBox>
#include <QDebug>
#include <math.h>
@@ -43,6 +42,7 @@
#include <qmlitemnode.h>
+
namespace QmlDesigner {
/**
@@ -158,7 +158,7 @@ void StatesEditorView::removeState(int nodeId)
stateNode.destroy();
}
} catch (RewritingException &e) {
- QMessageBox::warning(0, "Error", e.description());
+ e.showException();
}
}
@@ -209,7 +209,7 @@ void StatesEditorView::addState()
ModelNode newState = rootStateGroup().addState(newStateName);
setCurrentState(newState);
} catch (RewritingException &e) {
- QMessageBox::warning(0, "Error", e.description());
+ e.showException();
}
}
@@ -304,7 +304,7 @@ void StatesEditorView::renameState(int nodeId, const QString &newName)
setCurrentState(oldState);
}
} catch (RewritingException &e) {
- QMessageBox::warning(0, "Error", e.description());
+ e.showException();
}
}
}
diff --git a/src/plugins/qmldesigner/componentsplugin/Controls/RadioButtonSpecifics.qml b/src/plugins/qmldesigner/componentsplugin/Controls/RadioButtonSpecifics.qml
index 34300d3915..098f63572f 100644
--- a/src/plugins/qmldesigner/componentsplugin/Controls/RadioButtonSpecifics.qml
+++ b/src/plugins/qmldesigner/componentsplugin/Controls/RadioButtonSpecifics.qml
@@ -59,7 +59,7 @@ Column {
Label {
text: qsTr("Checked")
- toolTip: qsTr("Determines whether the radio button is checkable or not.")
+ toolTip: qsTr("Determines whether the radio button is checked or not.")
}
SecondColumnLayout {
diff --git a/src/plugins/qmldesigner/designercore/exceptions/exception.cpp b/src/plugins/qmldesigner/designercore/exceptions/exception.cpp
index 570cae6494..c00b52f024 100644
--- a/src/plugins/qmldesigner/designercore/exceptions/exception.cpp
+++ b/src/plugins/qmldesigner/designercore/exceptions/exception.cpp
@@ -34,6 +34,11 @@
#include <cxxabi.h>
#endif
+#include <coreplugin/icore.h>
+
+#include <QCoreApplication>
+#include <QMessageBox>
+
/*!
\defgroup CoreExceptions
@@ -146,6 +151,15 @@ QString Exception::description() const
}
/*!
+ Shows message in a message box.
+*/
+void Exception::showException(const QString &title) const
+{
+ QString t = title.isEmpty() ? QCoreApplication::translate("QmlDesigner", "Error") : title;
+ QMessageBox::warning(Core::ICore::dialogParent(), t, description());
+}
+
+/*!
Returns the line number where this exception was thrown as an integer.
*/
int Exception::line() const
diff --git a/src/plugins/qmldesigner/designercore/include/exception.h b/src/plugins/qmldesigner/designercore/include/exception.h
index cf739dd9fb..15bbe5144f 100644
--- a/src/plugins/qmldesigner/designercore/include/exception.h
+++ b/src/plugins/qmldesigner/designercore/include/exception.h
@@ -47,6 +47,7 @@ public:
virtual QString type() const = 0;
virtual QString description() const;
+ virtual void showException(const QString &title = QString()) const;
int line() const;
QString function() const;
diff --git a/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp b/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp
index b1262b21fe..a80d43a35a 100644
--- a/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp
+++ b/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp
@@ -73,6 +73,7 @@
#include "qmldesignerplugin.h"
+#include <coreplugin/icore.h>
#include <utils/hostosinfo.h>
#include <QMessageBox>
@@ -119,6 +120,18 @@ static bool hasQtQuick2(NodeInstanceView *nodeInstanceView)
return false;
}
+static bool hasQtQuick1(NodeInstanceView *nodeInstanceView)
+{
+ if (nodeInstanceView && nodeInstanceView->model()) {
+ foreach (const Import &import ,nodeInstanceView->model()->imports()) {
+ if (import.url() == "QtQuick" && import.version().toDouble() < 2.0)
+ return true;
+ }
+ }
+
+ return false;
+}
+
QString NodeInstanceServerProxy::creatorQmlPuppetPath()
{
QString applicationPath = QCoreApplication::applicationDirPath();
@@ -262,11 +275,13 @@ NodeInstanceServerProxy::NodeInstanceServerProxy(NodeInstanceView *nodeInstanceV
}
} else {
- QMessageBox::warning(0, tr("Cannot Start QML Puppet Executable"),
- tr("The executable of the QML Puppet process (%1) cannot be started. "
- "Please check your installation. "
- "QML Puppet is a process which runs in the background to render the items.").
- arg(applicationPath));
+ QMessageBox::warning(Core::ICore::dialogParent(),
+ tr("Cannot Start QML Puppet Executable"),
+ missingQmlPuppetErrorMessage(pathToQt,
+ tr("The executable of the QML Puppet process (%1) cannot be started. "
+ "Please check your installation. "
+ "QML Puppet is a process which runs in the background to render the items."
+ ).arg(applicationPath)));
QmlDesignerPlugin::instance()->switchToTextModeDeferred();
}
@@ -274,12 +289,21 @@ NodeInstanceServerProxy::NodeInstanceServerProxy(NodeInstanceView *nodeInstanceV
m_localServer->close();
} else {
- QMessageBox::warning(0, tr("Wrong QML Puppet Executable Version"), tr("The QML Puppet version is incompatible with the Qt Creator version."));
+ QMessageBox::warning(Core::ICore::dialogParent(),
+ tr("Wrong QML Puppet Executable Version"),
+ missingQmlPuppetErrorMessage(pathToQt,
+ tr("The QML Puppet version is incompatible with the Qt Creator version.")));
QmlDesignerPlugin::instance()->switchToTextModeDeferred();
}
} else {
- QMessageBox::warning(0, tr("Cannot Find QML Puppet Executable"), missingQmlPuppetErrorMessage(applicationPath));
- QmlDesignerPlugin::instance()->switchToTextModeDeferred();
+ QMessageBox::warning(Core::ICore::dialogParent(),
+ tr("Cannot Find QML Puppet Executable"),
+ missingQmlPuppetErrorMessage(pathToQt,
+ tr("The executable of the QML Puppet process (<code>%1</code>) cannot be found. "
+ "Check your installation. "
+ "QML Puppet is a process which runs in the background to render the items.").
+ arg(QDir::toNativeSeparators(applicationPath))) );
+ QmlDesignerPlugin::instance()->switchToTextModeDeferred();
}
int indexOfCapturePuppetStream = QCoreApplication::arguments().indexOf("-capture-puppet-stream");
@@ -356,28 +380,58 @@ NodeInstanceClientInterface *NodeInstanceServerProxy::nodeInstanceClient() const
return m_nodeInstanceView.data();
}
-QString NodeInstanceServerProxy::missingQmlPuppetErrorMessage(const QString &applicationPath) const
+static QString generatePuppetCompilingHelp(const QString &puppetName, const QString &pathToQt)
+{
+
+ QString buildDirectory = QDir::toNativeSeparators(QDir::tempPath() + QStringLiteral("/") + puppetName);
+ QString qmakePath = QDir::toNativeSeparators(pathToQt + QStringLiteral("/bin/qmake -r "));
+ QString projectPath = QDir::toNativeSeparators(sharedDirPath() + QStringLiteral("/qml/qmlpuppet/%1/%1.pro\n"));
+
+ QString puppetCompileHelp;
+
+ puppetCompileHelp.append(QStringLiteral("<p><code><pre>"));
+ puppetCompileHelp.append(QStringLiteral("mkdir ") + buildDirectory+ QStringLiteral("\n"));
+ puppetCompileHelp.append(QStringLiteral("cd ") + buildDirectory + QStringLiteral("\n"));
+ puppetCompileHelp.append(qmakePath + projectPath);
+ puppetCompileHelp.append(QStringLiteral("make"));
+ puppetCompileHelp.append(QStringLiteral("</pre></code></p>"));
+
+ puppetCompileHelp = puppetCompileHelp.arg(puppetName);
+
+ return puppetCompileHelp;
+}
+
+QString NodeInstanceServerProxy::missingQmlPuppetErrorMessage(const QString &pathToQt, const QString &preMessage) const
{
QString message;
- QTextStream str(&message);
- str << "<html><head/><body><p>"
- << tr("The executable of the QML Puppet process (<code>%1</code>) cannot be found. "
- "Check your installation. "
- "QML Puppet is a process which runs in the background to render the items.").
- arg(QDir::toNativeSeparators(applicationPath))
+ QTextStream messageStream(&message);
+ messageStream << "<html><head/><body><p>"
+ << preMessage
<< "</p>";
if (hasQtQuick2(m_nodeInstanceView.data())) {
- str << "<p>"
- << tr("You can build <code>qml2puppet</code> yourself with Qt 5.0.1 or higher. "
+ messageStream << "<p>"
+ << tr("You can build <code>qml2puppet</code> yourself with Qt 5.2.0 or higher. "
"The source can be found in <code>%1</code>.").
arg(QDir::toNativeSeparators(sharedDirPath() + QLatin1String("/qml/qmlpuppet/qml2puppet/")))
<< "</p><p>"
<< tr("<code>qml2puppet</code> will be installed to the <code>bin</code> directory of your Qt version. "
"Qt Quick Designer will check the <code>bin</code> directory of the currently active Qt version "
"of your project.")
- << "</p>";
+ << "</p>"
+ << generatePuppetCompilingHelp(QStringLiteral("qml2puppet"), pathToQt);
+ } else if (hasQtQuick1(m_nodeInstanceView.data())) {
+ messageStream << "<p>"
+ << tr("You can build <code>qml2puppet</code> yourself with Qt 5.2.0 or higher. "
+ "The source can be found in <code>%1</code>.").
+ arg(QDir::toNativeSeparators(sharedDirPath() + QLatin1String("/qml/qmlpuppet/qmlpuppet/")))
+ << "</p><p>"
+ << tr("<code>qmlpuppet</code> will be installed to the <code>bin</code> directory of your Qt version. "
+ "Qt Quick Designer will check the <code>bin</code> directory of the currently active Qt version "
+ "of your project.")
+ << "</p>"
+ << generatePuppetCompilingHelp(QStringLiteral("qmlpuppet"), pathToQt);
}
- str << "</p></body></html>";
+ messageStream << "</p></body></html>";
return message;
}
@@ -433,8 +487,9 @@ void NodeInstanceServerProxy::processFinished(int /*exitCode*/, QProcess::ExitSt
if (m_captureFileForTest.isOpen()) {
m_captureFileForTest.close();
m_captureFileForTest.remove();
- QMessageBox::warning(0, tr("QML Puppet Crashed"), tr("You are recording a puppet stream and the puppet crashed. "
- "It is recommended to reopen the Qt Quick Designer and start again."));
+ QMessageBox::warning(Core::ICore::dialogParent(), tr("QML Puppet Crashed"),
+ tr("You are recording a puppet stream and the puppet crashed. "
+ "It is recommended to reopen the Qt Quick Designer and start again."));
}
diff --git a/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.h b/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.h
index 00bef05957..7236187567 100644
--- a/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.h
+++ b/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.h
@@ -75,7 +75,7 @@ protected:
void writeCommand(const QVariant &command);
void dispatchCommand(const QVariant &command);
NodeInstanceClientInterface *nodeInstanceClient() const;
- QString missingQmlPuppetErrorMessage(const QString &applicationPath) const;
+ QString missingQmlPuppetErrorMessage(const QString &pathToQt, const QString &preMessage) const;
QString qmlPuppetApplicationName() const;
QString macOSBundlePath(const QString &path) const;
QString creatorQmlPuppetPath();
diff --git a/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp b/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp
index 5200d2ff54..6d31ef0023 100644
--- a/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp
+++ b/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp
@@ -1342,7 +1342,7 @@ bool NodeMetaInfo::isSubclassOf(const TypeName &type, int majorVersion, int mino
bool NodeMetaInfo::isGraphicalItem() const
{
- return isSubclassOf("QtQuick.Item", -1, -1) || isSubclassOf("QtQuick.Window", -1, -1);
+ return isSubclassOf("QtQuick.Item", -1, -1) || isSubclassOf("QtQuick.Window.Window", -1, -1);
}
void NodeMetaInfo::clearCache()
diff --git a/src/plugins/qmldesigner/designercore/model/abstractview.cpp b/src/plugins/qmldesigner/designercore/model/abstractview.cpp
index c59dab43b9..dac9e93c05 100644
--- a/src/plugins/qmldesigner/designercore/model/abstractview.cpp
+++ b/src/plugins/qmldesigner/designercore/model/abstractview.cpp
@@ -35,6 +35,8 @@
#include "nodeinstanceview.h"
#include <qmlstate.h>
+#include <utils/qtcassert.h>
+
namespace QmlDesigner {
@@ -326,9 +328,10 @@ ModelNode AbstractView::singleSelectedModelNode() const
/*!
Adds \a node to the selection list.
*/
-void AbstractView::selectModelNode(const ModelNode &node)
+void AbstractView::selectModelNode(const ModelNode &modelNode)
{
- model()->d->selectNode(node.internalNode());
+ QTC_ASSERT(modelNode.isInHierarchy(), return);
+ model()->d->selectNode(modelNode.internalNode());
}
/*!
diff --git a/src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp b/src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp
index 96ca55157f..3f5c06f635 100644
--- a/src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp
+++ b/src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp
@@ -42,7 +42,6 @@
#include "modelmerger.h"
#include "rewritingexception.h"
-#include <QMessageBox>
#include <QUrl>
#include <QPlainTextEdit>
#include <QFileInfo>
@@ -174,7 +173,7 @@ QmlItemNode QmlItemNode::createQmlItemNode(AbstractView *view, const ItemLibrary
Q_ASSERT(newQmlItemNode.isValid());
}
catch (RewritingException &e) {
- QMessageBox::warning(0, "Error", e.description());
+ e.showException();
}
Q_ASSERT(newQmlItemNode.isValid());
diff --git a/src/plugins/qmldesigner/designercore/model/qmltextgenerator.cpp b/src/plugins/qmldesigner/designercore/model/qmltextgenerator.cpp
index d72f804967..eb7fd78c12 100644
--- a/src/plugins/qmldesigner/designercore/model/qmltextgenerator.cpp
+++ b/src/plugins/qmldesigner/designercore/model/qmltextgenerator.cpp
@@ -127,7 +127,7 @@ QString QmlTextGenerator::toQml(const AbstractProperty &property, int indentDept
case QVariant::Color:
return QString(QLatin1String("\"%1\"")).arg(properColorName(value.value<QColor>()));
- case QMetaType::Float:
+ case static_cast<QVariant::Type>(QMetaType::Float):
case QVariant::Double:
return doubleToString(value.toDouble());
case QVariant::Int:
diff --git a/src/plugins/qmldesigner/qmldesigner.qbs b/src/plugins/qmldesigner/qmldesigner.qbs
index 092444fb79..d56f8b2b23 100644
--- a/src/plugins/qmldesigner/qmldesigner.qbs
+++ b/src/plugins/qmldesigner/qmldesigner.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/qmldesigner/qmldesignerplugin.cpp b/src/plugins/qmldesigner/qmldesignerplugin.cpp
index 25bdfa5062..a30547aa2c 100644
--- a/src/plugins/qmldesigner/qmldesignerplugin.cpp
+++ b/src/plugins/qmldesigner/qmldesignerplugin.cpp
@@ -42,7 +42,7 @@
#include <coreplugin/icore.h>
#include <coreplugin/modemanager.h>
#include <extensionsystem/pluginspec.h>
-
+#include <qmljs/qmljsmodelmanagerinterface.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <utils/hostosinfo.h>
@@ -337,25 +337,42 @@ static bool isDesignerMode(Core::IMode *mode)
return mode == Core::DesignMode::instance();
}
-void QmlDesignerPlugin::onCurrentModeChanged(Core::IMode *newMode, Core::IMode *oldMode)
+static bool checkIfEditorIsQtQuick(Core::IEditor *editor)
{
- if (!isQmlFile(Core::EditorManager::currentEditor()))
- return;
+ if (isQmlFile(Core::EditorManager::currentEditor())) {
+ QmlJS::Document::Ptr document = QmlJS::ModelManagerInterface::instance()->snapshot().document(
+ Core::EditorManager::currentEditor()->document()->filePath());
+ if (!document.isNull())
+ return document->language() == QmlJS::Language::QmlQtQuick1
+ || document->language() == QmlJS::Language::QmlQtQuick2
+ || document->language() == QmlJS::Language::Qml;
+ }
- if ((currentDesignDocument()
- && Core::EditorManager::currentEditor() == currentDesignDocument()->editor())
- && isDesignerMode(newMode))
- return;
+ return false;
+}
- if (!isDesignerMode(newMode) && isDesignerMode(oldMode))
- hideDesigner();
- else if (Core::EditorManager::currentEditor()
- && isDesignerMode(newMode)
- && isQmlFile(Core::EditorManager::currentEditor()))
- showDesigner();
- else if (currentDesignDocument())
- hideDesigner();
+static bool documentIsAlreadyOpen(DesignDocument *designDocument, Core::IEditor *editor, Core::IMode *newMode)
+{
+ return designDocument
+ && editor == designDocument->editor()
+ && isDesignerMode(newMode);
+}
+void QmlDesignerPlugin::onCurrentModeChanged(Core::IMode *newMode, Core::IMode *oldMode)
+{
+ if (Core::EditorManager::currentEditor()
+ && checkIfEditorIsQtQuick(Core::EditorManager::currentEditor())
+ && !documentIsAlreadyOpen(currentDesignDocument(), Core::EditorManager::currentEditor(), newMode)) {
+
+ if (!isDesignerMode(newMode) && isDesignerMode(oldMode))
+ hideDesigner();
+ else if (Core::EditorManager::currentEditor()
+ && isDesignerMode(newMode)
+ && isQmlFile(Core::EditorManager::currentEditor()))
+ showDesigner();
+ else if (currentDesignDocument())
+ hideDesigner();
+ }
}
DesignDocument *QmlDesignerPlugin::currentDesignDocument() const
diff --git a/src/plugins/qmljseditor/qmljseditor.qbs b/src/plugins/qmljseditor/qmljseditor.qbs
index 51e7c82c5c..67f23d2fc0 100644
--- a/src/plugins/qmljseditor/qmljseditor.qbs
+++ b/src/plugins/qmljseditor/qmljseditor.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/qmljseditor/qmljsfindreferences.cpp b/src/plugins/qmljseditor/qmljsfindreferences.cpp
index d2e2e4e875..b92341637d 100644
--- a/src/plugins/qmljseditor/qmljsfindreferences.cpp
+++ b/src/plugins/qmljseditor/qmljsfindreferences.cpp
@@ -929,7 +929,8 @@ void FindReferences::displayResults(int first, int last)
label, QString(), symbolName, Core::SearchResultWindow::SearchOnly);
} else {
m_currentSearch = Core::SearchResultWindow::instance()->startNewSearch(
- label, QString(), symbolName, Core::SearchResultWindow::SearchAndReplace);
+ label, QString(), symbolName, Core::SearchResultWindow::SearchAndReplace,
+ Core::SearchResultWindow::PreserveCaseDisabled);
m_currentSearch->setTextToReplace(replacement);
connect(m_currentSearch, SIGNAL(replaceButtonClicked(QString,QList<Core::SearchResultItem>,bool)),
SLOT(onReplaceButtonClicked(QString,QList<Core::SearchResultItem>,bool)));
diff --git a/src/plugins/qmljseditor/qmljspreviewrunner.cpp b/src/plugins/qmljseditor/qmljspreviewrunner.cpp
index a6932185b0..6a31fd6320 100644
--- a/src/plugins/qmljseditor/qmljspreviewrunner.cpp
+++ b/src/plugins/qmljseditor/qmljspreviewrunner.cpp
@@ -29,6 +29,8 @@
#include "qmljspreviewrunner.h"
+#include <coreplugin/icore.h>
+
#include <utils/environment.h>
#include <utils/hostosinfo.h>
#include <utils/qtcprocess.h>
@@ -71,7 +73,7 @@ void QmlJSPreviewRunner::run(const QString &filename)
}
if (!errorMessage.isEmpty())
- QMessageBox::warning(0, tr("Failed to preview Qt Quick file"),
+ QMessageBox::warning(Core::ICore::dialogParent(), tr("Failed to preview Qt Quick file"),
tr("Could not preview Qt Quick (QML) file. Reason:\n%1").arg(errorMessage));
}
diff --git a/src/plugins/qmljstools/qmljstools.qbs b/src/plugins/qmljstools/qmljstools.qbs
index 6fab90b4af..c49721bae7 100644
--- a/src/plugins/qmljstools/qmljstools.qbs
+++ b/src/plugins/qmljstools/qmljstools.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/qmlprofiler/qml/CategoryLabel.qml b/src/plugins/qmlprofiler/qml/CategoryLabel.qml
index 46d14a7332..5314970b63 100644
--- a/src/plugins/qmlprofiler/qml/CategoryLabel.qml
+++ b/src/plugins/qmlprofiler/qml/CategoryLabel.qml
@@ -144,7 +144,7 @@ Item {
Image {
source: expanded ? "arrow_down.png" : "arrow_right.png"
x: parent.width - 12
- y: root.singleRowHeight / 2 - height / 2
+ y: Math.floor((root.singleRowHeight - height) / 2)
smooth: false
MouseArea {
anchors.fill: parent
diff --git a/src/plugins/qmlprofiler/qml/MainView.qml b/src/plugins/qmlprofiler/qml/MainView.qml
index 808d0b79c6..c4aceb6ef9 100644
--- a/src/plugins/qmlprofiler/qml/MainView.qml
+++ b/src/plugins/qmlprofiler/qml/MainView.qml
@@ -79,7 +79,6 @@ Rectangle {
backgroundMarks.updateMarks(startTime, endTime);
view.updateFlickRange(startTime, endTime);
- flick.setContentWidth();
}
}
@@ -288,15 +287,13 @@ Rectangle {
onInteractiveChanged: interactive = stayInteractive
onStayInteractiveChanged: interactive = stayInteractive
- function setContentWidth() {
+ onContentXChanged: view.updateZoomControl()
+ onWidthChanged: {
var duration = Math.abs(zoomControl.endTime() - zoomControl.startTime());
if (duration > 0)
contentWidth = qmlProfilerModelProxy.traceDuration() * width / duration;
}
- onContentXChanged: view.updateZoomControl()
- onWidthChanged: setContentWidth()
-
// ***** child items
TimeMarks {
id: backgroundMarks
@@ -327,8 +324,15 @@ Rectangle {
onEndTimeChanged: requestPaint()
onYChanged: requestPaint()
onHeightChanged: requestPaint()
+ property bool recursionGuard: false
function updateZoomControl() {
+ // Don't updateZoomControl if we're just updating the flick range, _from_
+ // zoomControl. The other way round is OK. We _want_ the flick range to be updated
+ // on external changes to zoomControl.
+ if (recursionGuard)
+ return;
+
var newStartTime = Math.round(flick.contentX * (endTime - startTime) / flick.width) +
qmlProfilerModelProxy.traceStartTime();
if (Math.abs(newStartTime - startTime) > 1) {
@@ -341,16 +345,27 @@ Rectangle {
}
function updateFlickRange(start, end) {
- if (start !== startTime || end !== endTime) {
- startTime = start;
- endTime = end;
- if (!flick.flickingHorizontally) {
- var newStartX = (startTime - qmlProfilerModelProxy.traceStartTime()) *
- flick.width / (endTime-startTime);
- if (isFinite(newStartX) && Math.abs(newStartX - flick.contentX) >= 1)
- flick.contentX = newStartX;
- }
+ var duration = end - start;
+ if (recursionGuard || duration <= 0 || (start === startTime && end === endTime))
+ return;
+
+ recursionGuard = true;
+
+ startTime = start;
+ endTime = end;
+ if (!flick.flickingHorizontally) {
+ // This triggers an unwanted automatic change in contentX. We ignore that by
+ // checking recursionGuard in this function and in updateZoomControl.
+ flick.contentWidth = qmlProfilerModelProxy.traceDuration() * flick.width /
+ duration;
+
+ var newStartX = (startTime - qmlProfilerModelProxy.traceStartTime()) *
+ flick.width / duration;
+
+ if (isFinite(newStartX) && Math.abs(newStartX - flick.contentX) >= 1)
+ flick.contentX = newStartX;
}
+ recursionGuard = false;
}
onSelectedItemChanged: {
diff --git a/src/plugins/qmlprofiler/qmlprofiler.qbs b/src/plugins/qmlprofiler/qmlprofiler.qbs
index 1ad7fa543d..8ed3414959 100644
--- a/src/plugins/qmlprofiler/qmlprofiler.qbs
+++ b/src/plugins/qmlprofiler/qmlprofiler.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp b/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp
index 45eeaf9116..ace876168d 100644
--- a/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp
@@ -240,8 +240,6 @@ void QmlProfilerClientManager::connectToClient()
if (!d->connection || d->connection->state() != QAbstractSocket::UnconnectedState)
return;
- QmlProfilerTool::logStatus(QString::fromLatin1("QML Profiler: Connecting to %1:%2 ...")
- .arg(d->tcpHost, QString::number(d->tcpPort)));
d->connection->connectToHost(d->tcpHost, d->tcpPort);
}
@@ -309,14 +307,17 @@ void QmlProfilerClientManager::connectionStateChanged()
case QAbstractSocket::ConnectingState: {
if (QmlProfilerPlugin::debugOutput)
qWarning("QML Profiler: Connecting to debug server ...");
+ QmlProfilerTool::logStatus(tr("QML Profiler: Connecting to %1:%2 ...")
+ .arg(d->tcpHost, QString::number(d->tcpPort)));
break;
}
case QAbstractSocket::ConnectedState:
{
if (QmlProfilerPlugin::debugOutput)
qWarning("QML Profiler: connected and running");
- // notify the client recording status
- clientRecordingChanged();
+ // notify the client recording status
+ clientRecordingChanged();
+ QmlProfilerTool::logStatus(tr("QML Profiler: connected and running"));
break;
}
case QAbstractSocket::ClosingState:
diff --git a/src/plugins/qmlprofiler/qmlprofilerengine.cpp b/src/plugins/qmlprofiler/qmlprofilerengine.cpp
index 7876245763..2246832422 100644
--- a/src/plugins/qmlprofiler/qmlprofilerengine.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilerengine.cpp
@@ -258,7 +258,9 @@ void QmlProfilerRunControl::processIsRunning(quint16 port)
{
d->m_noDebugOutputTimer.stop();
- if (port > 0 && startParameters().analyzerPort != 0)
+ if (port == 0)
+ port = startParameters().analyzerPort;
+ if (port != 0)
emit processRunning(port);
}
diff --git a/src/plugins/qmlprofiler/qmlprofilertracefile.cpp b/src/plugins/qmlprofiler/qmlprofilertracefile.cpp
index b7e99c1117..3b8217d2b5 100644
--- a/src/plugins/qmlprofiler/qmlprofilertracefile.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilertracefile.cpp
@@ -317,6 +317,8 @@ void QmlProfilerFileReader::loadProfilerDataModel(QXmlStreamReader &stream)
range.numericData1 = attributes.value(_("framerate")).toString().toLongLong();
if (attributes.hasAttribute(_("animationcount")))
range.numericData2 = attributes.value(_("animationcount")).toString().toLongLong();
+ if (attributes.hasAttribute(_("thread")))
+ range.numericData3 = attributes.value(_("thread")).toString().toLongLong();
if (attributes.hasAttribute(_("width")))
range.numericData1 = attributes.value(_("width")).toString().toLongLong();
if (attributes.hasAttribute(_("height")))
@@ -483,6 +485,7 @@ void QmlProfilerFileWriter::save(QIODevice *device)
stream.writeAttribute(_("framerate"), QString::number(range.numericData1));
stream.writeAttribute(_("animationcount"), QString::number(range.numericData2));
+ stream.writeAttribute(_("thread"), QString::number(range.numericData3));
}
// special: pixmap cache event
diff --git a/src/plugins/qmlprofiler/qmlprofilertraceview.cpp b/src/plugins/qmlprofiler/qmlprofilertraceview.cpp
index a9b00493f6..4e5dd50e93 100644
--- a/src/plugins/qmlprofiler/qmlprofilertraceview.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilertraceview.cpp
@@ -226,19 +226,19 @@ QWidget *QmlProfilerTraceView::createToolbar()
QToolButton *buttonPrev= new QToolButton;
buttonPrev->setIcon(QIcon(QLatin1String(":/qmlprofiler/ico_prev.png")));
- buttonPrev->setToolTip(tr("Jump to previous event"));
+ buttonPrev->setToolTip(tr("Jump to previous event."));
connect(buttonPrev, SIGNAL(clicked()), this, SIGNAL(jumpToPrev()));
connect(this, SIGNAL(enableToolbar(bool)), buttonPrev, SLOT(setEnabled(bool)));
QToolButton *buttonNext= new QToolButton;
buttonNext->setIcon(QIcon(QLatin1String(":/qmlprofiler/ico_next.png")));
- buttonNext->setToolTip(tr("Jump to next event"));
+ buttonNext->setToolTip(tr("Jump to next event."));
connect(buttonNext, SIGNAL(clicked()), this, SIGNAL(jumpToNext()));
connect(this, SIGNAL(enableToolbar(bool)), buttonNext, SLOT(setEnabled(bool)));
QToolButton *buttonZoomControls = new QToolButton;
buttonZoomControls->setIcon(QIcon(QLatin1String(":/qmlprofiler/ico_zoom.png")));
- buttonZoomControls->setToolTip(tr("Show zoom slider"));
+ buttonZoomControls->setToolTip(tr("Show zoom slider."));
buttonZoomControls->setCheckable(true);
buttonZoomControls->setChecked(false);
connect(buttonZoomControls, SIGNAL(toggled(bool)), this, SIGNAL(showZoomSlider(bool)));
@@ -246,7 +246,7 @@ QWidget *QmlProfilerTraceView::createToolbar()
d->m_buttonRange = new QToolButton;
d->m_buttonRange->setIcon(QIcon(QLatin1String(":/qmlprofiler/ico_rangeselection.png")));
- d->m_buttonRange->setToolTip(tr("Select range"));
+ d->m_buttonRange->setToolTip(tr("Select range."));
d->m_buttonRange->setCheckable(true);
d->m_buttonRange->setChecked(false);
connect(d->m_buttonRange, SIGNAL(clicked(bool)), this, SLOT(toggleRangeMode(bool)));
@@ -255,7 +255,7 @@ QWidget *QmlProfilerTraceView::createToolbar()
d->m_buttonLock = new QToolButton;
d->m_buttonLock->setIcon(QIcon(QLatin1String(":/qmlprofiler/ico_selectionmode.png")));
- d->m_buttonLock->setToolTip(tr("View event information on mouseover"));
+ d->m_buttonLock->setToolTip(tr("View event information on mouseover."));
d->m_buttonLock->setCheckable(true);
d->m_buttonLock->setChecked(false);
connect(d->m_buttonLock, SIGNAL(clicked(bool)), this, SLOT(toggleLockMode(bool)));
diff --git a/src/plugins/qmlprofiler/timelinerenderer.cpp b/src/plugins/qmlprofiler/timelinerenderer.cpp
index 04f9459110..0444c37931 100644
--- a/src/plugins/qmlprofiler/timelinerenderer.cpp
+++ b/src/plugins/qmlprofiler/timelinerenderer.cpp
@@ -317,21 +317,23 @@ void TimelineRenderer::manageHovered(int mouseX, int mouseY)
if (m_endTime - m_startTime <=0 || m_lastEndTime - m_lastStartTime <= 0)
return;
- qint64 time = mouseX * (m_endTime - m_startTime) / width() + m_startTime;
+ // Make the "selected" area 3 pixels wide by adding/subtracting 1 to catch very narrow events.
+ qint64 startTime = (mouseX - 1) * (m_endTime - m_startTime) / width() + m_startTime;
+ qint64 endTime = (mouseX + 1) * (m_endTime - m_startTime) / width() + m_startTime;
int row = (mouseY + y()) / DefaultRowHeight;
int modelIndex = modelFromPosition(mouseY + y());
// already covered? nothing to do
if (m_currentSelection.eventIndex != -1 &&
- time >= m_currentSelection.startTime &&
- time <= m_currentSelection.endTime &&
+ endTime >= m_currentSelection.startTime &&
+ startTime <= m_currentSelection.endTime &&
row == m_currentSelection.row) {
return;
}
// find if there's items in the time range
- int eventFrom = m_profilerModelProxy->findFirstIndex(modelIndex, time);
- int eventTo = m_profilerModelProxy->findLastIndex(modelIndex, time);
+ int eventFrom = m_profilerModelProxy->findFirstIndex(modelIndex, startTime);
+ int eventTo = m_profilerModelProxy->findLastIndex(modelIndex, endTime);
if (eventFrom == -1 ||
eventTo < eventFrom || eventTo >= m_profilerModelProxy->count()) {
m_currentSelection.eventIndex = -1;
@@ -345,9 +347,6 @@ void TimelineRenderer::manageHovered(int mouseX, int mouseY)
// find if we are in the right column
int itemRow;
for (int i=eventTo; i>=eventFrom; --i) {
- if (ceil(m_profilerModelProxy->getEndTime(modelIndex, i)*m_spacing) < floor(time*m_spacing))
- continue;
-
itemRow = modelRowStart + m_profilerModelProxy->getEventRow(modelIndex, i);
if (itemRow == row) {
diff --git a/src/plugins/qmlprojectmanager/qmlprojectmanager.qbs b/src/plugins/qmlprojectmanager/qmlprojectmanager.qbs
index 80113871f0..527250f72d 100644
--- a/src/plugins/qmlprojectmanager/qmlprojectmanager.qbs
+++ b/src/plugins/qmlprojectmanager/qmlprojectmanager.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/qmlprojectmanager/qmlprojectnodes.cpp b/src/plugins/qmlprojectmanager/qmlprojectnodes.cpp
index dfaa55702b..d8a2e60ad6 100644
--- a/src/plugins/qmlprojectmanager/qmlprojectnodes.cpp
+++ b/src/plugins/qmlprojectmanager/qmlprojectnodes.cpp
@@ -164,7 +164,7 @@ ProjectExplorer::FolderNode *QmlProjectNode::findOrCreateFolderByName(const QStr
return findOrCreateFolderByName(components, components.length());
}
-bool QmlProjectNode::hasBuildTargets() const
+bool QmlProjectNode::showInSimpleTree() const
{
return true;
}
diff --git a/src/plugins/qmlprojectmanager/qmlprojectnodes.h b/src/plugins/qmlprojectmanager/qmlprojectnodes.h
index d47f7fb6d7..f2b94c1121 100644
--- a/src/plugins/qmlprojectmanager/qmlprojectnodes.h
+++ b/src/plugins/qmlprojectmanager/qmlprojectnodes.h
@@ -52,7 +52,7 @@ public:
Core::IDocument *projectFile() const;
QString projectFilePath() const;
- virtual bool hasBuildTargets() const;
+ virtual bool showInSimpleTree() const;
virtual QList<ProjectExplorer::ProjectAction> supportedActions(Node *node) const;
diff --git a/src/plugins/qnx/blackberryapilevelconfiguration.cpp b/src/plugins/qnx/blackberryapilevelconfiguration.cpp
index f2192aa5f2..e6b7adf609 100644
--- a/src/plugins/qnx/blackberryapilevelconfiguration.cpp
+++ b/src/plugins/qnx/blackberryapilevelconfiguration.cpp
@@ -337,9 +337,15 @@ Kit *BlackBerryApiLevelConfiguration::createKit(
if (debuggerItemId.isValid())
DebuggerKitInformation::setDebugger(kit, debuggerItemId);
- if (isSimulator)
- QmakeProjectManager::QmakeKitInformation::setMkspec(
- kit, FileName::fromLatin1("blackberry-x86-qcc"));
+ if (version->qtVersion().majorVersion == 4) {
+ if (isSimulator) {
+ QmakeProjectManager::QmakeKitInformation::setMkspec(
+ kit, FileName::fromLatin1("blackberry-x86-qcc"));
+ } else {
+ QmakeProjectManager::QmakeKitInformation::setMkspec(
+ kit, FileName::fromLatin1("blackberry-armv7le-qcc"));
+ }
+ }
DeviceTypeKitInformation::setDeviceTypeId(kit, Constants::QNX_BB_OS_TYPE);
SysRootKitInformation::setSysRoot(kit, m_sysRoot);
diff --git a/src/plugins/qnx/blackberryapplicationrunner.cpp b/src/plugins/qnx/blackberryapplicationrunner.cpp
index c894235bcd..850a12f20f 100644
--- a/src/plugins/qnx/blackberryapplicationrunner.cpp
+++ b/src/plugins/qnx/blackberryapplicationrunner.cpp
@@ -42,14 +42,18 @@
#include <projectexplorer/kit.h>
#include <projectexplorer/target.h>
#include <qmakeprojectmanager/qmakebuildconfiguration.h>
+#include <debugger/debuggerrunconfigurationaspect.h>
#include <ssh/sshremoteprocessrunner.h>
#include <utils/qtcassert.h>
#include <QMessageBox>
#include <QTimer>
#include <QDir>
+#include <QTemporaryFile>
namespace {
+enum { debugCheckQmlJSArgs = 0 };
+
bool parseRunningState(const QString &line)
{
QTC_ASSERT(line.startsWith(QLatin1String("result::")), return false);
@@ -61,9 +65,9 @@ using namespace ProjectExplorer;
using namespace Qnx;
using namespace Qnx::Internal;
-BlackBerryApplicationRunner::BlackBerryApplicationRunner(bool cppDebugMode, BlackBerryRunConfiguration *runConfiguration, QObject *parent)
+BlackBerryApplicationRunner::BlackBerryApplicationRunner(const BlackBerryApplicationRunner::LaunchFlags &launchFlags, BlackBerryRunConfiguration *runConfiguration, QObject *parent)
: QObject(parent)
- , m_cppDebugMode(cppDebugMode)
+ , m_launchFlags(launchFlags)
, m_pid(-1)
, m_appId(QString())
, m_running(false)
@@ -74,6 +78,8 @@ BlackBerryApplicationRunner::BlackBerryApplicationRunner(bool cppDebugMode, Blac
, m_logProcessRunner(0)
, m_runningStateTimer(new QTimer(this))
, m_runningStateProcess(0)
+ , m_qmlDebugServerPort(0)
+ , m_checkQmlJsDebugArgumentsProcess(0)
{
QTC_ASSERT(runConfiguration, return);
@@ -92,6 +98,11 @@ BlackBerryApplicationRunner::BlackBerryApplicationRunner(bool cppDebugMode, Blac
m_sshParams = m_device->sshParameters();
m_sshParams.authenticationType = QSsh::SshConnectionParameters::AuthenticationTypePublicKey;
+ Debugger::DebuggerRunConfigurationAspect *aspect =
+ runConfiguration->extraAspect<Debugger::DebuggerRunConfigurationAspect>();
+ if (aspect)
+ m_qmlDebugServerPort = aspect->qmlDebugServerPort();
+
m_runningStateTimer->setInterval(3000);
m_runningStateTimer->setSingleShot(true);
connect(m_runningStateTimer, SIGNAL(timeout()), this, SLOT(determineRunningState()));
@@ -105,14 +116,14 @@ void BlackBerryApplicationRunner::start()
{
if (!BlackBerryDeviceConnectionManager::instance()->isConnected(m_device->id())) {
connect(BlackBerryDeviceConnectionManager::instance(), SIGNAL(deviceConnected()),
- this, SLOT(launchApplication()));
+ this, SLOT(checkDeployMode()));
connect(BlackBerryDeviceConnectionManager::instance(), SIGNAL(deviceDisconnected(Core::Id)),
this, SLOT(disconnectFromDeviceSignals(Core::Id)));
connect(BlackBerryDeviceConnectionManager::instance(), SIGNAL(connectionOutput(Core::Id,QString)),
this, SLOT(displayConnectionOutput(Core::Id,QString)));
BlackBerryDeviceConnectionManager::instance()->connectDevice(m_device->id());
} else {
- launchApplication();
+ checkDeployMode();
}
}
@@ -148,7 +159,7 @@ void BlackBerryApplicationRunner::checkDeviceRuntimeVersion(int status)
if (m_bbApiLevelVersion.isEmpty()) {
emit output(tr("Cannot determine API level version."), Utils::StdErrFormat);
- launchApplication();
+ checkQmlJsDebugArguments();
return;
}
@@ -170,7 +181,7 @@ void BlackBerryApplicationRunner::checkDeviceRuntimeVersion(int status)
}
}
- launchApplication();
+ checkQmlJsDebugArguments();
}
void BlackBerryApplicationRunner::queryDeviceInformation()
@@ -273,7 +284,7 @@ void BlackBerryApplicationRunner::disconnectFromDeviceSignals(Core::Id deviceId)
{
if (m_device->id() == deviceId) {
disconnect(BlackBerryDeviceConnectionManager::instance(), SIGNAL(deviceConnected()),
- this, SLOT(launchApplication()));
+ this, SLOT(checkDeployMode()));
disconnect(BlackBerryDeviceConnectionManager::instance(), SIGNAL(deviceDisconnected(Core::Id)),
this, SLOT(disconnectFromDeviceSignals(Core::Id)));
disconnect(BlackBerryDeviceConnectionManager::instance(), SIGNAL(connectionOutput(Core::Id,QString)),
@@ -291,6 +302,105 @@ void BlackBerryApplicationRunner::setApplicationId(const QString &applicationId)
m_appId = applicationId;
}
+void BlackBerryApplicationRunner::checkQmlJsDebugArguments()
+{
+ if (!m_launchFlags.testFlag(QmlDebugLaunch)) {
+ // no need to change anytning in app manifest for this kind of run
+ launchApplication();
+ }
+
+ emit output(tr("Checking qmljsdebugger command line argument."), Utils::StdOutFormat);
+ QString nativePackagerCmd = m_environment.searchInPath(QLatin1String("blackberry-nativepackager"));
+ if (nativePackagerCmd.isEmpty()) {
+ emit output(tr("Cannot find Native Packager executable."), Utils::StdErrFormat);
+ return;
+ }
+
+ m_checkQmlJsDebugArgumentsProcess = new QProcess(this);
+ connect(m_checkQmlJsDebugArgumentsProcess, SIGNAL(error(QProcess::ProcessError)), this, SLOT(checkQmlJsDebugArgumentsManifestLoaded()));
+ connect(m_checkQmlJsDebugArgumentsProcess, SIGNAL(finished(int)), this, SLOT(checkQmlJsDebugArgumentsManifestLoaded()));
+
+ QStringList args;
+ args << QLatin1String("-listManifest") << QDir::toNativeSeparators(m_barPackage);
+ if (debugCheckQmlJSArgs)
+ qDebug() << "get manifest:" << nativePackagerCmd << args.join(QLatin1String(" "));
+ m_checkQmlJsDebugArgumentsProcess->start(nativePackagerCmd, args);
+}
+
+void BlackBerryApplicationRunner::checkQmlJsDebugArgumentsManifestLoaded()
+{
+ m_checkQmlJsDebugArgumentsProcess->deleteLater();
+
+ if (m_checkQmlJsDebugArgumentsProcess->exitStatus() != QProcess::NormalExit) {
+ emit output(tr("Cannot read bar package manifest."), Utils::StdErrFormat);
+ qWarning() << "Cannot read bar package manifest:" << m_checkQmlJsDebugArgumentsProcess->errorString();
+ qWarning() << m_checkQmlJsDebugArgumentsProcess->readAllStandardError();
+ return;
+ }
+
+ QString manifestContent = QString::fromUtf8(m_checkQmlJsDebugArgumentsProcess->readAllStandardOutput());
+
+ QRegExp rxEoln(QLatin1String("(\\r\\n|\\n|\\r)"));
+ QStringList manifestLines = manifestContent.split(rxEoln);
+
+ QMutableListIterator<QString> it(manifestLines);
+ QLatin1String entryPoint("Entry-Point: ");
+ while (it.hasNext()) {
+ it.next();
+ if (it.value().startsWith(entryPoint)) {
+ while (it.hasNext() && it.peekNext().startsWith(QLatin1Char(' ')))
+ it.next();
+ QString qmljsdbgArg = QString::fromLatin1("-qmljsdebugger=port:%1%2")
+ .arg(m_qmlDebugServerPort)
+ .arg(m_launchFlags.testFlag(QmlDebugLaunchBlocking)? QLatin1String(",block"): QLatin1String(""));
+ it.insert(QLatin1String(" ") + qmljsdbgArg);
+ manifestContent = manifestLines.join(QLatin1String("\n"));
+ break;
+ }
+ }
+
+ m_checkQmlJsDebugArgumentsProcess = new QProcess(this);
+ connect(m_checkQmlJsDebugArgumentsProcess, SIGNAL(error(QProcess::ProcessError)), this, SLOT(checkQmlJsDebugArgumentsManifestSaved()));
+ connect(m_checkQmlJsDebugArgumentsProcess, SIGNAL(finished(int)), this, SLOT(checkQmlJsDebugArgumentsManifestSaved()));
+
+ QTemporaryFile *manifestFile = new QTemporaryFile(m_checkQmlJsDebugArgumentsProcess);
+ if (!manifestFile->open()) {
+ emit output(tr("Internal error: Cannot create temporary manifest file '%1'")
+ .arg(manifestFile->fileName()), Utils::StdErrFormat);
+ delete manifestFile;
+ return;
+ }
+
+ manifestFile->write(manifestContent.toUtf8());
+ manifestFile->flush();
+
+ QStringList args;
+ args << QLatin1String("-device") << m_sshParams.host;
+ if (!m_sshParams.password.isEmpty())
+ args << QLatin1String("-password") << m_sshParams.password;
+ args << QLatin1String("-package") << QDir::toNativeSeparators(m_barPackage);
+ args << QLatin1String("-putFile");
+ args << manifestFile->fileName();
+ args << QLatin1String("app/META-INF/MANIFEST.MF");
+ if (debugCheckQmlJSArgs)
+ qDebug() << "set manifest:" << m_deployCmd << args.join(QLatin1String(" "));
+ m_checkQmlJsDebugArgumentsProcess->start(m_deployCmd, args);
+}
+
+void BlackBerryApplicationRunner::checkQmlJsDebugArgumentsManifestSaved()
+{
+ m_checkQmlJsDebugArgumentsProcess->deleteLater();
+
+ if (m_checkQmlJsDebugArgumentsProcess->exitStatus() != QProcess::NormalExit) {
+ emit output(tr("Cannot set command line arguments."), Utils::StdErrFormat);
+ qWarning() << "Cannot set command line arguments:" << m_checkQmlJsDebugArgumentsProcess->errorString();
+ qWarning() << m_checkQmlJsDebugArgumentsProcess->readAllStandardError();
+ return;
+ }
+
+ launchApplication();
+}
+
void BlackBerryApplicationRunner::launchApplication()
{
// If original device connection fails before launching, this method maybe triggered
@@ -300,12 +410,12 @@ void BlackBerryApplicationRunner::launchApplication()
QStringList args;
args << QLatin1String("-launchApp");
- if (m_cppDebugMode)
+ if (m_launchFlags.testFlag(CppDebugLaunch))
args << QLatin1String("-debugNative");
args << QLatin1String("-device") << m_sshParams.host;
if (!m_sshParams.password.isEmpty())
args << QLatin1String("-password") << m_sshParams.password;
- args << QDir::toNativeSeparators(m_barPackage);
+ args << QLatin1String("-package") << QDir::toNativeSeparators(m_barPackage);
if (!m_launchProcess) {
m_launchProcess = new QProcess(this);
@@ -316,7 +426,8 @@ void BlackBerryApplicationRunner::launchApplication()
m_launchProcess->setEnvironment(m_environment.toStringList());
}
-
+ if (debugCheckQmlJSArgs)
+ qDebug() << "launch:" << m_deployCmd << args.join(QLatin1String(" "));
m_launchProcess->start(m_deployCmd, args);
m_runningStateTimer->start();
m_running = true;
@@ -329,10 +440,10 @@ void BlackBerryApplicationRunner::checkDeployMode()
if (!BlackBerryDeviceConnectionManager::instance()->isConnected(m_device->id()))
return;
- if (m_cppDebugMode)
+ if (m_launchFlags.testFlag(CppDebugLaunch))
queryDeviceInformation(); // check API version vs Runtime version
else
- launchApplication();
+ checkQmlJsDebugArguments();
}
void BlackBerryApplicationRunner::startRunningStateTimer()
diff --git a/src/plugins/qnx/blackberryapplicationrunner.h b/src/plugins/qnx/blackberryapplicationrunner.h
index fc8f2a0f3d..490bc395f5 100644
--- a/src/plugins/qnx/blackberryapplicationrunner.h
+++ b/src/plugins/qnx/blackberryapplicationrunner.h
@@ -58,15 +58,24 @@ class BlackBerryApplicationRunner : public QObject
{
Q_OBJECT
public:
- explicit BlackBerryApplicationRunner(bool cppDebugMode, BlackBerryRunConfiguration *runConfiguration, QObject *parent = 0);
+ enum LaunchFlag
+ {
+ CppDebugLaunch = 0x1,
+ QmlDebugLaunch = 0x2,
+ QmlDebugLaunchBlocking = 0x4,
+ QmlProfilerLaunch = 0x8
+ };
+ Q_DECLARE_FLAGS(LaunchFlags, LaunchFlag)
+
+public:
+ explicit BlackBerryApplicationRunner(const LaunchFlags &launchFlags, BlackBerryRunConfiguration *runConfiguration, QObject *parent = 0);
bool isRunning() const;
qint64 pid() const;
- ProjectExplorer::RunControl::StopResult stop();
-
public slots:
void start();
+ ProjectExplorer::RunControl::StopResult stop();
signals:
void output(const QString &msg, Utils::OutputFormat format);
@@ -97,11 +106,15 @@ private slots:
void displayConnectionOutput(Core::Id deviceId, const QString &output);
void checkDeviceRuntimeVersion(int status);
+ void checkQmlJsDebugArguments();
+ void checkQmlJsDebugArgumentsManifestLoaded();
+ void checkQmlJsDebugArgumentsManifestSaved();
+
private:
void reset();
void queryDeviceInformation();
- bool m_cppDebugMode;
+ LaunchFlags m_launchFlags;
qint64 m_pid;
QString m_appId;
@@ -126,6 +139,9 @@ private:
QProcess *m_runningStateProcess;
BlackBerryVersionNumber m_bbApiLevelVersion;
+
+ int m_qmlDebugServerPort;
+ QProcess *m_checkQmlJsDebugArgumentsProcess;
};
} // namespace Internal
diff --git a/src/plugins/qnx/blackberryconfigurationmanager.cpp b/src/plugins/qnx/blackberryconfigurationmanager.cpp
index 5221d88e87..0340ab1ec0 100644
--- a/src/plugins/qnx/blackberryconfigurationmanager.cpp
+++ b/src/plugins/qnx/blackberryconfigurationmanager.cpp
@@ -457,11 +457,6 @@ void BlackBerryConfigurationManager::loadSettings()
loadAutoDetectedRuntimes();
checkToolChainConfiguration();
- // If no target was/is activated, activate one since it's needed by
- // device connection and CSK code.
- if (activeApiLevels().isEmpty() && !m_apiLevels.isEmpty())
- m_apiLevels.first()->activate();
-
emit settingsLoaded();
emit settingsChanged();
}
diff --git a/src/plugins/qnx/blackberrycreatepackagestep.cpp b/src/plugins/qnx/blackberrycreatepackagestep.cpp
index 26a3c74470..4a5df4b28f 100644
--- a/src/plugins/qnx/blackberrycreatepackagestep.cpp
+++ b/src/plugins/qnx/blackberrycreatepackagestep.cpp
@@ -134,7 +134,6 @@ bool BlackBerryCreatePackageStep::init()
// If there is an error, prepareAppDescriptorFile() will raise it
return false;
-
QStringList args;
if (m_packageMode == DevelopmentMode) {
args << QLatin1String("-devMode");
@@ -165,39 +164,6 @@ bool BlackBerryCreatePackageStep::init()
args << QLatin1String("-package") << QnxUtils::addQuotes(QDir::toNativeSeparators(info.packagePath()));
args << QnxUtils::addQuotes(QDir::toNativeSeparators(preparedFilePath));
- if (m_packageMode == DevelopmentMode && m_bundleMode == BundleQt) {
- BlackBerryQtVersion *qtVersion = dynamic_cast<BlackBerryQtVersion *>
- (QtSupport::QtKitInformation::qtVersion(target()->kit()));
- if (!qtVersion) {
- raiseError(tr("Qt version configured for BlackBerry kit "
- "is not a BlackBerry Qt version."));
- return false;
- }
-
- QMap<QString, QString> qtFolders;
- qtFolders[QLatin1String("lib")] =
- qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_LIBS"));
- qtFolders[QLatin1String("plugins")] =
- qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_PLUGINS"));
- qtFolders[QLatin1String("imports")] =
- qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_IMPORTS"));
- qtFolders[QLatin1String("qml")] =
- qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_QML"));
-
- for (QMap<QString, QString>::const_iterator it = qtFolders.constBegin();
- it != qtFolders.constEnd(); ++it) {
- const QString target = it.key();
- const QString qtFolder = it.value();
- if (QFileInfo(qtFolder).exists()) {
- args << QLatin1String("-e");
- args << qtFolder;
- args << target;
- }
- }
-
- args << QLatin1String(".");
- }
-
addCommand(packageCmd, args);
}
@@ -340,24 +306,12 @@ bool BlackBerryCreatePackageStep::prepareAppDescriptorFile(const QString &appDes
QDir::toNativeSeparators(target()->project()->projectDirectory());
doc.expandPlaceHolders(placeHoldersHash);
- // Add parameter for QML debugging (if enabled)
- Debugger::DebuggerRunConfigurationAspect *aspect
- = target()->activeRunConfiguration()->extraAspect<Debugger::DebuggerRunConfigurationAspect>();
- if (aspect->useQmlDebugger()) {
- const QString qmlDebuggerArg = QString::fromLatin1("-qmljsdebugger=port:%1")
- .arg(aspect->qmlDebugServerPort());
-
- QStringList args = doc.value(BarDescriptorDocument::arg).toStringList();
- if (!args.contains(qmlDebuggerArg))
- args.append(qmlDebuggerArg);
-
- doc.setValue(BarDescriptorDocument::arg, args);
- }
-
// Set up correct environment depending on using bundled/pre-installed Qt
QList<Utils::EnvironmentItem> envItems =
doc.value(BarDescriptorDocument::env).value<QList<Utils::EnvironmentItem> >();
Utils::Environment env(Utils::EnvironmentItem::toStringList(envItems), Utils::OsTypeOtherUnix);
+ BarDescriptorAssetList assetList = doc.value(BarDescriptorDocument::asset)
+ .value<BarDescriptorAssetList>();
if (m_packageMode == SigningPackageMode
|| (m_packageMode == DevelopmentMode && m_bundleMode == PreInstalledQt)) {
@@ -371,6 +325,29 @@ bool BlackBerryCreatePackageStep::prepareAppDescriptorFile(const QString &appDes
env.prependOrSetLibrarySearchPath(QString::fromLatin1("/usr/lib/qt%1/lib")
.arg(versionNumber.majorVersion));
} else if (m_packageMode == DevelopmentMode && m_bundleMode == BundleQt) {
+ QList<QPair<QString, QString> > qtFolders;
+ qtFolders.append(qMakePair(QString::fromLatin1("lib"),
+ qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_LIBS"))));
+ qtFolders.append(qMakePair(QString::fromLatin1("plugins"),
+ qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_PLUGINS"))));
+ qtFolders.append(qMakePair(QString::fromLatin1("imports"),
+ qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_IMPORTS"))));
+ qtFolders.append(qMakePair(QString::fromLatin1("qml"),
+ qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_QML"))));
+
+ for (QList<QPair<QString, QString> >::const_iterator it = qtFolders.constBegin();
+ it != qtFolders.constEnd(); ++it) {
+ const QString target = it->first;
+ const QString qtFolder = it->second;
+ if (QFileInfo(qtFolder).exists()) {
+ BarDescriptorAsset asset;
+ asset.source = qtFolder;
+ asset.destination = target;
+ asset.entry = false;
+ assetList << asset;
+ }
+ }
+
env.appendOrSet(QLatin1String("QML2_IMPORT_PATH"),
QLatin1String("app/native/imports:app/native/qml"), QLatin1String(":"));
env.appendOrSet(QLatin1String("QML_IMPORT_PATH"),
@@ -390,6 +367,8 @@ bool BlackBerryCreatePackageStep::prepareAppDescriptorFile(const QString &appDes
env.prependOrSetLibrarySearchPath(QString::fromLatin1("%1/lib").arg(fullQtLibraryPath()));
}
+ doc.setValue(BarDescriptorDocument::asset, QVariant::fromValue(assetList));
+
QVariant envVar;
envVar.setValue(Utils::EnvironmentItem::fromStringList(env.toStringList()));
doc.setValue(BarDescriptorDocument::env, envVar);
diff --git a/src/plugins/qnx/blackberrydebugsupport.cpp b/src/plugins/qnx/blackberrydebugsupport.cpp
index c89650b132..15fe95f6b9 100644
--- a/src/plugins/qnx/blackberrydebugsupport.cpp
+++ b/src/plugins/qnx/blackberrydebugsupport.cpp
@@ -44,8 +44,12 @@ BlackBerryDebugSupport::BlackBerryDebugSupport(BlackBerryRunConfiguration *runCo
: QObject(runControl->engine())
, m_engine(runControl->engine())
{
- const bool cppDebugMode = m_engine->startParameters().languages & Debugger::CppLanguage;
- m_runner = new BlackBerryApplicationRunner(cppDebugMode, runConfig, this);
+ BlackBerryApplicationRunner::LaunchFlags launchFlags;
+ if (m_engine->startParameters().languages & Debugger::CppLanguage)
+ launchFlags |= BlackBerryApplicationRunner::CppDebugLaunch;
+ if (m_engine->startParameters().languages & Debugger::QmlLanguage)
+ launchFlags |= BlackBerryApplicationRunner::QmlDebugLaunch;
+ m_runner = new BlackBerryApplicationRunner(launchFlags, runConfig, this);
connect(m_engine, SIGNAL(requestRemoteSetup()), this, SLOT(launchRemoteApplication()));
connect(m_engine, SIGNAL(stateChanged(Debugger::DebuggerState)),
diff --git a/src/plugins/qnx/blackberrydebugtokenpinsdialog.cpp b/src/plugins/qnx/blackberrydebugtokenpinsdialog.cpp
index 07c1616a90..466e224051 100644
--- a/src/plugins/qnx/blackberrydebugtokenpinsdialog.cpp
+++ b/src/plugins/qnx/blackberrydebugtokenpinsdialog.cpp
@@ -110,7 +110,7 @@ void BlackBerryDebugTokenPinsDialog::removePin()
const QString pin = m_model->item(index.row(), 0)->text();
const int result = QMessageBox::question(this, tr("Confirmation"),
- tr("Are you sure you want to remove PIN: %1")
+ tr("Are you sure you want to remove PIN: %1?")
.arg(pin), QMessageBox::Yes | QMessageBox::No);
if (result == QMessageBox::Yes) {
diff --git a/src/plugins/qnx/blackberryruncontrol.cpp b/src/plugins/qnx/blackberryruncontrol.cpp
index e42a223246..660ca53f59 100644
--- a/src/plugins/qnx/blackberryruncontrol.cpp
+++ b/src/plugins/qnx/blackberryruncontrol.cpp
@@ -43,7 +43,7 @@ using namespace Qnx::Internal;
BlackBerryRunControl::BlackBerryRunControl(BlackBerryRunConfiguration *runConfiguration)
: ProjectExplorer::RunControl(runConfiguration, ProjectExplorer::NormalRunMode)
{
- m_runner = new BlackBerryApplicationRunner(false, runConfiguration, this);
+ m_runner = new BlackBerryApplicationRunner(BlackBerryApplicationRunner::LaunchFlags(), runConfiguration, this);
connect(m_runner, SIGNAL(started()), this, SIGNAL(started()));
connect(m_runner, SIGNAL(finished()), this, SIGNAL(finished()));
diff --git a/src/plugins/qnx/blackberryruncontrolfactory.cpp b/src/plugins/qnx/blackberryruncontrolfactory.cpp
index 7ce739d65f..3a67695236 100644
--- a/src/plugins/qnx/blackberryruncontrolfactory.cpp
+++ b/src/plugins/qnx/blackberryruncontrolfactory.cpp
@@ -36,6 +36,7 @@
#include "blackberrydebugsupport.h"
#include "blackberryqtversion.h"
#include "blackberrydeviceconnectionmanager.h"
+#include "blackberryapplicationrunner.h"
#include "qnxutils.h"
#include <debugger/debuggerplugin.h>
@@ -48,6 +49,10 @@
#include <projectexplorer/toolchain.h>
#include <qmakeprojectmanager/qmakebuildconfiguration.h>
#include <qtsupport/qtkitinformation.h>
+#include <analyzerbase/analyzerstartparameters.h>
+#include <analyzerbase/analyzermanager.h>
+#include <analyzerbase/analyzerruncontrol.h>
+#include <coreplugin/messagemanager.h>
using namespace Qnx;
using namespace Qnx::Internal;
@@ -86,6 +91,28 @@ bool BlackBerryRunControlFactory::canRun(ProjectExplorer::RunConfiguration *runC
return activeDeployConf != 0;
}
+static void createAnalyzerStartParameters(Analyzer::AnalyzerStartParameters *pStartParameters, BlackBerryRunConfiguration* runConfiguration, ProjectExplorer::RunMode mode)
+{
+ QTC_ASSERT(pStartParameters, return);
+ pStartParameters->runMode = mode;
+ if (mode == ProjectExplorer::QmlProfilerRunMode)
+ pStartParameters->startMode = Analyzer::StartLocal;
+
+ ProjectExplorer::Target *target = runConfiguration->target();
+ ProjectExplorer::Kit *kit = target->kit();
+
+ ProjectExplorer::IDevice::ConstPtr device = ProjectExplorer::DeviceKitInformation::device(kit);
+ if (device) {
+ pStartParameters->connParams = device->sshParameters();
+ pStartParameters->analyzerHost = device->qmlProfilerHost();
+ }
+ pStartParameters->sysroot = ProjectExplorer::SysRootKitInformation::sysRoot(kit).toString();
+
+ Debugger::DebuggerRunConfigurationAspect *aspect = runConfiguration->extraAspect<Debugger::DebuggerRunConfigurationAspect>();
+ if (aspect)
+ pStartParameters->analyzerPort = aspect->qmlDebugServerPort();
+}
+
ProjectExplorer::RunControl *BlackBerryRunControlFactory::create(ProjectExplorer::RunConfiguration *runConfiguration,
ProjectExplorer::RunMode mode, QString *errorMessage)
{
@@ -106,7 +133,32 @@ ProjectExplorer::RunControl *BlackBerryRunControlFactory::create(ProjectExplorer
m_activeRunControls[rc->key()] = runControl;
return runControl;
}
-
+ if (mode == ProjectExplorer::QmlProfilerRunMode) {
+ QtSupport::BaseQtVersion *qtVer = QtSupport::QtKitInformation::qtVersion(rc->target()->kit());
+ if (qtVer && qtVer->qtVersion() <= QtSupport::QtVersionNumber(4, 8, 6))
+ Core::MessageManager::write(tr("Target Qt version (%1) might not support QML profiling. "
+ "Cascades applications are not affected and should work as expected. "
+ "For more info see http://qt-project.org/wiki/Qt-Creator-with-BlackBerry-10")
+ .arg(qtVer->qtVersionString()), Core::MessageManager::Flash
+ );
+
+ Analyzer::AnalyzerStartParameters params;
+ createAnalyzerStartParameters(&params, rc, mode);
+
+ Analyzer::AnalyzerRunControl *runControl = Analyzer::AnalyzerManager::createRunControl(params, runConfiguration);
+ BlackBerryApplicationRunner::LaunchFlags launchFlags(BlackBerryApplicationRunner::QmlDebugLaunch
+ | BlackBerryApplicationRunner::QmlDebugLaunchBlocking
+ | BlackBerryApplicationRunner::QmlProfilerLaunch);
+ BlackBerryApplicationRunner *runner = new BlackBerryApplicationRunner(launchFlags, rc, runControl);
+
+ connect(runner, SIGNAL(finished()), runControl, SLOT(notifyRemoteFinished()));
+ connect(runner, SIGNAL(output(QString, Utils::OutputFormat)),
+ runControl, SLOT(logApplicationMessage(QString, Utils::OutputFormat)));
+ connect(runControl, SIGNAL(starting(const Analyzer::AnalyzerRunControl*)),
+ runner, SLOT(start()));
+ connect(runControl, SIGNAL(finished()), runner, SLOT(stop()));
+ return runControl;
+ }
Debugger::DebuggerRunControl * const runControl =
Debugger::DebuggerPlugin::createDebugger(startParameters(rc), runConfiguration, errorMessage);
if (!runControl)
diff --git a/src/plugins/qnx/qnx.qbs b/src/plugins/qnx/qnx.qbs
index 2dff37b9bf..db37410db6 100644
--- a/src/plugins/qnx/qnx.qbs
+++ b/src/plugins/qnx/qnx.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/qnx/qnxtoolchain.cpp b/src/plugins/qnx/qnxtoolchain.cpp
index 4c0ab1f6f9..bee5b0947e 100644
--- a/src/plugins/qnx/qnxtoolchain.cpp
+++ b/src/plugins/qnx/qnxtoolchain.cpp
@@ -108,6 +108,7 @@ QList<Utils::FileName> QnxToolChain::suggestedMkspecList() const
mkspecList << Utils::FileName::fromLatin1("qnx-armv7le-qcc");
mkspecList << Utils::FileName::fromLatin1("qnx-x86-qcc");
mkspecList << Utils::FileName::fromLatin1("blackberry-armv7le-qcc");
+ mkspecList << Utils::FileName::fromLatin1("blackberry-armle-v7-qcc");
mkspecList << Utils::FileName::fromLatin1("blackberry-x86-qcc");
return mkspecList;
diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp
index a37da71f4b..94a467c0bd 100644
--- a/src/plugins/qtsupport/exampleslistmodel.cpp
+++ b/src/plugins/qtsupport/exampleslistmodel.cpp
@@ -63,82 +63,30 @@ void setUniqueQtVersionIdSetting(int id)
settings->setValue(QLatin1String(currentQtVersionFilterSettingsKeyC), id);
}
-QtVersionsModel::QtVersionsModel(QObject *parent)
- : QStandardItemModel(parent)
+QtVersionsModel::QtVersionsModel(ExamplesListModel *examplesModel, QObject *parent) :
+ QStandardItemModel(parent),
+ examplesModel(examplesModel)
{
QHash<int, QByteArray> roleNames;
roleNames[Qt::UserRole + 1] = "text";
roleNames[Qt::UserRole + 2] = "QtId";
setRoleNames(roleNames);
-}
-
-int QtVersionsModel::findHighestQtVersion()
-{
- QList<BaseQtVersion *> qtVersions = QtVersionManager::validVersions();
-
- BaseQtVersion *newVersion = 0;
-
- foreach (BaseQtVersion *version, qtVersions) {
- if (version->isValid() && version->hasDemos() && version->hasExamples()) {
- if (!newVersion) {
- newVersion = version;
- } else {
- if (version->qtVersion() > newVersion->qtVersion()) {
- newVersion = version;
- } else if (version->qtVersion() == newVersion->qtVersion()
- && version->uniqueId() < newVersion->uniqueId()) {
- newVersion = version;
- }
- }
- }
- }
-
- if (!newVersion && !qtVersions.isEmpty())
- newVersion = qtVersions.first();
-
- if (!newVersion)
- return noQtVersionsId;
-
- return newVersion->uniqueId();
+ connect(examplesModel, SIGNAL(qtVersionsUpdated()), this, SLOT(update()));
}
-void QtVersionsModel::setupQtVersions()
+void QtVersionsModel::update()
{
beginResetModel();
clear();
- // prioritize default qt version
- QList<BaseQtVersion *> qtVersions = QtVersionManager::validVersions();
- ProjectExplorer::Kit *defaultKit = ProjectExplorer::KitManager::defaultKit();
- BaseQtVersion *defaultVersion = QtKitInformation::qtVersion(defaultKit);
- if (defaultVersion && qtVersions.contains(defaultVersion))
- qtVersions.move(qtVersions.indexOf(defaultVersion), 0);
-
- int qtVersionSetting = uniqueQtVersionIdSetting();
- int newQtVersionSetting = noQtVersionsId;
- if (qtVersionSetting != noQtVersionsId) {
- //ensure that the unique Qt id is valid
- foreach (BaseQtVersion *version, qtVersions) {
- if (version->uniqueId() == qtVersionSetting)
- newQtVersionSetting = qtVersionSetting;
- }
- }
-
- if (newQtVersionSetting == noQtVersionsId)
- newQtVersionSetting = findHighestQtVersion();
-
- if (newQtVersionSetting != qtVersionSetting)
- setUniqueQtVersionIdSetting(newQtVersionSetting);
-
+ QList<BaseQtVersion *> qtVersions = examplesModel->qtVersions();
foreach (BaseQtVersion *version, qtVersions) {
- if (version->hasDemos() || version->hasExamples()) {
- QStandardItem *newItem = new QStandardItem();
- newItem->setData(version->displayName(), Qt::UserRole + 1);
- newItem->setData(version->uniqueId(), Qt::UserRole + 2);
- appendRow(newItem);
- }
+ QStandardItem *newItem = new QStandardItem();
+ newItem->setData(version->displayName(), Qt::UserRole + 1);
+ newItem->setData(version->uniqueId(), Qt::UserRole + 2);
+ appendRow(newItem);
}
endResetModel();
}
@@ -404,12 +352,8 @@ void ExamplesListModel::updateExamples()
{
QString examplesInstallPath;
QString demosInstallPath;
- QString examplesFallback;
- QString demosFallback;
- QString sourceFallback;
- QStringList sources = exampleSources(&examplesInstallPath, &demosInstallPath,
- &examplesFallback, &demosFallback, &sourceFallback);
+ QStringList sources = exampleSources(&examplesInstallPath, &demosInstallPath);
beginResetModel();
m_tags.clear();
@@ -427,18 +371,6 @@ void ExamplesListModel::updateExamples()
QString offsetPath = fi.path();
QDir examplesDir(offsetPath);
QDir demosDir(offsetPath);
- if (!examplesFallback.isEmpty()) {
- // Look at Qt source directory at first,
- // since examplesPath() / demosPath() points at the build directory
- examplesDir = sourceFallback + QLatin1String("/examples");
- demosDir = sourceFallback + QLatin1String("/demos");
- // if examples or demos don't exist in source, try the directories
- // that qmake -query gave (i.e. in the build directory)
- if (!examplesDir.exists() || !demosDir.exists()) {
- examplesDir = examplesFallback;
- demosDir = demosFallback;
- }
- }
if (debugExamples())
qWarning() << QString::fromLatin1("Reading file '%1'...").arg(fi.absoluteFilePath());
@@ -467,13 +399,81 @@ void ExamplesListModel::updateExamples()
emit tagsUpdated();
}
-QStringList ExamplesListModel::exampleSources(QString *examplesInstallPath, QString *demosInstallPath,
- QString *examplesFallback, QString *demosFallback,
- QString *sourceFallback)
+void ExamplesListModel::updateQtVersions()
+{
+ QList<BaseQtVersion*> versions = QtVersionManager::validVersions();
+
+ QMutableListIterator<BaseQtVersion*> iter(versions);
+ while (iter.hasNext()) {
+ BaseQtVersion *version = iter.next();
+ if (!version->hasExamples()
+ && !version->hasDemos())
+ iter.remove();
+ }
+
+ // prioritize default qt version
+ ProjectExplorer::Kit *defaultKit = ProjectExplorer::KitManager::defaultKit();
+ BaseQtVersion *defaultVersion = QtKitInformation::qtVersion(defaultKit);
+ if (defaultVersion && versions.contains(defaultVersion))
+ versions.move(versions.indexOf(defaultVersion), 0);
+
+ if (m_qtVersions == versions)
+ return;
+
+ m_qtVersions = versions;
+ emit qtVersionsUpdated();
+
+ // determine Qt version to show
+ int newUniqueId = noQtVersionsId;
+ if (m_uniqueQtId != noQtVersionsId) {
+ //ensure that the unique Qt id is valid
+ foreach (BaseQtVersion *version, m_qtVersions) {
+ if (version->uniqueId() == m_uniqueQtId)
+ newUniqueId = m_uniqueQtId;
+ }
+ }
+
+ if (newUniqueId == noQtVersionsId)
+ newUniqueId = findHighestQtVersion();
+
+ if (newUniqueId != m_uniqueQtId) {
+ m_uniqueQtId = newUniqueId;
+ setUniqueQtVersionIdSetting(m_uniqueQtId);
+ emit selectedQtVersionChanged();
+ }
+
+}
+
+int ExamplesListModel::findHighestQtVersion() const
+{
+ QList<BaseQtVersion *> versions = qtVersions();
+
+ BaseQtVersion *newVersion = 0;
+
+ foreach (BaseQtVersion *version, versions) {
+ if (!newVersion) {
+ newVersion = version;
+ } else {
+ if (version->qtVersion() > newVersion->qtVersion()) {
+ newVersion = version;
+ } else if (version->qtVersion() == newVersion->qtVersion()
+ && version->uniqueId() < newVersion->uniqueId()) {
+ newVersion = version;
+ }
+ }
+ }
+
+ if (!newVersion && !versions.isEmpty())
+ newVersion = versions.first();
+
+ if (!newVersion)
+ return noQtVersionsId;
+
+ return newVersion->uniqueId();
+}
+
+QStringList ExamplesListModel::exampleSources(QString *examplesInstallPath, QString *demosInstallPath)
{
- QTC_CHECK(examplesFallback);
- QTC_CHECK(demosFallback);
- QTC_CHECK(sourceFallback);
QStringList sources;
QString resourceDir = Core::ICore::resourcePath() + QLatin1String("/welcomescreen/");
@@ -502,83 +502,31 @@ QStringList ExamplesListModel::exampleSources(QString *examplesInstallPath, QStr
if (size > 0)
return sources;
- // try to find a suitable Qt version
- // fallbacks are passed back if no example manifest is found
- // and we fallback to Qt Creator's shipped manifest (e.g. only old Qt Versions found)
- QString potentialExamplesFallback;
- QString potentialDemosFallback;
- QString potentialSourceFallback;
- const QStringList pattern(QLatin1String("*.xml"));
-
- // prioritize default qt version
- QList<BaseQtVersion *> qtVersions = QtVersionManager::validVersions();
- ProjectExplorer::Kit *defaultKit = ProjectExplorer::KitManager::defaultKit();
- BaseQtVersion *defaultVersion = QtKitInformation::qtVersion(defaultKit);
- if (defaultVersion && qtVersions.contains(defaultVersion))
- qtVersions.move(qtVersions.indexOf(defaultVersion), 0);
-
- foreach (BaseQtVersion *version, qtVersions) {
-
+ foreach (BaseQtVersion *version, qtVersions()) {
//filter for qt versions
if (version->uniqueId() != m_uniqueQtId && m_uniqueQtId != noQtVersionsId)
continue;
- // qt5 with examples OR demos manifest
- if (version->qtVersion().majorVersion == 5 && (version->hasExamples() || version->hasDemos())) {
- // examples directory in Qt5 is under the qtbase submodule,
- // search other submodule directories for further manifest files
- QDir qt5docPath = QDir(version->documentationPath());
- const QStringList examplesPattern(QLatin1String("examples-manifest.xml"));
- const QStringList demosPattern(QLatin1String("demos-manifest.xml"));
- QFileInfoList fis;
- foreach (QFileInfo subDir, qt5docPath.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot)) {
- if (version->hasExamples())
- fis << QDir(subDir.absoluteFilePath()).entryInfoList(examplesPattern);
- if (version->hasDemos())
- fis << QDir(subDir.absoluteFilePath()).entryInfoList(demosPattern);
- }
- if (!fis.isEmpty()) {
- foreach (const QFileInfo &fi, fis)
- sources.append(fi.filePath());
- if (examplesInstallPath)
- *examplesInstallPath = version->examplesPath();
- if (demosInstallPath)
- *demosInstallPath = version->demosPath();
- return sources;
- }
- }
-
+ // search for examples-manifest.xml, demos-manifest.xml in doc/*/
+ QDir qt5docPath = QDir(version->documentationPath());
+ const QStringList examplesPattern(QLatin1String("examples-manifest.xml"));
+ const QStringList demosPattern(QLatin1String("demos-manifest.xml"));
QFileInfoList fis;
- if (version->hasExamples())
- fis << QDir(version->examplesPath()).entryInfoList(pattern);
- if (version->hasDemos())
- fis << QDir(version->demosPath()).entryInfoList(pattern);
+ foreach (QFileInfo subDir, qt5docPath.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot)) {
+ fis << QDir(subDir.absoluteFilePath()).entryInfoList(examplesPattern);
+ fis << QDir(subDir.absoluteFilePath()).entryInfoList(demosPattern);
+ }
if (!fis.isEmpty()) {
foreach (const QFileInfo &fi, fis)
sources.append(fi.filePath());
+ if (examplesInstallPath)
+ *examplesInstallPath = version->examplesPath();
+ if (demosInstallPath)
+ *demosInstallPath = version->demosPath();
return sources;
}
- // check if this Qt version would be the preferred fallback, Qt 4 only
- if (version->qtVersion().majorVersion == 4 && version->hasExamples() && version->hasDemos()) { // cached, so no performance hit
- if (potentialExamplesFallback.isEmpty()) {
- potentialExamplesFallback = version->examplesPath();
- potentialDemosFallback = version->demosPath();
- potentialSourceFallback = version->sourcePath().toString();
- }
- }
}
- if (!potentialExamplesFallback.isEmpty()) {
- // We didn't find a manifest, use Creator-provided XML file with fall back Qt version
- // qDebug() << Q_FUNC_INFO << "falling through to Creator-provided XML file";
- sources << QString(resourceDir + QLatin1String("/examples_fallback.xml"));
- if (examplesFallback)
- *examplesFallback = potentialExamplesFallback;
- if (demosFallback)
- *demosFallback = potentialDemosFallback;
- if (sourceFallback)
- *sourceFallback = potentialSourceFallback;
- }
return sources;
}
@@ -650,18 +598,33 @@ QStringList ExamplesListModel::tags() const
return m_tags;
}
-void ExamplesListModel::setUniqueQtId(int id)
+void ExamplesListModel::update()
{
- m_uniqueQtId = id;
+ updateQtVersions();
updateExamples();
}
+int ExamplesListModel::selectedQtVersion() const
+{
+ return m_uniqueQtId;
+}
+
+void ExamplesListModel::selectQtVersion(int id)
+{
+ if (m_uniqueQtId != id) {
+ m_uniqueQtId = id;
+ setUniqueQtVersionIdSetting(id);
+ updateExamples();
+ emit selectedQtVersionChanged();
+ }
+}
+
ExamplesListModelFilter::ExamplesListModelFilter(ExamplesListModel *sourceModel, QObject *parent) :
QSortFilterProxyModel(parent),
m_showTutorialsOnly(true),
m_sourceModel(sourceModel),
m_timerId(0),
- m_qtVersionModel(new QtVersionsModel(this)),
+ m_qtVersionModel(new QtVersionsModel(sourceModel, this)),
m_blockIndexUpdate(false),
m_qtVersionManagerInitialized(false),
m_helpManagerInitialized(false),
@@ -676,6 +639,8 @@ ExamplesListModelFilter::ExamplesListModelFilter(ExamplesListModel *sourceModel,
connect(this, SIGNAL(showTutorialsOnlyChanged()), SLOT(updateFilter()));
+ connect(m_sourceModel, SIGNAL(selectedQtVersionChanged()), this, SIGNAL(qtVersionIndexChanged()));
+
setSourceModel(m_sourceModel);
}
@@ -764,8 +729,7 @@ void ExamplesListModelFilter::filterForQtById(int id)
if (m_blockIndexUpdate || !m_initalized)
return;
- setUniqueQtVersionIdSetting(id);
- m_sourceModel->setUniqueQtId(id);
+ m_sourceModel->selectQtVersion(id);
}
void ExamplesListModelFilter::setShowTutorialsOnly(bool showTutorialsOnly)
@@ -777,9 +741,7 @@ void ExamplesListModelFilter::setShowTutorialsOnly(bool showTutorialsOnly)
void ExamplesListModelFilter::handleQtVersionsChanged()
{
m_blockIndexUpdate = true;
- m_qtVersionModel->setupQtVersions();
- m_sourceModel->updateExamples();
- emit qtVersionIndexChanged();
+ m_sourceModel->update();
m_blockIndexUpdate = false;
}
@@ -812,7 +774,6 @@ void ExamplesListModelFilter::tryToInitialize()
connect(ProjectExplorer::KitManager::instance(), SIGNAL(defaultkitChanged()),
this, SLOT(handleQtVersionsChanged()));
handleQtVersionsChanged();
- m_sourceModel->updateExamples();
}
}
@@ -826,8 +787,8 @@ void ExamplesListModelFilter::delayedUpdateFilter()
int ExamplesListModelFilter::qtVersionIndex() const
{
- int id = uniqueQtVersionIdSetting();
- int index = m_qtVersionModel->indexForUniqueId(id);
+ int id = m_sourceModel->selectedQtVersion();
+ int index = m_qtVersionModel->indexForUniqueId(id);
return index;
}
diff --git a/src/plugins/qtsupport/exampleslistmodel.h b/src/plugins/qtsupport/exampleslistmodel.h
index 9ae31efb12..6fdcd44498 100644
--- a/src/plugins/qtsupport/exampleslistmodel.h
+++ b/src/plugins/qtsupport/exampleslistmodel.h
@@ -35,24 +35,30 @@
#include <QStandardItemModel>
#include <QStringList>
#include <QXmlStreamReader>
+#include <qtsupport/baseqtversion.h>
namespace QtSupport {
namespace Internal {
+class ExamplesListModel;
+
class QtVersionsModel : public QStandardItemModel
{
Q_OBJECT
public:
- QtVersionsModel(QObject *parent);
+ QtVersionsModel(ExamplesListModel *examplesModel, QObject *parent);
- int findHighestQtVersion();
- void setupQtVersions();
int indexForUniqueId(int uniqueId);
public slots:
+ void update();
+
QVariant get(int i);
QVariant getId(int i);
+
+private:
+ ExamplesListModel *examplesModel;
};
enum ExampleRoles
@@ -104,22 +110,33 @@ public:
void beginReset() { beginResetModel(); }
void endReset() { endResetModel(); }
- void setUniqueQtId(int id);
- void updateExamples();
+ void update();
+
+ int selectedQtVersion() const;
+ void selectQtVersion(int id);
+
+ QList<BaseQtVersion*> qtVersions() const { return m_qtVersions; }
signals:
+ void qtVersionsUpdated();
+ void selectedQtVersionChanged();
void tagsUpdated();
private:
+ void updateQtVersions();
+ void updateExamples();
+
+ void updateSelectedQtVersion();
+ int findHighestQtVersion() const;
+
void parseExamples(QXmlStreamReader *reader, const QString &projectsOffset,
const QString &examplesInstallPath);
void parseDemos(QXmlStreamReader *reader, const QString &projectsOffset,
const QString &demosInstallPath);
void parseTutorials(QXmlStreamReader *reader, const QString &projectsOffset);
- QStringList exampleSources(QString *examplesInstallPath, QString *demosInstallPath,
- QString *examplesFallback, QString *demosFallback,
- QString *sourceFallback);
+ QStringList exampleSources(QString *examplesInstallPath, QString *demosInstallPath);
+ QList<BaseQtVersion*> m_qtVersions;
QList<ExampleItem> m_exampleItems;
QStringList m_tags;
int m_uniqueQtId;
diff --git a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp
index f5b9c68acd..7f3d2bf135 100644
--- a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp
+++ b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp
@@ -407,13 +407,12 @@ void ExamplesWelcomePage::openProject(const QString &projectFile, const QStringL
ProjectExplorer::ProjectExplorerPlugin *peplugin = ProjectExplorer::ProjectExplorerPlugin::instance();
if (proFile.isEmpty())
return;
- if (ProjectExplorer::Project *project = peplugin->openProject(proFile, &errorMessage)) {
+ if (peplugin->openProject(proFile, &errorMessage)) {
Core::ICore::openFiles(filesToOpen);
- if (project->needsConfiguration())
- project->configureAsExampleProject(platforms);
Core::ModeManager::activateMode(Core::Constants::MODE_EDIT);
if (help.isValid())
Core::HelpManager::handleHelpRequest(help.toString() + QLatin1String("?view=split"));
+ Core::ModeManager::activateMode(ProjectExplorer::Constants::MODE_SESSION);
}
if (!errorMessage.isEmpty())
QMessageBox::critical(Core::ICore::mainWindow(), tr("Failed to Open Project"), errorMessage);
diff --git a/src/plugins/qtsupport/qtsupport.qbs b/src/plugins/qtsupport/qtsupport.qbs
index caf11a4106..fedbd84578 100644
--- a/src/plugins/qtsupport/qtsupport.qbs
+++ b/src/plugins/qtsupport/qtsupport.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcFunctions
import QtcPlugin
diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.ui b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.ui
index 1d935a9c2c..2b38ed1ecd 100644
--- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.ui
+++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.ui
@@ -140,7 +140,7 @@
<item>
<widget class="QLineEdit" name="portsLineEdit">
<property name="toolTip">
- <string>You can enter lists and ranges like this: 1024,1026-1028,1030</string>
+ <string>You can enter lists and ranges like this: '1024,1026-1028,1030'.</string>
</property>
</widget>
</item>
diff --git a/src/plugins/remotelinux/remotelinux.qbs b/src/plugins/remotelinux/remotelinux.qbs
index cc22cdff19..650303046d 100644
--- a/src/plugins/remotelinux/remotelinux.qbs
+++ b/src/plugins/remotelinux/remotelinux.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/resourceeditor/resourceeditor.qbs b/src/plugins/resourceeditor/resourceeditor.qbs
index 3ed9ee3226..6d7d6c7224 100644
--- a/src/plugins/resourceeditor/resourceeditor.qbs
+++ b/src/plugins/resourceeditor/resourceeditor.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/resourceeditor/resourcenode.cpp b/src/plugins/resourceeditor/resourcenode.cpp
index e01090a93a..7a95719efe 100644
--- a/src/plugins/resourceeditor/resourcenode.cpp
+++ b/src/plugins/resourceeditor/resourcenode.cpp
@@ -48,7 +48,7 @@ using namespace ResourceEditor::Internal;
static bool priority(const QStringList &files)
{
if (files.isEmpty())
- return -1;
+ return false;
Core::MimeType mt = Core::MimeDatabase::findByFile(files.at(0));
QString type = mt.type();
if (type.startsWith(QLatin1String("image/"))
@@ -219,8 +219,6 @@ bool ResourceTopLevelNode::addPrefix(const QString &prefix, const QString &lang)
file.save();
Core::DocumentManager::unexpectFileChange(path());
- update();
-
return true;
}
@@ -236,8 +234,6 @@ bool ResourceTopLevelNode::removePrefix(const QString &prefix, const QString &la
Core::DocumentManager::expectFileChange(path());
file.save();
Core::DocumentManager::unexpectFileChange(path());
-
- update();
return true;
}
}
@@ -261,6 +257,11 @@ ProjectExplorer::FolderNode::AddNewInformation ResourceTopLevelNode::addNewInfor
return AddNewInformation(name, p);
}
+bool ResourceTopLevelNode::showInSimpleTree() const
+{
+ return true;
+}
+
ResourceFolderNode::ResourceFolderNode(const QString &prefix, const QString &lang, ResourceTopLevelNode *parent)
: ProjectExplorer::FolderNode(parent->path() + QLatin1Char('/') + prefix),
// TOOD Why add existing directory doesn't work
@@ -353,7 +354,7 @@ bool ResourceFolderNode::renamePrefix(const QString &prefix, const QString &lang
ResourceFile file(m_topLevelNode->path());
if (!file.load())
return false;
- int index = file.indexOfPrefix(prefix, lang);
+ int index = file.indexOfPrefix(m_prefix, m_lang);
if (index == -1)
return false;
diff --git a/src/plugins/resourceeditor/resourcenode.h b/src/plugins/resourceeditor/resourcenode.h
index 9aa4166c93..01dfaf1c2e 100644
--- a/src/plugins/resourceeditor/resourcenode.h
+++ b/src/plugins/resourceeditor/resourcenode.h
@@ -60,6 +60,7 @@ public:
bool removePrefix(const QString &prefix, const QString &lang);
AddNewInformation addNewInformation(const QStringList &files, Node *context) const;
+ bool showInSimpleTree() const;
private:
Internal::ResourceFileWatcher *m_document;
diff --git a/src/plugins/subversion/subversion.qbs b/src/plugins/subversion/subversion.qbs
index e69bceaa0a..87d207528b 100644
--- a/src/plugins/subversion/subversion.qbs
+++ b/src/plugins/subversion/subversion.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp
index ce429fea9a..a9772ca665 100644
--- a/src/plugins/subversion/subversionplugin.cpp
+++ b/src/plugins/subversion/subversionplugin.cpp
@@ -564,7 +564,8 @@ void SubversionPlugin::revertAll()
const VcsBase::VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasTopLevel(), return);
const QString title = tr("Revert repository");
- if (QMessageBox::warning(0, title, tr("Revert all pending changes to the repository?"),
+ if (QMessageBox::warning(Core::ICore::dialogParent(), title,
+ tr("Revert all pending changes to the repository?"),
QMessageBox::Yes, QMessageBox::No) == QMessageBox::No)
return;
// NoteL: Svn "revert ." doesn not work.
@@ -574,7 +575,8 @@ void SubversionPlugin::revertAll()
runSvn(state.topLevel(), args, m_settings.timeOutMs(),
SshPasswordPrompt|ShowStdOutInLogWindow);
if (revertResponse.error)
- QMessageBox::warning(0, title, tr("Revert failed: %1").arg(revertResponse.message), QMessageBox::Ok);
+ QMessageBox::warning(Core::ICore::dialogParent(), title,
+ tr("Revert failed: %1").arg(revertResponse.message), QMessageBox::Ok);
else
subVersionControl()->emitRepositoryChanged(state.topLevel());
}
@@ -594,7 +596,8 @@ void SubversionPlugin::revertCurrentFile()
if (diffResponse.stdOut.isEmpty())
return;
- if (QMessageBox::warning(0, QLatin1String("svn revert"), tr("The file has been changed. Do you want to revert it?"),
+ if (QMessageBox::warning(Core::ICore::dialogParent(), QLatin1String("svn revert"),
+ tr("The file has been changed. Do you want to revert it?"),
QMessageBox::Yes, QMessageBox::No) == QMessageBox::No)
return;
diff --git a/src/plugins/tasklist/tasklist.qbs b/src/plugins/tasklist/tasklist.qbs
index 725a7d8de6..b00c1e7505 100644
--- a/src/plugins/tasklist/tasklist.qbs
+++ b/src/plugins/tasklist/tasklist.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp
index 6772d9a64b..b96687bdcb 100644
--- a/src/plugins/texteditor/basefilefind.cpp
+++ b/src/plugins/texteditor/basefilefind.cpp
@@ -132,7 +132,8 @@ void BaseFileFind::runNewSearch(const QString &txt, Core::FindFlags findFlags,
updateComboEntries(d->m_filterCombo, true);
SearchResult *search = Core::SearchResultWindow::instance()->startNewSearch(label(),
toolTip().arg(Core::IFindFilter::descriptionForFindFlags(findFlags)),
- txt, searchMode, QString::fromLatin1("TextEditor"));
+ txt, searchMode, Core::SearchResultWindow::PreserveCaseEnabled,
+ QString::fromLatin1("TextEditor"));
search->setTextToReplace(txt);
search->setSearchAgainSupported(true);
FileFindParameters parameters;
diff --git a/src/plugins/texteditor/behaviorsettingswidget.cpp b/src/plugins/texteditor/behaviorsettingswidget.cpp
index 818e884c57..ab3dc7e9db 100644
--- a/src/plugins/texteditor/behaviorsettingswidget.cpp
+++ b/src/plugins/texteditor/behaviorsettingswidget.cpp
@@ -186,10 +186,10 @@ void BehaviorSettingsWidget::updateConstrainTooltipsBoxTooltip() const
{
if (d->m_ui.constrainTooltipsBox->currentIndex() == 0) {
d->m_ui.constrainTooltipsBox->setToolTip(
- tr("Display context-sensitive help or type information on mouseover."));
+ tr("Displays context-sensitive help or type information on mouseover."));
} else {
d->m_ui.constrainTooltipsBox->setToolTip(
- tr("Display context-sensitive help or type information on Shift+Mouseover."));
+ tr("Displays context-sensitive help or type information on Shift+Mouseover."));
}
}
diff --git a/src/plugins/texteditor/behaviorsettingswidget.ui b/src/plugins/texteditor/behaviorsettingswidget.ui
index 423a270d84..05cee85794 100644
--- a/src/plugins/texteditor/behaviorsettingswidget.ui
+++ b/src/plugins/texteditor/behaviorsettingswidget.ui
@@ -360,7 +360,7 @@ Specifies how backspace interacts with indentation.
<item>
<widget class="QCheckBox" name="keyboardTooltips">
<property name="toolTip">
- <string>Press Alt to display context-sensitive help or type information as tooltips.</string>
+ <string>Pressing Alt displays context-sensitive help or type information as tooltips.</string>
</property>
<property name="text">
<string>Show help tooltips using keyboard shortcut (Alt)</string>
diff --git a/src/plugins/texteditor/codeassist/genericproposalwidget.cpp b/src/plugins/texteditor/codeassist/genericproposalwidget.cpp
index 839e26f31d..5bc89f1dd7 100644
--- a/src/plugins/texteditor/codeassist/genericproposalwidget.cpp
+++ b/src/plugins/texteditor/codeassist/genericproposalwidget.cpp
@@ -36,6 +36,7 @@
#include <texteditor/completionsettings.h>
#include <texteditor/texteditorconstants.h>
+#include <utils/elidinglabel.h>
#include <utils/faketooltip.h>
#include <utils/hostosinfo.h>
@@ -150,13 +151,16 @@ class GenericProposalInfoFrame : public Utils::FakeToolTip
{
public:
GenericProposalInfoFrame(QWidget *parent = 0)
- : Utils::FakeToolTip(parent), m_label(new QLabel(this))
+ : Utils::FakeToolTip(parent), m_label(new Utils::ElidingLabel(this))
{
QVBoxLayout *layout = new QVBoxLayout(this);
layout->setMargin(0);
layout->setSpacing(0);
layout->addWidget(m_label);
+ // Limit horizontal width
+ m_label->setSizePolicy(QSizePolicy::Fixed, m_label->sizePolicy().verticalPolicy());
+
m_label->setForegroundRole(QPalette::ToolTipText);
m_label->setBackgroundRole(QPalette::ToolTipBase);
}
@@ -166,6 +170,20 @@ public:
m_label->setText(text);
}
+ // Workaround QTCREATORBUG-11653
+ void calculateMaximumWidth()
+ {
+ const QDesktopWidget *desktopWidget = QApplication::desktop();
+ const int desktopWidth = desktopWidget->isVirtualDesktop()
+ ? desktopWidget->width()
+ : desktopWidget->availableGeometry(desktopWidget->primaryScreen()).width();
+ const QMargins widgetMargins = contentsMargins();
+ const QMargins layoutMargins = layout()->contentsMargins();
+ const int margins = widgetMargins.left() + widgetMargins.right()
+ + layoutMargins.left() + layoutMargins.right();
+ m_label->setMaximumWidth(desktopWidth - this->pos().x() - margins);
+ }
+
private:
QLabel *m_label;
};
@@ -296,6 +314,7 @@ void GenericProposalWidgetPrivate::maybeShowInfoTip()
m_infoFrame->move(m_completionListView->infoFramePos());
m_infoFrame->setText(infoTip);
+ m_infoFrame->calculateMaximumWidth();
m_infoFrame->adjustSize();
m_infoFrame->show();
m_infoFrame->raise();
diff --git a/src/plugins/texteditor/colorschemeedit.ui b/src/plugins/texteditor/colorschemeedit.ui
index 65af997ede..12e34f937c 100644
--- a/src/plugins/texteditor/colorschemeedit.ui
+++ b/src/plugins/texteditor/colorschemeedit.ui
@@ -61,7 +61,7 @@
<item>
<widget class="QToolButton" name="eraseForegroundToolButton">
<property name="toolTip">
- <string>Erase foreground</string>
+ <string>Erase foreground.</string>
</property>
<property name="text">
<string>x</string>
@@ -107,7 +107,7 @@
<item>
<widget class="QToolButton" name="eraseBackgroundToolButton">
<property name="toolTip">
- <string>Erase background</string>
+ <string>Erase background.</string>
</property>
<property name="text">
<string>x</string>
diff --git a/src/plugins/texteditor/displaysettingspage.ui b/src/plugins/texteditor/displaysettingspage.ui
index 46bd0389c9..b60d8abe71 100644
--- a/src/plugins/texteditor/displaysettingspage.ui
+++ b/src/plugins/texteditor/displaysettingspage.ui
@@ -97,7 +97,7 @@
<item row="4" column="0">
<widget class="QCheckBox" name="visualizeWhitespace">
<property name="toolTip">
- <string>Show tabs and spaces.</string>
+ <string>Shows tabs and spaces.</string>
</property>
<property name="text">
<string>&amp;Visualize whitespace</string>
diff --git a/src/plugins/texteditor/plaintexteditorfactory.cpp b/src/plugins/texteditor/plaintexteditorfactory.cpp
index 4323de80c7..c8af5fbcf5 100644
--- a/src/plugins/texteditor/plaintexteditorfactory.cpp
+++ b/src/plugins/texteditor/plaintexteditorfactory.cpp
@@ -89,7 +89,7 @@ void PlainTextEditorFactory::updateEditorInfoBar(Core::IEditor *editor)
tr("A highlight definition was not found for this file. "
"Would you like to try to find one?"),
Core::InfoBarEntry::GlobalSuppressionEnabled);
- info.setCustomButtonInfo(tr("Show highlighter options..."),
+ info.setCustomButtonInfo(tr("Show Highlighter Options..."),
textEditor, SLOT(acceptMissingSyntaxDefinitionInfo()));
infoBar->addInfo(info);
}
diff --git a/src/plugins/texteditor/texteditor.qbs b/src/plugins/texteditor/texteditor.qbs
index 8d1703c169..a695c2af8d 100644
--- a/src/plugins/texteditor/texteditor.qbs
+++ b/src/plugins/texteditor/texteditor.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/texteditor/texteditorsettings.cpp b/src/plugins/texteditor/texteditorsettings.cpp
index 2fbbe433d0..b96f75d208 100644
--- a/src/plugins/texteditor/texteditorsettings.cpp
+++ b/src/plugins/texteditor/texteditorsettings.cpp
@@ -207,7 +207,7 @@ TextEditorSettings::TextEditorSettings(QObject *parent)
tr("Reserved keywords of the programming language."),
Qt::darkYellow));
formatDescr.append(FormatDescription(C_OPERATOR, tr("Operator"),
- tr("Operators. (For example operator++ operator-=)")));
+ tr("Operators (for example operator++ or operator-=).")));
formatDescr.append(FormatDescription(C_PREPROCESSOR, tr("Preprocessor"),
tr("Preprocessor directives."), Qt::darkBlue));
formatDescr.append(FormatDescription(C_LABEL, tr("Label"), tr("Labels for goto statements."),
@@ -220,7 +220,7 @@ TextEditorSettings::TextEditorSettings(QObject *parent)
formatDescr.append(FormatDescription(C_DOXYGEN_TAG, tr("Doxygen Tag"), tr("Doxygen tags."),
Qt::blue));
formatDescr.append(FormatDescription(C_VISUAL_WHITESPACE, tr("Visual Whitespace"),
- tr("Whitespace\nWill not be applied to whitespace "
+ tr("Whitespace.\nWill not be applied to whitespace "
"in comments and strings."), Qt::lightGray));
formatDescr.append(FormatDescription(C_DISABLED_CODE, tr("Disabled Code"),
tr("Code disabled by preprocessor directives.")));
diff --git a/src/plugins/todo/todo.qbs b/src/plugins/todo/todo.qbs
index b97649a3e8..0ee3e4c2ee 100644
--- a/src/plugins/todo/todo.qbs
+++ b/src/plugins/todo/todo.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/updateinfo/updateinfo.qbs b/src/plugins/updateinfo/updateinfo.qbs
index be4722aaba..47b26a895e 100644
--- a/src/plugins/updateinfo/updateinfo.qbs
+++ b/src/plugins/updateinfo/updateinfo.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/valgrind/valgrind.qbs b/src/plugins/valgrind/valgrind.qbs
index beff9f2922..0105d887bc 100644
--- a/src/plugins/valgrind/valgrind.qbs
+++ b/src/plugins/valgrind/valgrind.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/valgrind/valgrindconfigwidget.ui b/src/plugins/valgrind/valgrindconfigwidget.ui
index 2c0e989760..c4344b67d1 100644
--- a/src/plugins/valgrind/valgrindconfigwidget.ui
+++ b/src/plugins/valgrind/valgrindconfigwidget.ui
@@ -152,9 +152,9 @@
&lt;p&gt;By default, only instruction read accesses will be counted (&quot;Ir&quot;).&lt;/p&gt;
&lt;p&gt;
With cache simulation, further event counters are enabled:
-&lt;ul&gt;&lt;li&gt;Cache misses on instruction reads (&quot;I1mr&quot;/&quot;I2mr&quot;)&lt;/li&gt;
-&lt;li&gt;Data read accesses (&quot;Dr&quot;) and related cache misses (&quot;D1mr&quot;/&quot;D2mr&quot;)&lt;/li&gt;
-&lt;li&gt;Data write accesses (&quot;Dw&quot;) and related cache misses (&quot;D1mw&quot;/&quot;D2mw&quot;)&lt;/li&gt;&lt;/ul&gt;
+&lt;ul&gt;&lt;li&gt;Cache misses on instruction reads (&quot;I1mr&quot;/&quot;I2mr&quot;).&lt;/li&gt;
+&lt;li&gt;Data read accesses (&quot;Dr&quot;) and related cache misses (&quot;D1mr&quot;/&quot;D2mr&quot;).&lt;/li&gt;
+&lt;li&gt;Data write accesses (&quot;Dw&quot;) and related cache misses (&quot;D1mw&quot;/&quot;D2mw&quot;).&lt;/li&gt;&lt;/ul&gt;
&lt;/p&gt;
&lt;/body&gt;&lt;/html&gt;</string>
@@ -168,12 +168,12 @@ With cache simulation, further event counters are enabled:
<widget class="QCheckBox" name="enableBranchSim">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;
-&lt;p&gt;Do branch prediction simulation.&lt;/p&gt;
+&lt;p&gt;Does branch prediction simulation.&lt;/p&gt;
&lt;p&gt;Further event counters are enabled: &lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Number of executed conditional branches and related predictor misses (
-&quot;Bc&quot;/&quot;Bcm&quot;)&lt;/li&gt;
+&quot;Bc&quot;/&quot;Bcm&quot;).&lt;/li&gt;
&lt;li&gt;Executed indirect jumps and related misses of the jump address predictor (
-&quot;Bi&quot;/&quot;Bim&quot;)&lt;/li&gt;&lt;/ul&gt;&lt;/body&gt;&lt;/html&gt;</string>
+&quot;Bi&quot;/&quot;Bim&quot;).&lt;/li&gt;&lt;/ul&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Enable branch prediction simulation</string>
@@ -183,7 +183,7 @@ With cache simulation, further event counters are enabled:
<item row="2" column="0">
<widget class="QCheckBox" name="collectSystime">
<property name="toolTip">
- <string>Collect information for system call times.</string>
+ <string>Collects information for system call times.</string>
</property>
<property name="text">
<string>Collect system call time</string>
@@ -205,9 +205,6 @@ With cache simulation, further event counters are enabled:
</item>
<item row="1" column="0">
<widget class="QLabel" name="visualisationMinimumInclusiveCostRatioLabel">
- <property name="toolTip">
- <string/>
- </property>
<property name="text">
<string>Visualization: Minimum event cost:</string>
</property>
diff --git a/src/plugins/vcsbase/basecheckoutwizardpage.cpp b/src/plugins/vcsbase/basecheckoutwizardpage.cpp
index 672f3deea9..a9ea539d1e 100644
--- a/src/plugins/vcsbase/basecheckoutwizardpage.cpp
+++ b/src/plugins/vcsbase/basecheckoutwizardpage.cpp
@@ -30,6 +30,7 @@
#include "basecheckoutwizardpage.h"
#include "ui_basecheckoutwizardpage.h"
+#include <QDir>
#include <QIcon>
/*!
@@ -105,9 +106,14 @@ void BaseCheckoutWizardPage::addRepositoryControl(QWidget *w)
bool BaseCheckoutWizardPage::checkIsValid() const
{
- return d->ui.pathChooser->isValid()
- && !d->ui.checkoutDirectoryLineEdit->text().isEmpty()
- && !d->ui.repositoryLineEdit->text().isEmpty();
+ if (!d->ui.pathChooser->isValid() || d->ui.repositoryLineEdit->text().isEmpty())
+ return false;
+
+ const QString checkoutDirectory = d->ui.checkoutDirectoryLineEdit->text();
+ if (checkoutDirectory.isEmpty())
+ return false;
+ const QDir dir(d->ui.pathChooser->path() + QLatin1Char('/') + checkoutDirectory);
+ return !dir.exists() || (dir.count() <= 2);
}
void BaseCheckoutWizardPage::addRepositoryControl(QString &description, QWidget *w)
diff --git a/src/plugins/vcsbase/checkoutprogresswizardpage.cpp b/src/plugins/vcsbase/checkoutprogresswizardpage.cpp
index b319e3f97b..e188f5391d 100644
--- a/src/plugins/vcsbase/checkoutprogresswizardpage.cpp
+++ b/src/plugins/vcsbase/checkoutprogresswizardpage.cpp
@@ -54,6 +54,7 @@ CheckoutProgressWizardPage::CheckoutProgressWizardPage(QWidget *parent) :
QWizardPage(parent),
ui(new Ui::CheckoutProgressWizardPage),
m_startedStatus(tr("Checkout started...")),
+ m_overwriteOutput(false),
m_state(Idle)
{
ui->setupUi(this);
@@ -86,6 +87,7 @@ void CheckoutProgressWizardPage::start(Command *command)
connect(command, SIGNAL(finished(bool,int,QVariant)), this, SLOT(slotFinished(bool,int,QVariant)));
QApplication::setOverrideCursor(Qt::WaitCursor);
ui->logPlainTextEdit->clear();
+ m_overwriteOutput = false;
ui->statusLabel->setText(m_startedStatus);
ui->statusLabel->setPalette(QPalette());
m_state = Running;
@@ -121,7 +123,20 @@ void CheckoutProgressWizardPage::slotFinished(bool ok, int exitCode, const QVari
void CheckoutProgressWizardPage::slotOutput(const QString &text)
{
- ui->logPlainTextEdit->appendPlainText(text.trimmed());
+ int startPos = 0;
+ int crPos = -1;
+ const QString ansiEraseToEol = QLatin1String("\x1b[K");
+ while ((crPos = text.indexOf(QLatin1Char('\r'), startPos)) >= 0) {
+ QString part = text.mid(startPos, crPos - startPos);
+ // Discard ANSI erase-to-eol
+ if (part.endsWith(ansiEraseToEol))
+ part.chop(ansiEraseToEol.length());
+ outputText(part);
+ startPos = crPos + 1;
+ m_overwriteOutput = true;
+ }
+ if (startPos < text.count())
+ outputText(text.mid(startPos));
}
void CheckoutProgressWizardPage::slotError(const QString &text)
@@ -129,6 +144,18 @@ void CheckoutProgressWizardPage::slotError(const QString &text)
m_error.append(text);
}
+void CheckoutProgressWizardPage::outputText(const QString &text)
+{
+ if (m_overwriteOutput) {
+ QTextCursor cursor = ui->logPlainTextEdit->textCursor();
+ cursor.clearSelection();
+ cursor.movePosition(QTextCursor::StartOfBlock, QTextCursor::KeepAnchor);
+ ui->logPlainTextEdit->setTextCursor(cursor);
+ m_overwriteOutput = false;
+ }
+ ui->logPlainTextEdit->insertPlainText(text);
+}
+
void CheckoutProgressWizardPage::terminate()
{
if (m_command)
diff --git a/src/plugins/vcsbase/checkoutprogresswizardpage.h b/src/plugins/vcsbase/checkoutprogresswizardpage.h
index f59782e979..bd0bf104a3 100644
--- a/src/plugins/vcsbase/checkoutprogresswizardpage.h
+++ b/src/plugins/vcsbase/checkoutprogresswizardpage.h
@@ -67,11 +67,14 @@ private slots:
void slotError(const QString &text);
private:
+ void outputText(const QString &text);
+
Ui::CheckoutProgressWizardPage *ui;
Command *m_command;
QString m_startedStatus;
QString m_error;
+ bool m_overwriteOutput;
State m_state;
};
diff --git a/src/plugins/vcsbase/cleandialog.cpp b/src/plugins/vcsbase/cleandialog.cpp
index 6d5183aacc..81568caa2d 100644
--- a/src/plugins/vcsbase/cleandialog.cpp
+++ b/src/plugins/vcsbase/cleandialog.cpp
@@ -223,7 +223,7 @@ void CleanDialog::addFile(const QString &workingDirectory, QString fileName, boo
// Tooltip with size information
if (fi.isFile()) {
const QString lastModified = fi.lastModified().toString(Qt::DefaultLocaleShortDate);
- nameItem->setToolTip(tr("%n bytes, last modified %1", 0, fi.size()).arg(lastModified));
+ nameItem->setToolTip(tr("%n bytes, last modified %1.", 0, fi.size()).arg(lastModified));
}
d->m_filesModel->appendRow(nameItem);
}
diff --git a/src/plugins/vcsbase/commonsettingspage.cpp b/src/plugins/vcsbase/commonsettingspage.cpp
index 9e960d7ce0..2ac0c6af3b 100644
--- a/src/plugins/vcsbase/commonsettingspage.cpp
+++ b/src/plugins/vcsbase/commonsettingspage.cpp
@@ -58,7 +58,7 @@ CommonSettingsWidget::CommonSettingsWidget(QWidget *parent) :
m_ui->nickNameMailMapChooser->setHistoryCompleter(QLatin1String("Vcs.NickMap.History"));
m_ui->sshPromptChooser->setExpectedKind(Utils::PathChooser::ExistingCommand);
m_ui->sshPromptChooser->setHistoryCompleter(QLatin1String("Vcs.SshPrompt.History"));
- const QString patchToolTip = tr("Command used for reverting diff chunks");
+ const QString patchToolTip = tr("Command used for reverting diff chunks.");
m_ui->patchCommandLabel->setToolTip(patchToolTip);
m_ui->patchChooser->setToolTip(patchToolTip);
m_ui->patchChooser->setExpectedKind(Utils::PathChooser::ExistingCommand);
diff --git a/src/plugins/vcsbase/commonsettingspage.ui b/src/plugins/vcsbase/commonsettingspage.ui
index 3700f037d2..99b43c8594 100644
--- a/src/plugins/vcsbase/commonsettingspage.ui
+++ b/src/plugins/vcsbase/commonsettingspage.ui
@@ -73,7 +73,7 @@
<widget class="QLabel" name="nickNameMailMapLabel">
<property name="toolTip">
<string>A file listing user names and email addresses in a 4-column mailmap format:
-name &lt;email&gt; alias &lt;email&gt;</string>
+'name &lt;email&gt; alias &lt;email&gt;'.</string>
</property>
<property name="text">
<string>User/&amp;alias configuration file:</string>
diff --git a/src/plugins/vcsbase/vcsbase.qbs b/src/plugins/vcsbase/vcsbase.qbs
index b6d5b9a621..8d93398fe7 100644
--- a/src/plugins/vcsbase/vcsbase.qbs
+++ b/src/plugins/vcsbase/vcsbase.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/vcsbase/vcsbaseplugin.cpp b/src/plugins/vcsbase/vcsbaseplugin.cpp
index 55427c17a7..84703732d4 100644
--- a/src/plugins/vcsbase/vcsbaseplugin.cpp
+++ b/src/plugins/vcsbase/vcsbaseplugin.cpp
@@ -633,7 +633,7 @@ void VcsBasePlugin::promptToDeleteCurrentFile()
QTC_ASSERT(state.hasFile(), return);
const bool rc = Core::VcsManager::promptToDelete(versionControl(), state.currentFile());
if (!rc)
- QMessageBox::warning(0, tr("Version Control"),
+ QMessageBox::warning(Core::ICore::dialogParent(), tr("Version Control"),
tr("The file '%1' could not be deleted.").
arg(QDir::toNativeSeparators(state.currentFile())),
QMessageBox::Ok);
diff --git a/src/plugins/welcome/welcome.qbs b/src/plugins/welcome/welcome.qbs
index ef284403b4..c44fbb8965 100644
--- a/src/plugins/welcome/welcome.qbs
+++ b/src/plugins/welcome/welcome.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
diff --git a/src/plugins/winrt/winrt.pro b/src/plugins/winrt/winrt.pro
index 85c18c7c06..f86adb8fcd 100644
--- a/src/plugins/winrt/winrt.pro
+++ b/src/plugins/winrt/winrt.pro
@@ -6,6 +6,7 @@ HEADERS += \
winrtdevice.h \
winrtdevicefactory.h \
winrtpackagedeploymentstep.h \
+ winrtpackagedeploymentstepwidget.h \
winrtphoneqtversion.h \
winrtplugin.h \
winrtqtversion.h \
@@ -20,6 +21,7 @@ SOURCES += \
winrtdevice.cpp \
winrtdevicefactory.cpp \
winrtpackagedeploymentstep.cpp \
+ winrtpackagedeploymentstepwidget.cpp \
winrtphoneqtversion.cpp \
winrtplugin.cpp \
winrtqtversion.cpp \
@@ -32,4 +34,5 @@ SOURCES += \
DEFINES += WINRT_LIBRARY
FORMS += \
+ winrtpackagedeploymentstepwidget.ui \
winrtrunconfigurationwidget.ui
diff --git a/src/plugins/winrt/winrt.qbs b/src/plugins/winrt/winrt.qbs
index e035b11232..45f3e3acee 100644
--- a/src/plugins/winrt/winrt.qbs
+++ b/src/plugins/winrt/winrt.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcPlugin
@@ -21,6 +21,9 @@ QtcPlugin {
"winrtdevicefactory.h",
"winrtpackagedeploymentstep.cpp",
"winrtpackagedeploymentstep.h",
+ "winrtpackagedeploymentstepwidget.cpp",
+ "winrtpackagedeploymentstepwidget.h",
+ "winrtpackagedeploymentstepwidget.ui",
"winrtphoneqtversion.cpp",
"winrtphoneqtversion.h",
"winrtplugin.cpp",
diff --git a/src/plugins/winrt/winrtconstants.h b/src/plugins/winrt/winrtconstants.h
index a573a4fc6d..3704603cff 100644
--- a/src/plugins/winrt/winrtconstants.h
+++ b/src/plugins/winrt/winrtconstants.h
@@ -37,6 +37,7 @@ 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";
const char WINRT_BUILD_STEP_DEPLOY[] = "WinRt.BuildStep.Deploy";
+const char WINRT_BUILD_STEP_DEPLOY_ARGUMENTS[] = "WinRt.BuildStep.Deploy.Arguments";
const char WINRT_WINRTQT[] = "WinRt.QtVersion.WindowsRuntime";
const char WINRT_WINPHONEQT[] = "WinRt.QtVersion.WindowsPhone";
const char WINRT_QTMAP_SUBKEYNAME[] = "WinRt";
diff --git a/src/plugins/winrt/winrtdeployconfiguration.cpp b/src/plugins/winrt/winrtdeployconfiguration.cpp
index 2f51340d45..8a76634f73 100644
--- a/src/plugins/winrt/winrtdeployconfiguration.cpp
+++ b/src/plugins/winrt/winrtdeployconfiguration.cpp
@@ -52,7 +52,7 @@ static QString msgDeployConfigurationDisplayName(const Core::Id &id)
{
if (id == appxDeployConfigurationC) {
return QCoreApplication::translate("WinRt::Internal::WinRtDeployConfiguration",
- "Deploy locally");
+ "Run windeployqt");
}
if (id == phoneDeployConfigurationC) {
return QCoreApplication::translate("WinRt::Internal::WinRtDeployConfiguration",
@@ -159,7 +159,7 @@ QString WinRtDeployStepFactory::displayNameForId(const Core::Id id) const
{
if (id == Constants::WINRT_BUILD_STEP_DEPLOY) {
return QCoreApplication::translate("WinRt::Internal::WinRtDeployStepFactory",
- "Deploy Qt binaries and application files");
+ "Run windeployqt");
}
return QString();
}
diff --git a/src/plugins/winrt/winrtpackagedeploymentstep.cpp b/src/plugins/winrt/winrtpackagedeploymentstep.cpp
index 393903e83a..ff746e2c3d 100644
--- a/src/plugins/winrt/winrtpackagedeploymentstep.cpp
+++ b/src/plugins/winrt/winrtpackagedeploymentstep.cpp
@@ -28,29 +28,17 @@
****************************************************************************/
#include "winrtpackagedeploymentstep.h"
-#include "winrtdevice.h"
+#include "winrtpackagedeploymentstepwidget.h"
#include "winrtconstants.h"
#include <projectexplorer/project.h>
#include <projectexplorer/target.h>
-#include <projectexplorer/deploymentdata.h>
#include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/buildtargetinfo.h>
-#include <projectexplorer/ioutputparser.h>
-#include <projectexplorer/kitinformation.h>
-#include <coreplugin/idocument.h>
-#include <utils/fileutils.h>
-#include <qtsupport/profilereader.h>
-#include <proparser/qmakevfs.h>
-#include <utils/hostosinfo.h>
-
-#include <QJsonDocument>
-#include <QJsonObject>
-#include <QJsonArray>
-#include <QRegularExpression>
-#include <QRegularExpressionMatchIterator>
+#include <utils/qtcprocess.h>
using namespace ProjectExplorer;
+using Utils::QtcProcess;
namespace WinRt {
namespace Internal {
@@ -58,21 +46,25 @@ namespace Internal {
WinRtPackageDeploymentStep::WinRtPackageDeploymentStep(BuildStepList *bsl)
: AbstractProcessStep(bsl, Constants::WINRT_BUILD_STEP_DEPLOY)
{
- setDisplayName(tr("Deploy Qt binaries and application files to output directory"));
+ setDisplayName(tr("Run windeployqt"));
+ m_args = defaultWinDeployQtArguments();
}
bool WinRtPackageDeploymentStep::init()
{
- Utils::FileName proFile = Utils::FileName::fromString(project()->document()->filePath());
+ Utils::FileName proFile = Utils::FileName::fromString(project()->projectFilePath());
const QString targetPath
= target()->applicationTargets().targetForProject(proFile).toString()
+ QLatin1String(".exe");
// ### Actually, targetForProject is supposed to return the file path including the file
// extension. Whenever this will eventually work, we have to remove the .exe suffix here.
+ QString args = QtcProcess::quoteArg(QDir::toNativeSeparators(targetPath));
+ args += QLatin1Char(' ') + m_args;
+
ProcessParameters *params = processParameters();
params->setCommand(QLatin1String("windeployqt.exe"));
- params->setArguments(QDir::toNativeSeparators(targetPath));
+ params->setArguments(args);
params->setEnvironment(target()->activeBuildConfiguration()->environment());
return AbstractProcessStep::init();
@@ -80,7 +72,42 @@ bool WinRtPackageDeploymentStep::init()
BuildStepConfigWidget *WinRtPackageDeploymentStep::createConfigWidget()
{
- return new SimpleBuildStepConfigWidget(this);
+ return new WinRtPackageDeploymentStepWidget(this);
+}
+
+void WinRtPackageDeploymentStep::setWinDeployQtArguments(const QString &args)
+{
+ m_args = args;
+}
+
+QString WinRtPackageDeploymentStep::winDeployQtArguments() const
+{
+ return m_args;
+}
+
+QString WinRtPackageDeploymentStep::defaultWinDeployQtArguments() const
+{
+ QString args;
+ QtcProcess::addArg(&args, QStringLiteral("--qmldir"));
+ QtcProcess::addArg(&args, QDir::toNativeSeparators(project()->projectDirectory()));
+ return args;
+}
+
+bool WinRtPackageDeploymentStep::fromMap(const QVariantMap &map)
+{
+ if (!AbstractProcessStep::fromMap(map))
+ return false;
+ QVariant v = map.value(QLatin1String(Constants::WINRT_BUILD_STEP_DEPLOY_ARGUMENTS));
+ if (v.isValid())
+ m_args = v.toString();
+ return true;
+}
+
+QVariantMap WinRtPackageDeploymentStep::toMap() const
+{
+ QVariantMap map = AbstractProcessStep::toMap();
+ map.insert(QLatin1String(Constants::WINRT_BUILD_STEP_DEPLOY_ARGUMENTS), m_args);
+ return map;
}
} // namespace Internal
diff --git a/src/plugins/winrt/winrtpackagedeploymentstep.h b/src/plugins/winrt/winrtpackagedeploymentstep.h
index 8d51f741fa..592395827b 100644
--- a/src/plugins/winrt/winrtpackagedeploymentstep.h
+++ b/src/plugins/winrt/winrtpackagedeploymentstep.h
@@ -42,6 +42,16 @@ public:
explicit WinRtPackageDeploymentStep(ProjectExplorer::BuildStepList *bsl);
bool init();
ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
+
+ void setWinDeployQtArguments(const QString &args);
+ QString winDeployQtArguments() const;
+ QString defaultWinDeployQtArguments() const;
+
+ bool fromMap(const QVariantMap &map);
+ QVariantMap toMap() const;
+
+private:
+ QString m_args;
};
} // namespace Internal
diff --git a/src/plugins/winrt/winrtpackagedeploymentstepwidget.cpp b/src/plugins/winrt/winrtpackagedeploymentstepwidget.cpp
new file mode 100644
index 0000000000..f2f6b3b4c5
--- /dev/null
+++ b/src/plugins/winrt/winrtpackagedeploymentstepwidget.cpp
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** 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 "winrtpackagedeploymentstepwidget.h"
+#include <ui_winrtpackagedeploymentstepwidget.h>
+#include <coreplugin/coreconstants.h>
+#include <QIcon>
+
+namespace WinRt {
+namespace Internal {
+
+WinRtPackageDeploymentStepWidget::WinRtPackageDeploymentStepWidget(WinRtPackageDeploymentStep *step)
+ : m_ui(new Ui::WinRtPackageDeploymentStepWidget)
+ , m_step(step)
+{
+ m_ui->setupUi(this);
+ m_ui->leArguments->setText(m_step->winDeployQtArguments());
+ m_ui->btnRestoreDefaultArgs->setIcon(QIcon(QLatin1String(Core::Constants::ICON_RESET)));
+}
+
+WinRtPackageDeploymentStepWidget::~WinRtPackageDeploymentStepWidget()
+{
+ delete m_ui;
+}
+
+QString WinRtPackageDeploymentStepWidget::summaryText() const
+{
+ return displayName();
+}
+
+QString WinRtPackageDeploymentStepWidget::displayName() const
+{
+ return m_step->displayName();
+}
+
+void WinRtPackageDeploymentStepWidget::on_btnRestoreDefaultArgs_clicked()
+{
+ m_ui->leArguments->setText(m_step->defaultWinDeployQtArguments());
+}
+
+void WinRtPackageDeploymentStepWidget::on_leArguments_textChanged(QString str)
+{
+ m_step->setWinDeployQtArguments(str);
+}
+
+} // namespace Internal
+} // namespace WinRt
diff --git a/src/plugins/winrt/winrtpackagedeploymentstepwidget.h b/src/plugins/winrt/winrtpackagedeploymentstepwidget.h
new file mode 100644
index 0000000000..beb136fc10
--- /dev/null
+++ b/src/plugins/winrt/winrtpackagedeploymentstepwidget.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** 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 WINRTPACKAGEDEPLOYMENTSTEPWIDGET_H
+#define WINRTPACKAGEDEPLOYMENTSTEPWIDGET_H
+
+#include "winrtpackagedeploymentstep.h"
+
+#include <projectexplorer/buildstep.h>
+
+namespace WinRt {
+namespace Internal {
+
+namespace Ui { class WinRtPackageDeploymentStepWidget; }
+
+class WinRtPackageDeploymentStepWidget : public ProjectExplorer::BuildStepConfigWidget
+{
+ Q_OBJECT
+public:
+ WinRtPackageDeploymentStepWidget(WinRtPackageDeploymentStep *step);
+ ~WinRtPackageDeploymentStepWidget();
+
+ virtual QString summaryText() const;
+ virtual QString displayName() const;
+
+private slots:
+ void on_btnRestoreDefaultArgs_clicked();
+ void on_leArguments_textChanged(QString str);
+
+private:
+ Ui::WinRtPackageDeploymentStepWidget *m_ui;
+ WinRtPackageDeploymentStep *m_step;
+};
+
+} // namespace Internal
+} // namespace WinRt
+
+#endif // WINRTPACKAGEDEPLOYMENTSTEPWIDGET_H
diff --git a/src/plugins/winrt/winrtpackagedeploymentstepwidget.ui b/src/plugins/winrt/winrtpackagedeploymentstepwidget.ui
new file mode 100644
index 0000000000..e3ce32adfc
--- /dev/null
+++ b/src/plugins/winrt/winrtpackagedeploymentstepwidget.ui
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>WinRt::Internal::WinRtPackageDeploymentStepWidget</class>
+ <widget class="QWidget" name="WinRt::Internal::WinRtPackageDeploymentStepWidget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>59</height>
+ </rect>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Arguments:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="leArguments"/>
+ </item>
+ <item>
+ <widget class="QToolButton" name="btnRestoreDefaultArgs">
+ <property name="text">
+ <string>Restore Default Arguments</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/src/plugins/winrt/winrtqtversionfactory.cpp b/src/plugins/winrt/winrtqtversionfactory.cpp
index b7ce077a9a..9955aa75ab 100644
--- a/src/plugins/winrt/winrtqtversionfactory.cpp
+++ b/src/plugins/winrt/winrtqtversionfactory.cpp
@@ -80,14 +80,21 @@ QtSupport::BaseQtVersion *WinRtQtVersionFactory::create(const Utils::FileName &q
if (!fi.exists() || !fi.isExecutable() || !fi.isFile())
return 0;
+ bool isWinRt = false;
bool isPhone = false;
foreach (const QString &value, evaluator->values(QLatin1String("QMAKE_PLATFORM"))) {
- if (value == QStringLiteral("winphone")) {
+ if (value == QStringLiteral("winrt")) {
+ isWinRt = true;
+ } else if (value == QStringLiteral("winphone")) {
+ isWinRt = true;
isPhone = true;
break;
}
}
+ if (!isWinRt)
+ return 0;
+
return isPhone ? new WinRtPhoneQtVersion(qmakePath, isAutoDetected, autoDetectionSource)
: new WinRtQtVersion(qmakePath, isAutoDetected, autoDetectionSource);
}
diff --git a/src/shared/qbs b/src/shared/qbs
-Subproject 4986148d23758cb358ae3e2c369db7644e3a2ed
+Subproject 91d4e47fc8eb506b3a906d75a838a28b2c3a38e
diff --git a/src/tools/3rdparty/3rdparty.pro b/src/tools/3rdparty/3rdparty.pro
index 9b9062f2d9..c0c053bf4c 100644
--- a/src/tools/3rdparty/3rdparty.pro
+++ b/src/tools/3rdparty/3rdparty.pro
@@ -1,5 +1,7 @@
TEMPLATE = subdirs
mac {
- SUBDIRS += iossim
+ SUBDIRS += \
+ iossim \
+ iossim_1_8_2
}
diff --git a/src/tools/3rdparty/iossim/dvtiphonesimulatorremoteclient/dvtiphonesimulatorremoteclient.h b/src/tools/3rdparty/iossim/dvtiphonesimulatorremoteclient/dvtiphonesimulatorremoteclient.h
new file mode 100644
index 0000000000..70cc4ac436
--- /dev/null
+++ b/src/tools/3rdparty/iossim/dvtiphonesimulatorremoteclient/dvtiphonesimulatorremoteclient.h
@@ -0,0 +1,290 @@
+//
+// Generated by class-dump 3.5 (64 bit).
+//
+// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
+//
+
+#pragma mark Blocks
+
+typedef void (^CDUnknownBlockType)(void); // return type and parameters are unknown
+
+#pragma mark -
+
+//
+// File: $(DEVELOPER_DIR)/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/DVTiPhoneSimulatorRemoteClient.framework/Versions/A/DVTiPhoneSimulatorRemoteClient
+//
+// Arch: x86_64
+// Current version: 12.0.0
+// Compatibility version: 1.0.0
+// Source version: 5037.3.0.0.0
+// Minimum Mac OS X version: 10.8.0
+// SDK version: 10.9.0
+//
+// Objective-C Garbage Collection: Unsupported
+//
+// Run path: @loader_path/../../../../PrivateFrameworks/
+// = $(DEVELOPER_DIR)/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks
+//
+
+
+@class DTiPhoneSimulatorApplicationSpecifier;
+@class DTiPhoneSimulatorSession;
+@class DTiPhoneSimulatorSessionConfig;
+@class DTiPhoneSimulatorSystemRoot;
+@class DVTiPhoneSimulatorMessenger;
+
+@protocol DTiPhoneSimulatorSessionDelegate
+
+- (void) session: (DTiPhoneSimulatorSession *) session didEndWithError: (NSError *) error;
+- (void) session: (DTiPhoneSimulatorSession *) session didStart: (BOOL) started withError: (NSError *) error;
+
+@end
+
+@protocol OS_dispatch_source
+@end
+@protocol OS_dispatch_queue
+@end
+@class DVTDispatchLock;
+@class DVTConfinementServiceConnection;
+@class DVTTask;
+
+
+@interface DVTiPhoneSimulatorMessenger : NSObject
+{
+ DTiPhoneSimulatorSession *_session;
+ CDUnknownBlockType _readyMessageHandler;
+ CDUnknownBlockType _runningMessageHandler;
+ CDUnknownBlockType _appDidLaunchMessageHandler;
+ CDUnknownBlockType _appDidQuitMessageHandler;
+ CDUnknownBlockType _appPIDExitedMessageHandler;
+ CDUnknownBlockType _toolDidLaunchMessageHandler;
+}
+
++ (id)messengerForSession:(id)arg1 withConnection:(id)arg2;
++ (id)messengerForSession:(id)arg1;
+@property(copy, nonatomic) CDUnknownBlockType toolDidLaunchMessageHandler; // @synthesize toolDidLaunchMessageHandler=_toolDidLaunchMessageHandler;
+@property(copy, nonatomic) CDUnknownBlockType appPIDExitedMessageHandler; // @synthesize appPIDExitedMessageHandler=_appPIDExitedMessageHandler;
+@property(copy, nonatomic) CDUnknownBlockType appDidQuitMessageHandler; // @synthesize appDidQuitMessageHandler=_appDidQuitMessageHandler;
+@property(copy, nonatomic) CDUnknownBlockType appDidLaunchMessageHandler; // @synthesize appDidLaunchMessageHandler=_appDidLaunchMessageHandler;
+@property(copy, nonatomic) CDUnknownBlockType runningMessageHandler; // @synthesize runningMessageHandler=_runningMessageHandler;
+@property(copy, nonatomic) CDUnknownBlockType readyMessageHandler; // @synthesize readyMessageHandler=_readyMessageHandler;
+@property(readonly) DTiPhoneSimulatorSession *session; // @synthesize session=_session;
+- (void)doUbiquityFetchEvent;
+- (void)doFetchEventForPID:(int)arg1;
+- (void)backgroundAllApps:(int)arg1;
+- (void)startSimulatorToolSessionWithParameters:(id)arg1;
+- (void)stopSimulatingLocation;
+- (void)startSimulatingLocationWithLatitude:(id)arg1 longitute:(id)arg2;
+- (void)endSimulatorSessionWithPID:(int)arg1;
+- (void)startSimulatorSessionWithRequestInfo:(id)arg1;
+- (void)clearAllMessageHandlers;
+- (void)waitPID:(int)arg1 withAppPIDExitedMessagedHandler:(CDUnknownBlockType)arg2;
+- (void)disconnectFromService;
+- (BOOL)connectToServiceWithSessionOnLaunch:(BOOL)arg1 simulatorPID:(int *)arg2 error:(id *)arg3;
+- (id)initWithSession:(id)arg1;
+
+@end
+
+@interface DVTiPhoneSimulatorLocalMessenger : DVTiPhoneSimulatorMessenger
+{
+ BOOL _appTerminationMessageSent;
+ NSObject<OS_dispatch_source> *_pidDispatchSource;
+ DVTTask *_simTask;
+}
+
+- (void)doUbiquityFetchEvent;
+- (void)doFetchEventForPID:(int)arg1;
+- (void)backgroundAllApps:(int)arg1;
+- (void)_handleSimulatorToolDidLaunchMessage:(id)arg1;
+- (void)setToolDidLaunchMessageHandler:(CDUnknownBlockType)arg1;
+- (void)waitPID:(int)arg1 withAppPIDExitedMessagedHandler:(CDUnknownBlockType)arg2;
+- (void)_handleSimulatorAppDidQuitMessage:(id)arg1;
+- (void)setAppDidQuitMessageHandler:(CDUnknownBlockType)arg1;
+- (void)_handleSimulatorAppDidLaunchMessage:(id)arg1;
+- (void)setAppDidLaunchMessageHandler:(CDUnknownBlockType)arg1;
+- (void)_handleSimulatorRunningMessage:(id)arg1;
+- (void)setRunningMessageHandler:(CDUnknownBlockType)arg1;
+- (void)_handleSimulatorReadyMessage:(id)arg1;
+- (void)setReadyMessageHandler:(CDUnknownBlockType)arg1;
+- (void)startSimulatorToolSessionWithParameters:(id)arg1;
+- (void)stopSimulatingLocation;
+- (void)startSimulatingLocationWithLatitude:(id)arg1 longitute:(id)arg2;
+- (void)endSimulatorSessionWithPID:(int)arg1;
+- (void)startSimulatorSessionWithRequestInfo:(id)arg1;
+- (void)clearAllMessageHandlers;
+- (void)disconnectFromService;
+- (BOOL)connectToServiceWithSessionOnLaunch:(BOOL)arg1 simulatorPID:(int *)arg2 error:(id *)arg3;
+- (void)_enableObserver:(BOOL)arg1 forName:(id)arg2 selector:(SEL)arg3;
+
+@end
+
+@interface DVTiPhoneSimulatorRemoteMessenger : DVTiPhoneSimulatorMessenger
+{
+ unsigned long long _commandTag;
+ NSObject<OS_dispatch_queue> *_responseQueue;
+ DVTDispatchLock *_awaitingLock;
+ NSMutableDictionary *_awaitingSemaphores;
+ NSMutableDictionary *_awaitingResponses;
+ NSMutableSet *_waitingAppPIDs;
+ DVTConfinementServiceConnection *_connection;
+}
+
+@property(readonly) DVTConfinementServiceConnection *connection; // @synthesize connection=_connection;
+- (void)handleNotificationResponse:(id)arg1;
+- (void)waitPID:(int)arg1 withAppPIDExitedMessagedHandler:(CDUnknownBlockType)arg2;
+- (void)startSimulatorToolSessionWithParameters:(id)arg1;
+- (void)stopSimulatingLocation;
+- (void)startSimulatingLocationWithLatitude:(id)arg1 longitute:(id)arg2;
+- (void)endSimulatorSessionWithPID:(int)arg1;
+- (void)startSimulatorSessionWithRequestInfo:(id)arg1;
+- (void)disconnectFromService;
+- (BOOL)connectToServiceWithSessionOnLaunch:(BOOL)arg1 simulatorPID:(int *)arg2 error:(id *)arg3;
+- (BOOL)sendTaggedRequest:(id)arg1 awaitingResponse:(id *)arg2 error:(id *)arg3;
+- (id)nextCommandTag;
+- (id)awaitResponseWithTag:(id)arg1 error:(id *)arg2;
+- (void)enqueueResponse:(id)arg1 withTag:(id)arg2 error:(id)arg3;
+- (BOOL)sendRequest:(id)arg1 withTag:(id)arg2 error:(id *)arg3;
+- (id)initWithSession:(id)arg1 connection:(id)arg2;
+
+@end
+
+@interface DTiPhoneSimulatorSession : NSObject
+{
+ int _simulatedApplicationPID;
+ int _simulatorPID;
+ NSString *_uuid;
+ id <DTiPhoneSimulatorSessionDelegate> _delegate;
+ NSString *_simulatedAppPath;
+ long long _sessionLifecycleProgress;
+ NSTimer *_timeoutTimer;
+ DTiPhoneSimulatorSessionConfig *_sessionConfig;
+ DVTiPhoneSimulatorMessenger *_messenger;
+}
+
+@property(retain) DVTiPhoneSimulatorMessenger *messenger; // @synthesize messenger=_messenger;
+@property(copy, nonatomic) DTiPhoneSimulatorSessionConfig *sessionConfig; // @synthesize sessionConfig=_sessionConfig;
+@property(retain, nonatomic) NSTimer *timeoutTimer; // @synthesize timeoutTimer=_timeoutTimer;
+@property(nonatomic) long long sessionLifecycleProgress; // @synthesize sessionLifecycleProgress=_sessionLifecycleProgress;
+@property int simulatorPID; // @synthesize simulatorPID=_simulatorPID;
+@property(copy) NSString *simulatedAppPath; // @synthesize simulatedAppPath=_simulatedAppPath;
+@property int simulatedApplicationPID; // @synthesize simulatedApplicationPID=_simulatedApplicationPID;
+@property(retain, nonatomic) id <DTiPhoneSimulatorSessionDelegate> delegate; // @synthesize delegate=_delegate;
+@property(copy, nonatomic) NSString *uuid; // @synthesize uuid=_uuid;
+- (void)doUbiquityFetchEvent;
+- (void)doFetchEventForPID:(int)arg1;
+- (void)backgroundAllApps:(int)arg1;
+- (id)_invalidConfigError;
+- (void)_endSimulatorSession;
+- (void)_callDelegateResponseFromSessionEndedInfo:(id)arg1;
+- (void)_callDelegateResponseFromSessionStartedInfo:(id)arg1;
+- (id)_sessionStartRequestInfoFromConfig:(id)arg1 withError:(id *)arg2;
+- (BOOL)_startToolSessionInSimulatorWithError:(id *)arg1;
+- (BOOL)_startApplicationSessionInSimulatorWithError:(id *)arg1;
+- (BOOL)_startBasicSessionInSimulatorWithError:(id *)arg1;
+- (BOOL)_startSessionInSimulatorWithError:(id *)arg1;
+- (BOOL)_handleSessionEndedInSimulator:(id)arg1 notification:(id)arg2;
+- (void)_handleSessionStartedWithSim:(id)arg1;
+- (void)_handleSessionStartedInSimulator:(id)arg1;
+- (void)_handleSimulatorReadyMessage:(id)arg1;
+- (void)_timeoutElapsed:(id)arg1;
+- (BOOL)attachedToTargetWithConfig:(id)arg1 error:(id *)arg2;
+- (void)stopLocationSimulation;
+- (void)simulateLocationWithLatitude:(id)arg1 longitude:(id)arg2;
+- (void)requestEndWithTimeout:(double)arg1;
+- (BOOL)requestStartWithConfig:(id)arg1 timeout:(double)arg2 error:(id *)arg3;
+- (BOOL)_setUpSimulatorMessengerWithConfig:(id)arg1 error:(id *)arg2;
+- (id)description;
+- (void)dealloc;
+- (id)init;
+
+@end
+
+@interface DTiPhoneSimulatorSessionConfig : NSObject <NSCopying>
+{
+ BOOL _launchForBackgroundFetch;
+ BOOL _simulatedApplicationShouldWaitForDebugger;
+ NSString *_localizedClientName;
+ DTiPhoneSimulatorSystemRoot *_simulatedSystemRoot;
+ NSString *_simulatedDeviceInfoName;
+ NSNumber *_simulatedDeviceFamily;
+ NSString *_simulatedArchitecture;
+ NSNumber *_simulatedDisplayHeight;
+ NSNumber *_simulatedDisplayScale;
+ DTiPhoneSimulatorApplicationSpecifier *_applicationToSimulateOnStart;
+ NSNumber *_pid;
+ NSArray *_simulatedApplicationLaunchArgs;
+ NSDictionary *_simulatedApplicationLaunchEnvironment;
+ NSString *_simulatedApplicationStdOutPath;
+ NSString *_simulatedApplicationStdErrPath;
+ NSFileHandle *_stdinFileHandle;
+ NSFileHandle *_stdoutFileHandle;
+ NSFileHandle *_stderrFileHandle;
+ id _confinementService;
+}
+
++ (id)displayNameForDeviceFamily:(id)arg1;
+@property(retain) id confinementService; // @synthesize confinementService=_confinementService;
+@property(retain) NSFileHandle *stderrFileHandle; // @synthesize stderrFileHandle=_stderrFileHandle;
+@property(retain) NSFileHandle *stdoutFileHandle; // @synthesize stdoutFileHandle=_stdoutFileHandle;
+@property(retain) NSFileHandle *stdinFileHandle; // @synthesize stdinFileHandle=_stdinFileHandle;
+@property(copy) NSString *simulatedApplicationStdErrPath; // @synthesize simulatedApplicationStdErrPath=_simulatedApplicationStdErrPath;
+@property(copy) NSString *simulatedApplicationStdOutPath; // @synthesize simulatedApplicationStdOutPath=_simulatedApplicationStdOutPath;
+@property BOOL simulatedApplicationShouldWaitForDebugger; // @synthesize simulatedApplicationShouldWaitForDebugger=_simulatedApplicationShouldWaitForDebugger;
+@property(copy) NSDictionary *simulatedApplicationLaunchEnvironment; // @synthesize simulatedApplicationLaunchEnvironment=_simulatedApplicationLaunchEnvironment;
+@property(copy) NSArray *simulatedApplicationLaunchArgs; // @synthesize simulatedApplicationLaunchArgs=_simulatedApplicationLaunchArgs;
+@property(copy) NSNumber *pid; // @synthesize pid=_pid;
+@property(copy) DTiPhoneSimulatorApplicationSpecifier *applicationToSimulateOnStart; // @synthesize applicationToSimulateOnStart=_applicationToSimulateOnStart;
+@property(copy) NSNumber *simulatedDisplayScale; // @synthesize simulatedDisplayScale=_simulatedDisplayScale;
+@property(copy) NSNumber *simulatedDisplayHeight; // @synthesize simulatedDisplayHeight=_simulatedDisplayHeight;
+@property(copy) NSString *simulatedArchitecture; // @synthesize simulatedArchitecture=_simulatedArchitecture;
+@property(copy) NSNumber *simulatedDeviceFamily; // @synthesize simulatedDeviceFamily=_simulatedDeviceFamily;
+@property(retain) NSString *simulatedDeviceInfoName; // @synthesize simulatedDeviceInfoName=_simulatedDeviceInfoName;
+@property(copy) DTiPhoneSimulatorSystemRoot *simulatedSystemRoot; // @synthesize simulatedSystemRoot=_simulatedSystemRoot;
+@property(copy) NSString *localizedClientName; // @synthesize localizedClientName=_localizedClientName;
+@property BOOL launchForBackgroundFetch; // @synthesize launchForBackgroundFetch=_launchForBackgroundFetch;
+- (id)description;
+- (id)copyWithZone:(struct _NSZone *)arg1;
+- (id)init;
+
+@end
+
+@interface DTiPhoneSimulatorSystemRoot : NSObject <NSCopying>
+{
+ NSString *sdkRootPath;
+ NSString *sdkVersion;
+ NSString *sdkDisplayName;
+}
+
++ (id)rootWithSDKVersion:(id)arg1;
++ (id)rootWithSDKPath:(id)arg1;
++ (id)defaultRoot;
++ (id)knownRoots;
++ (void)initialize;
+@property(copy) NSString *sdkDisplayName; // @synthesize sdkDisplayName;
+@property(copy) NSString *sdkVersion; // @synthesize sdkVersion;
+@property(copy) NSString *sdkRootPath; // @synthesize sdkRootPath;
+- (id)description;
+- (long long)compare:(id)arg1;
+- (id)copyWithZone:(struct _NSZone *)arg1;
+- (BOOL)isEqual:(id)arg1;
+- (id)initWithSDKPath:(id)arg1;
+
+@end
+
+@interface DTiPhoneSimulatorApplicationSpecifier : NSObject <NSCopying>
+{
+ NSString *appPath;
+ NSString *bundleID;
+ NSString *toolPath;
+}
+
++ (id)specifierWithToolPath:(id)arg1;
++ (id)specifierWithApplicationBundleIdentifier:(id)arg1;
++ (id)specifierWithApplicationPath:(id)arg1;
+@property(copy, nonatomic) NSString *toolPath; // @synthesize toolPath;
+@property(copy, nonatomic) NSString *bundleID; // @synthesize bundleID;
+@property(copy, nonatomic) NSString *appPath; // @synthesize appPath;
+- (id)description;
+- (id)copyWithZone:(struct _NSZone *)arg1;
+
+@end \ No newline at end of file
diff --git a/src/tools/3rdparty/iossim/iossim.pro b/src/tools/3rdparty/iossim/iossim.pro
index 9e30307406..557362e4c3 100644
--- a/src/tools/3rdparty/iossim/iossim.pro
+++ b/src/tools/3rdparty/iossim/iossim.pro
@@ -26,10 +26,10 @@ iPhoneSimulatorRemoteClientDirectLinking {
-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks \
-F/Applications/Xcode.app/Contents/OtherFrameworks
LIBS += \
- -framework iPhoneSimulatorRemoteClient
+ -framework DTViPhoneSimulatorRemoteClient
QMAKE_RPATHDIR += /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks \
- /Applications/Xcode.app/Contents/OtherFrameworks
- /System/Library/PrivateFrameworks \
+ /Applications/Xcode.app/Contents/OtherFrameworks \
+ /System/Library/PrivateFrameworks
}
TEMPLATE = app
@@ -49,7 +49,7 @@ HEADERS += \
nsprintf.h \
nsstringexpandpath.h \
version.h \
- iphonesimulatorremoteclient/iphonesimulatorremoteclient.h
+ dvtiphonesimulatorremoteclient/dvtiphonesimulatorremoteclient.h
OTHER_FILES = IOSSIM_LICENSE \
Info.plist
diff --git a/src/tools/3rdparty/iossim/iossim.qbs b/src/tools/3rdparty/iossim/iossim.qbs
index ba3133b493..1300b107d5 100644
--- a/src/tools/3rdparty/iossim/iossim.qbs
+++ b/src/tools/3rdparty/iossim/iossim.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcTool
@@ -18,7 +18,7 @@ QtcTool {
"nsprintf.h",
"nsstringexpandpath.h",
"version.h",
- "iphonesimulatorremoteclient/iphonesimulatorremoteclient.h"
+ "dvtiphonesimulatorremoteclient/dvtiphonesimulatorremoteclient.h"
]
cpp.linkerFlags: base.concat(["-sectcreate", "__TEXT", "__info_plist", path + "/Info.plist",
"-fobjc-link-runtime"])
diff --git a/src/tools/3rdparty/iossim/iphonesimulator.h b/src/tools/3rdparty/iossim/iphonesimulator.h
index 0770c50ee3..3049f318d2 100644
--- a/src/tools/3rdparty/iossim/iphonesimulator.h
+++ b/src/tools/3rdparty/iossim/iphonesimulator.h
@@ -6,7 +6,7 @@
*/
#import <Foundation/Foundation.h>
-#import "iphonesimulatorremoteclient/iphonesimulatorremoteclient.h"
+#import <dvtiphonesimulatorremoteclient/dvtiphonesimulatorremoteclient.h>
#import "version.h"
@interface iPhoneSimulator : NSObject <DTiPhoneSimulatorSessionDelegate> {
@@ -14,8 +14,7 @@
DTiPhoneSimulatorSystemRoot *sdkRoot;
NSFileHandle *stdoutFileHandle;
NSFileHandle *stderrFileHandle;
- DTiPhoneSimulatorSession *session;
- NSTimer *pidCheckingTimer;
+ DTiPhoneSimulatorSession *mySession;
BOOL startOnly;
BOOL exitOnStartup;
BOOL shouldWaitDebugger;
@@ -34,8 +33,7 @@
- (void)createStdioFIFO:(NSFileHandle **)fileHandle ofType:(NSString *)type atPath:(NSString **)path;
- (void)removeStdioFIFO:(NSFileHandle *)fileHandle atPath:(NSString *)path;
- (void)stop;
-- (void)checkPid:(NSTimer *)timer;
- (void)doExit:(int)errorCode;
-- (void)changeDeviceType:(NSString *)family retina:(BOOL)retina isTallDevice:(BOOL)isTallDevice;
+- (NSString*)changeDeviceType:(NSString *)family retina:(BOOL)retina isTallDevice:(BOOL)isTallDevice;
@end
diff --git a/src/tools/3rdparty/iossim/iphonesimulator.mm b/src/tools/3rdparty/iossim/iphonesimulator.mm
index b06b54276d..e8ca358454 100644
--- a/src/tools/3rdparty/iossim/iphonesimulator.mm
+++ b/src/tools/3rdparty/iossim/iphonesimulator.mm
@@ -10,8 +10,8 @@
#import "nsprintf.h"
#import <sys/types.h>
#import <sys/stat.h>
-#import <objc/runtime.h>
-#import <AppKit/NSRunningApplication.h>
+#import <Foundation/NSTask.h>
+@class DTiPhoneSimulatorSystemRoot;
NSString *simulatorPrefrencesName = @"com.apple.iphonesimulator";
NSString *deviceProperty = @"SimulateDevice";
@@ -21,6 +21,18 @@ NSString *deviceIphone = @"iPhone";
NSString *deviceIpad = @"iPad";
NSString *deviceIpadRetina = @"iPad (Retina)";
+// The path within the developer dir of the private Simulator frameworks.
+NSString* const kSimulatorFrameworkRelativePath = @"Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/DVTiPhoneSimulatorRemoteClient.framework";
+NSString* const kDVTFoundationRelativePath = @"../SharedFrameworks/DVTFoundation.framework";
+NSString* const kDevToolsFoundationRelativePath = @"../OtherFrameworks/DevToolsFoundation.framework";
+//NSString* const kSimulatorRelativePath = @"Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app";
+
+static const char *gDevDir = 0;
+
+@interface DVTPlatform : NSObject
++ (BOOL)loadAllPlatformsReturningError:(id*)arg1;
+@end
+
/**
* A simple iPhoneSimulatorRemoteClient framework.
*/
@@ -28,14 +40,12 @@ NSString *deviceIpadRetina = @"iPad (Retina)";
- (id)init {
self = [super init];
- session = nil;
- pidCheckingTimer = nil;
+ mySession = nil;
return self;
}
- (void)dealloc {
- [session release];
- [pidCheckingTimer release];
+ [mySession release];
[super dealloc];
}
@@ -47,8 +57,88 @@ NSString *deviceIpadRetina = @"iPad (Retina)";
exit(errorCode);
}
+// Helper to find a class by name and die if it isn't found.
+-(Class) FindClassByName:(NSString*) nameOfClass {
+ Class theClass = NSClassFromString(nameOfClass);
+ if (!theClass) {
+ nsfprintf(stderr,@"Failed to find class %@ at runtime.", nameOfClass);
+ [self doExit:EXIT_FAILURE];
+ }
+ return theClass;
+}
+
+// Loads the Simulator framework from the given developer dir.
+-(void) LoadSimulatorFramework:(NSString*) developerDir {
+ // The Simulator framework depends on some of the other Xcode private
+ // frameworks; manually load them first so everything can be linked up.
+ NSString* dvtFoundationPath = [developerDir stringByAppendingPathComponent:kDVTFoundationRelativePath];
+
+ NSBundle* dvtFoundationBundle =
+ [NSBundle bundleWithPath:dvtFoundationPath];
+ if (![dvtFoundationBundle load]){
+ nsprintf(@"Unable to dvtFoundationBundle. Error: ");
+ [self doExit:EXIT_FAILURE];
+ return ;
+ }
+ NSString* devToolsFoundationPath = [developerDir stringByAppendingPathComponent:kDevToolsFoundationRelativePath];
+ NSBundle* devToolsFoundationBundle =
+ [NSBundle bundleWithPath:devToolsFoundationPath];
+ if (![devToolsFoundationBundle load]){
+ nsprintf(@"Unable to devToolsFoundationPath. Error: ");
+ return ;
+ }
+ // Prime DVTPlatform.
+ NSError* error;
+ Class DVTPlatformClass = [self FindClassByName:@"DVTPlatform"];
+ if (![DVTPlatformClass loadAllPlatformsReturningError:&error]) {
+ nsprintf(@"Unable to loadAllPlatformsReturningError. Error: %@",[error localizedDescription]);
+ return ;
+ }
+ NSString* simBundlePath = [developerDir stringByAppendingPathComponent:kSimulatorFrameworkRelativePath];
+ NSBundle* simBundle = [NSBundle bundleWithPath:simBundlePath];
+ if (![simBundle load]){
+ nsprintf(@"Unable to load simulator framework. Error: %@",[error localizedDescription]);
+ return ;
+ }
+ return ;
+}
+
+
+// Finds the developer dir via xcode-select or the DEVELOPER_DIR environment
+// variable.
+NSString* FindDeveloperDir() {
+ if (gDevDir)
+ return [NSString stringWithCString:gDevDir encoding:NSUTF8StringEncoding];
+ // Check the env first.
+ NSDictionary* env = [[NSProcessInfo processInfo] environment];
+ NSString* developerDir = [env objectForKey:@"DEVELOPER_DIR"];
+ if ([developerDir length] > 0)
+ return developerDir;
+
+ // Go look for it via xcode-select.
+ NSTask* xcodeSelectTask = [[[NSTask alloc] init] autorelease];
+ [xcodeSelectTask setLaunchPath:@"/usr/bin/xcode-select"];
+ [xcodeSelectTask setArguments:[NSArray arrayWithObject:@"-print-path"]];
+
+ NSPipe* outputPipe = [NSPipe pipe];
+ [xcodeSelectTask setStandardOutput:outputPipe];
+ NSFileHandle* outputFile = [outputPipe fileHandleForReading];
+
+ [xcodeSelectTask launch];
+ NSData* outputData = [outputFile readDataToEndOfFile];
+ [xcodeSelectTask terminate];
+
+ NSString* output =
+ [[[NSString alloc] initWithData:outputData
+ encoding:NSUTF8StringEncoding] autorelease];
+ output = [output stringByTrimmingCharactersInSet:
+ [NSCharacterSet whitespaceAndNewlineCharacterSet]];
+ if ([output length] == 0)
+ output = nil;
+ return output;
+}
- (void) printUsage {
- fprintf(stdout, "<msg>Usage: iossim <command> <options> [--args ...]\n");
+ fprintf(stdout, "<msg>Usage: ios-sim <command> <options> [--args ...]\n");
fprintf(stdout, "\n");
fprintf(stdout, "Commands:\n");
fprintf(stdout, " showsdks List the available iOS SDK versions\n");
@@ -80,61 +170,60 @@ NSString *deviceIpadRetina = @"iPad (Retina)";
- (int) showSDKs {
- NSUInteger i;
- id tClass = objc_getClass("DTiPhoneSimulatorSystemRoot");
- if (tClass == nil) {
- nsprintf(@"<msg>DTiPhoneSimulatorSystemRoot class is nil.</msg>");
- return EXIT_FAILURE;
- }
- NSArray *roots = [tClass knownRoots];
+ Class systemRootClass = [self FindClassByName:@"DTiPhoneSimulatorSystemRoot"];
+
+ NSArray *roots = [systemRootClass knownRoots];
nsprintf(@"<device_info>");
- for (i = 0; i < [roots count]; ++i) {
+ for (NSUInteger i = 0; i < [roots count]; ++i) {
DTiPhoneSimulatorSystemRoot *root = [roots objectAtIndex:i];
- nsprintf(@"<item><key>sdk%d_name</key><value>%@</value></item>", i, [root sdkDisplayName]);
- nsprintf(@"<item><key>sdk%d_version</key><value>%@</value></item>", i, [root sdkVersion]);
- nsprintf(@"<item><key>sdk%d_sysroot</key><value>%@</value></item>", i, [root sdkRootPath]);
+ nsprintf(@"<item><key>sdk%d_name</key><value>%@</value></item>", i, [root sdkDisplayName]);
+ nsprintf(@"<item><key>sdk%d_version</key><value>%@</value></item>", i, [root sdkVersion]);
+ nsprintf(@"<item><key>sdk%d_sysroot</key><value>%@</value></item>", i, [root sdkRootPath]);
}
nsprintf(@"</device_info>");
+
return EXIT_SUCCESS;
}
-- (void)session:(DTiPhoneSimulatorSession *)mySession didEndWithError:(NSError *)error {
+- (void)session:(DTiPhoneSimulatorSession *)session didEndWithError:(NSError *)error {
if (verbose) {
nsprintf(@"<msg>Session did end with error %@</msg>", error);
}
if (stderrFileHandle != nil) {
- NSString *stderrPath = [[mySession sessionConfig] simulatedApplicationStdErrPath];
+ NSString *stderrPath = [[session sessionConfig] simulatedApplicationStdErrPath];
[self removeStdioFIFO:stderrFileHandle atPath:stderrPath];
}
if (stdoutFileHandle != nil) {
- NSString *stdoutPath = [[mySession sessionConfig] simulatedApplicationStdOutPath];
+ NSString *stdoutPath = [[session sessionConfig] simulatedApplicationStdOutPath];
[self removeStdioFIFO:stdoutFileHandle atPath:stdoutPath];
}
- if (error != nil)
+ if (error != nil) {
[self doExit:EXIT_FAILURE];
- else
- [self doExit:EXIT_SUCCESS];
+ }
+
+ [self doExit:EXIT_SUCCESS];
}
-- (void)session:(DTiPhoneSimulatorSession *)mySession didStart:(BOOL)started withError:(NSError *)error {
- if (startOnly && mySession) {
- [NSTask launchedTaskWithLaunchPath:@"/usr/bin/osascript"
- arguments:[NSArray arrayWithObjects:@"-e", @"tell application \"iPhone Simulator\" to activate", nil]];
- nsprintf(@"<msg>Simulator started (no session)</msg>");
- [self doExit:EXIT_SUCCESS];
- return;
+- (void)session:(DTiPhoneSimulatorSession *)session didStart:(BOOL)started withError:(NSError *)error {
+ if (startOnly && session) {
+ [NSTask launchedTaskWithLaunchPath:@"/usr/bin/osascript"
+ arguments:[NSArray arrayWithObjects:@"-e", @"tell application \"iPhone Simulator\" to activate", nil]];
+ nsprintf(@"<msg>Simulator started (no session)</msg>");
+ [self doExit:EXIT_SUCCESS];
+ return;
}
if (started) {
[NSTask launchedTaskWithLaunchPath:@"/usr/bin/osascript"
arguments:[NSArray arrayWithObjects:@"-e", @"tell application \"iPhone Simulator\" to activate", nil]];
+ int pid = [session simulatedApplicationPID];
if (shouldStartDebugger) {
- char*args[4] = { NULL, NULL, (char*)[[[mySession simulatedApplicationPID] description] UTF8String], NULL };
+ char*args[4] = { NULL, NULL, (char*)[[@(pid) description] UTF8String], NULL };
if (useGDB) {
args[0] = strdup("gdb");
args[1] = strdup("program");
@@ -156,35 +245,23 @@ NSString *deviceIpadRetina = @"iPad (Retina)";
if (verbose) {
nsprintf(@"<msg>Session started</msg>");
}
- nsprintf(@"<inferior_pid>%@</inferior_pid>", [session simulatedApplicationPID]);
+ nsprintf(@"<inferior_pid>%d</inferior_pid>", pid);
fflush(stdout);
if (exitOnStartup) {
- [self doExit:EXIT_SUCCESS];
- return;
+ [self doExit:EXIT_SUCCESS];
+ return;
}
- pidCheckingTimer = [[NSTimer scheduledTimerWithTimeInterval:5.0 target:self
- selector:@selector(checkPid:) userInfo:nil repeats: TRUE] retain];
} else {
- nsprintf(@"<msg>Session could not be started: %@</msg>", error);
- [self doExit:EXIT_FAILURE];
+ nsprintf(@"<msg>Session could not be started: %@</msg>", error);
+ [self doExit:EXIT_FAILURE];
}
}
- (void)stop {
- if (session)
- [session requestEndWithTimeout: 0.1];
+ if (mySession)
+ [mySession requestEndWithTimeout: 0.1];
}
-- (void)checkPid:(NSTimer *)timer {
- (void)timer;
- if (session && [[session simulatedApplicationPID]intValue] > 0) {
- if (kill((pid_t)[[session simulatedApplicationPID]intValue], 0) == -1) {
- nsprintf(@"<msg>app stopped</msg>");
- [self doExit:EXIT_SUCCESS];
- return;
- }
- }
-}
- (void)stdioDataIsAvailable:(NSNotification *)notification {
[[notification object] readInBackgroundAndNotify];
NSData *data = [[notification userInfo] valueForKey:NSFileHandleNotificationDataItem];
@@ -201,14 +278,13 @@ NSString *deviceIpadRetina = @"iPad (Retina)";
} else {
nsprintf(@"<app_output>%@</app_output>", str); // handle stderr differently?
}
- fflush(stdout);
}
- (void)createStdioFIFO:(NSFileHandle **)fileHandle ofType:(NSString *)type atPath:(NSString **)path {
*path = [NSString stringWithFormat:@"%@/ios-sim-%@-pipe-%d", NSTemporaryDirectory(), type, (int)time(NULL)];
if (mkfifo([*path UTF8String], S_IRUSR | S_IWUSR) == -1) {
- nsprintf(@"<msg>Unable to create %@ named pipe `%@'</msg>", type, *path);
+ nsprintf(@"<msg>Unable to create %@ named pipe `%@</msg>'", type, *path);
[self doExit:EXIT_FAILURE];
} else {
if (verbose) {
@@ -246,33 +322,27 @@ NSString *deviceIpadRetina = @"iPad (Retina)";
args:(NSArray *)args {
DTiPhoneSimulatorApplicationSpecifier *appSpec;
DTiPhoneSimulatorSessionConfig *config;
- NSError *error = 0;
- id tClass;
+ DTiPhoneSimulatorSession *session;
+ NSError *error;
NSFileManager *fileManager = [[[NSFileManager alloc] init] autorelease];
if (!startOnly && ![fileManager fileExistsAtPath:path]) {
- nsprintf(@"<msg>Application path %@ doesn't exist!</msg>", path);
- return EXIT_FAILURE;
+ nsprintf(@"<msg>Application path %@ doesn't exist!</msg>", path);
+ return EXIT_FAILURE;
}
/* Create the app specifier */
- tClass = objc_getClass("DTiPhoneSimulatorApplicationSpecifier");
- if (tClass == nil) {
- nsprintf(@"<msg>DTiPhoneSimulatorApplicationSpecifier class is nil.</msg>");
- return EXIT_FAILURE;
- }
- appSpec = startOnly ? nil : [tClass specifierWithApplicationPath:path];
+ appSpec = startOnly ? nil : [[self FindClassByName:@"DTiPhoneSimulatorApplicationSpecifier"] specifierWithApplicationPath:path];
if (verbose) {
- nsprintf(@"<msg>App Spec: %@</msg>", appSpec);
- nsprintf(@"SDK Root: %@", sdkRoot);
+ nsprintf(@"<msg>App Spec: %@</msg>", appSpec);
+ nsprintf(@"<msg>SDK Root: %@</msg>", sdkRoot);
for (id key in environment) {
nsprintf(@"<msg>Env: %@ = %@</msg>", key, [environment objectForKey:key]);
}
}
-
NSString *sdkVersion = [sdkRoot sdkVersion];
NSString *appSupportDir = [NSString stringWithFormat:@"%@/Library/Application Support/iPhone Simulator/%@",
NSHomeDirectory(), sdkVersion];
@@ -288,12 +358,7 @@ NSString *deviceIpadRetina = @"iPad (Retina)";
environment = mutableEnv;
/* Set up the session configuration */
- tClass = objc_getClass("DTiPhoneSimulatorSessionConfig");
- if (tClass == nil) {
- nsprintf(@"<msg>DTiPhoneSimulatorApplicationSpecifier class is nil.</msg>");
- return EXIT_FAILURE;
- }
- config = [[[tClass alloc] init] autorelease];
+ config = [[[[self FindClassByName:@"DTiPhoneSimulatorSessionConfig"] alloc] init] autorelease];
[config setApplicationToSimulateOnStart:appSpec];
[config setSimulatedSystemRoot:sdkRoot];
[config setSimulatedApplicationShouldWaitForDebugger:shouldWaitDebugger];
@@ -333,16 +398,13 @@ NSString *deviceIpadRetina = @"iPad (Retina)";
[config setSimulatedDeviceFamily:[NSNumber numberWithInt:1]];
}
}
-
- [self changeDeviceType:family retina:retinaDevice isTallDevice:tallDevice];
+
+ NSString* devicePropertyValue = [self changeDeviceType:family retina:retinaDevice isTallDevice:tallDevice];
+ [config setSimulatedDeviceInfoName:devicePropertyValue];
/* Start the session */
- tClass = objc_getClass("DTiPhoneSimulatorSession");
- if (tClass == nil) {
- nsprintf(@"<msg>DTiPhoneSimulatorSession class is nil.</msg>");
- return EXIT_FAILURE;
- }
- session = [[tClass alloc] init];
+ session = [[[[self FindClassByName:@"DTiPhoneSimulatorSession"] alloc] init] autorelease];
+ mySession = session;
[session setDelegate:self];
if (uuid != nil){
[session setUuid:uuid];
@@ -356,7 +418,7 @@ NSString *deviceIpadRetina = @"iPad (Retina)";
return EXIT_SUCCESS;
}
-- (void) changeDeviceType:(NSString *)family retina:(BOOL)retina isTallDevice:(BOOL)isTallDevice {
+- (NSString*) changeDeviceType:(NSString *)family retina:(BOOL)retina isTallDevice:(BOOL)isTallDevice {
NSString *devicePropertyValue;
if (retina) {
if (verbose) {
@@ -381,6 +443,8 @@ NSString *deviceIpadRetina = @"iPad (Retina)";
}
CFPreferencesSetAppValue((CFStringRef)deviceProperty, (CFPropertyListRef)devicePropertyValue, (CFStringRef)simulatorPrefrencesName);
CFPreferencesAppSynchronize((CFStringRef)simulatorPrefrencesName);
+
+ return devicePropertyValue;
}
@@ -398,17 +462,29 @@ NSString *deviceIpadRetina = @"iPad (Retina)";
exitOnStartup = NO;
alreadyPrintedData = NO;
startOnly = strcmp(argv[1], "start") == 0;
+
nsprintf(@"<query_result>");
+ for (int i = 0; i < argc; ++i) {
+ if (strcmp(argv[i], "--developer-path") == 0) {
+ ++i;
+ if (i < argc)
+ gDevDir = argv[i];
+ }
+ }
+ NSString* developerDir = FindDeveloperDir();
+ if (!developerDir) {
+ nsprintf(@"Unable to find developer directory.");
+ exit(EXIT_FAILURE);
+ }
if (strcmp(argv[1], "showsdks") == 0) {
- [self doExit:[self showSDKs]];
- return;
+ [self LoadSimulatorFramework:developerDir];
+ exit([self showSDKs]);
} else if (strcmp(argv[1], "launch") == 0 || startOnly) {
if (strcmp(argv[1], "launch") == 0 && argc < 3) {
nsprintf(@"<msg>Missing application path argument</msg>");
[self printUsage];
- [self doExit:EXIT_FAILURE];
- return;
+ exit(EXIT_FAILURE);
}
NSString *appPath = nil;
@@ -425,6 +501,7 @@ NSString *deviceIpadRetina = @"iPad (Retina)";
NSString *uuid = nil;
NSString *stdoutPath = nil;
NSString *stderrPath = nil;
+ NSString *xctest = nil;
NSTimeInterval timeout = 30;
NSMutableDictionary *environment = [NSMutableDictionary dictionary];
@@ -452,20 +529,15 @@ NSString *deviceIpadRetina = @"iPad (Retina)";
} else if (strcmp(argv[i], "--timeout") == 0) {
if (i + 1 < argc) {
timeout = [[NSString stringWithUTF8String:argv[++i]] doubleValue];
- NSLog(@"<msg>Timeout: %f second(s)</msg>", timeout);
+ NSLog(@"Timeout: %f second(s)", timeout);
}
}
else if (strcmp(argv[i], "--sdk") == 0) {
i++;
+ [self LoadSimulatorFramework:developerDir];
NSString* ver = [NSString stringWithCString:argv[i] encoding:NSUTF8StringEncoding];
- id tClass = objc_getClass("DTiPhoneSimulatorSystemRoot");
- NSArray *roots;
- if (tClass == nil) {
- nsprintf(@"<msg>DTiPhoneSimulatorSystemRoot class is nil.</msg>");
- [self doExit:EXIT_FAILURE];
- return;
- }
- roots = [tClass knownRoots];
+ Class systemRootClass = [self FindClassByName:@"DTiPhoneSimulatorSystemRoot"];
+ NSArray *roots = [systemRootClass knownRoots];
for (DTiPhoneSimulatorSystemRoot *root in roots) {
NSString *v = [root sdkVersion];
if ([v isEqualToString:ver]) {
@@ -491,7 +563,7 @@ NSString *deviceIpadRetina = @"iPad (Retina)";
} else if (strcmp(argv[i], "--env") == 0) {
i++;
NSString *envFilePath = [[NSString stringWithUTF8String:argv[i]] expandPath];
- environment = [NSDictionary dictionaryWithContentsOfFile:envFilePath];
+ [environment setValuesForKeysWithDictionary:[NSDictionary dictionaryWithContentsOfFile:envFilePath]];
if (!environment) {
fprintf(stdout, "<msg>Could not read environment from file: %s</msg>\n", argv[i]);
[self printUsage];
@@ -502,9 +574,13 @@ NSString *deviceIpadRetina = @"iPad (Retina)";
stdoutPath = [[NSString stringWithUTF8String:argv[i]] expandPath];
NSLog(@"stdoutPath: %@", stdoutPath);
} else if (strcmp(argv[i], "--stderr") == 0) {
- i++;
- stderrPath = [[NSString stringWithUTF8String:argv[i]] expandPath];
- NSLog(@"stderrPath: %@", stderrPath);
+ i++;
+ stderrPath = [[NSString stringWithUTF8String:argv[i]] expandPath];
+ NSLog(@"stderrPath: %@", stderrPath);
+ } else if (strcmp(argv[i], "--xctest") == 0) {
+ i++;
+ xctest = [[NSString stringWithUTF8String:argv[i]] expandPath];
+ NSLog(@"xctest: %@", xctest);
} else if (strcmp(argv[i], "--retina") == 0) {
retinaDevice = YES;
} else if (strcmp(argv[i], "--tall") == 0) {
@@ -513,7 +589,7 @@ NSString *deviceIpadRetina = @"iPad (Retina)";
i++;
break;
} else {
- printf("<msg>unrecognized argument:%s</msg>\n", argv[i]);
+ fprintf(stdout, "<msg>unrecognized argument:%s</msg>\n", argv[i]);
[self printUsage];
[self doExit:EXIT_FAILURE];
return;
@@ -525,13 +601,19 @@ NSString *deviceIpadRetina = @"iPad (Retina)";
}
if (sdkRoot == nil) {
- id tClass = objc_getClass("DTiPhoneSimulatorSystemRoot");
- if (tClass == nil) {
- nsprintf(@"<msg>DTiPhoneSimulatorSystemRoot class is nil.</msg>");
- [self doExit:EXIT_FAILURE];
- return;
- }
- sdkRoot = [tClass defaultRoot];
+ [self LoadSimulatorFramework:developerDir];
+ Class systemRootClass = [self FindClassByName:@"DTiPhoneSimulatorSystemRoot"];
+ sdkRoot = [systemRootClass defaultRoot];
+ }
+ if (xctest) {
+ NSString *appName = [appPath lastPathComponent];
+ NSString *executableName = [appName stringByDeletingPathExtension];
+ NSString *injectionPath = @"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/IDEBundleInjection.framework/IDEBundleInjection";
+ [environment setValuesForKeysWithDictionary:@{
+ @"DYLD_INSERT_LIBRARIES" : injectionPath,
+ @"XCInjectBundle" : xctest,
+ @"XCInjectBundleInto" : [appPath stringByAppendingFormat:@"/%@", executableName],
+ }];
}
/* Don't exit, adds to runloop */
@@ -556,7 +638,7 @@ NSString *deviceIpadRetina = @"iPad (Retina)";
printf("%s\n", IOS_SIM_VERSION);
[self doExit:EXIT_SUCCESS];
} else {
- fprintf(stdout, "<msg>Unknown command</msg>\n");
+ fprintf(stderr, "Unknown command\n");
[self printUsage];
[self doExit:EXIT_FAILURE];
}
diff --git a/src/tools/3rdparty/iossim/main.mm b/src/tools/3rdparty/iossim/main.mm
index 29b67c5c33..b8f778be27 100644
--- a/src/tools/3rdparty/iossim/main.mm
+++ b/src/tools/3rdparty/iossim/main.mm
@@ -5,69 +5,24 @@
* See the IOSSIM_LICENSE file in this directory for the license on the source code in this file.
*/
/* derived from https://github.com/phonegap/ios-sim */
+
#import <AppKit/AppKit.h>
-#import "iphonesimulator.h"
-#include <QLibrary>
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
-#include <QApplication>
-#else
-#include <QGuiApplication>
-#endif
-#include <QString>
-#include <QStringList>
-/* to do:
- * - try to stop inferior when killed (or communicate with creator to allow killing the inferior)
- * - remove unneeded functionality and streamline a bit
- */
+#import "iphonesimulator.h"
/*
* Runs the iPhoneSimulator backed by a main runloop.
*/
int main (int argc, char *argv[]) {
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QApplication a(argc, argv);
-#else
- QGuiApplication a(argc, argv);
-#endif
-
-
- //NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- QString xcodePath = QLatin1String("/Applications/Xcode.app/Contents/Developer/");
- for (int i = 0; i + 1 < argc; ++i) {
- if (strcmp(argv[i], "--developer-path") == 0)
- xcodePath = QCoreApplication::arguments().at(i+1);
- }
- if (!xcodePath.endsWith(QLatin1Char('/')))
- xcodePath.append(QLatin1Char('/'));
-
- /* manual loading of the private deps */
- QStringList deps = QStringList()
- << QLatin1String("/System/Library/PrivateFrameworks/DebugSymbols.framework/Versions/A/DebugSymbols")
- << QLatin1String("/System/Library/PrivateFrameworks/CoreSymbolication.framework/CoreSymbolication")
- << (xcodePath + QLatin1String("../OtherFrameworks/DevToolsFoundation.framework/DevToolsFoundation"));
- foreach (const QString &libPath, deps) {
- QLibrary *lib = new QLibrary(libPath);
- //lib->setLoadHints(QLibrary::ExportExternalSymbolsHint);
- if (!lib->load())
- printf("<msg>error loading %s</msg>", libPath.toUtf8().constData());
- }
- QLibrary *libIPhoneSimulatorRemoteClient = new QLibrary(xcodePath
- + QLatin1String("Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/iPhoneSimulatorRemoteClient.framework/iPhoneSimulatorRemoteClient"));
- //libIPhoneSimulatorRemoteClient->setLoadHints(QLibrary::ResolveAllSymbolsHint|QLibrary::ExportExternalSymbolsHint);
- if (!libIPhoneSimulatorRemoteClient->load())
- printf("<msg>error loading iPhoneSimulatorRemoteClient</msg>");
-
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
iPhoneSimulator *sim = [[iPhoneSimulator alloc] init];
-
+
/* Execute command line handler */
[sim runWithArgc: argc argv: argv];
/* Run the loop to handle added input sources, if any */
+ [[NSRunLoop mainRunLoop] run];
- int res = a.exec();
- exit(res);
- // [pool release];
+ [pool release];
return 0;
}
diff --git a/src/tools/3rdparty/iossim/nsprintf.mm b/src/tools/3rdparty/iossim/nsprintf.mm
index b7413f593c..95c12c785f 100644
--- a/src/tools/3rdparty/iossim/nsprintf.mm
+++ b/src/tools/3rdparty/iossim/nsprintf.mm
@@ -24,7 +24,7 @@ int nsfprintf (FILE *stream, NSString *format, ...) {
va_start(ap, format);
{
retval = nsvfprintf(stream, format, ap);
- }
+ }
va_end(ap);
return retval;
@@ -37,7 +37,7 @@ int nsprintf (NSString *format, ...) {
va_start(ap, format);
{
retval = nsvfprintf(stdout, format, ap);
- }
+ }
va_end(ap);
return retval;
diff --git a/src/tools/3rdparty/iossim/nsstringexpandpath.mm b/src/tools/3rdparty/iossim/nsstringexpandpath.mm
index 53f43e3c12..b36481b504 100644
--- a/src/tools/3rdparty/iossim/nsstringexpandpath.mm
+++ b/src/tools/3rdparty/iossim/nsstringexpandpath.mm
@@ -1,5 +1,5 @@
/*
- * See the IOSSIM_LICENSE file in this directory for the license on the source code in this file.
+ * See the LICENSE file for the license on the source code in this file.
*/
#import "nsstringexpandpath.h"
diff --git a/src/tools/3rdparty/iossim/version.h b/src/tools/3rdparty/iossim/version.h
index 9f8c0dfc91..d22dd94b8e 100644
--- a/src/tools/3rdparty/iossim/version.h
+++ b/src/tools/3rdparty/iossim/version.h
@@ -1 +1 @@
-#define IOS_SIM_VERSION "1.8.2m"
+#define IOS_SIM_VERSION "1.9.0"
diff --git a/src/tools/3rdparty/iossim_1_8_2/IOSSIM_LICENSE b/src/tools/3rdparty/iossim_1_8_2/IOSSIM_LICENSE
new file mode 100644
index 0000000000..162622f1db
--- /dev/null
+++ b/src/tools/3rdparty/iossim_1_8_2/IOSSIM_LICENSE
@@ -0,0 +1,31 @@
+Author: Landon Fuller <landonf@plausiblelabs.com>
+Copyright (c) 2008-2011 Plausible Labs Cooperative, Inc.
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Modifications made by the following entities are licensed as above:
+- Jeff Haynie, Appcelerator, Inc.
+- https://github.com/hborders
+- http://pivotallabs.com/users/scoward/blog
+- Eloy Duran, Fingertips <eloy@fngtps.com>
+- Fawzi Mohamed, digia <fawzi.mohamed@digia.com>
diff --git a/src/tools/3rdparty/iossim_1_8_2/Info.plist b/src/tools/3rdparty/iossim_1_8_2/Info.plist
new file mode 100644
index 0000000000..bc69bf3873
--- /dev/null
+++ b/src/tools/3rdparty/iossim_1_8_2/Info.plist
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>@TYPEINFO@</string>
+ <key>CFBundleExecutable</key>
+ <string>@EXECUTABLE@</string>
+ <key>CFBundleIdentifier</key>
+ <string>org.qt-project.qt-creator.iosTool</string>
+ <key>LSUIElement</key>
+ <string>1</string>
+</dict>
+</plist>
diff --git a/src/tools/3rdparty/iossim_1_8_2/iossim.qbs b/src/tools/3rdparty/iossim_1_8_2/iossim.qbs
new file mode 100644
index 0000000000..1b96084e17
--- /dev/null
+++ b/src/tools/3rdparty/iossim_1_8_2/iossim.qbs
@@ -0,0 +1,30 @@
+import qbs 1.0
+import QtcTool
+
+
+QtcTool {
+ name: "iossim"
+ condition: qbs.targetOS.contains("osx")
+
+ Depends { name: "Qt"; submodules: ["widgets"] }
+ Depends { name: "app_version_header" }
+
+ files: [
+ "main.mm",
+ "nsprintf.mm",
+ "nsstringexpandpath.mm",
+ "iphonesimulator.mm",
+ "iphonesimulator.h",
+ "nsprintf.h",
+ "nsstringexpandpath.h",
+ "version.h",
+ "iphonesimulatorremoteclient/iphonesimulatorremoteclient.h"
+ ]
+ cpp.linkerFlags: base.concat(["-sectcreate", "__TEXT", "__info_plist", path + "/Info.plist",
+ "-fobjc-link-runtime"])
+ cpp.frameworks: base.concat(["Foundation", "CoreServices", "ApplicationServices", "IOKit",
+ "AppKit"])
+ cpp.frameworkPaths: base.concat("/System/Library/PrivateFrameworks")
+
+ toolInstallDir: project.ide_libexec_path + "/ios"
+}
diff --git a/src/tools/3rdparty/iossim_1_8_2/iossim_1_8_2.pro b/src/tools/3rdparty/iossim_1_8_2/iossim_1_8_2.pro
new file mode 100644
index 0000000000..9e30307406
--- /dev/null
+++ b/src/tools/3rdparty/iossim_1_8_2/iossim_1_8_2.pro
@@ -0,0 +1,55 @@
+CONFIG += console
+
+QT += core
+QT += gui
+
+CONFIG -= app_bundle
+
+include(../../../../qtcreator.pri)
+
+# Prevent from popping up in the dock when launched.
+# We embed the Info.plist file, so the application doesn't need to
+# be a bundle.
+QMAKE_LFLAGS += -sectcreate __TEXT __info_plist \"$$PWD/Info.plist\" \
+ -fobjc-link-runtime
+
+LIBS += \
+ -framework Foundation \
+ -framework CoreServices \
+ -framework ApplicationServices \
+ -framework CoreFoundation \
+ -F/System/Library/PrivateFrameworks \
+ -framework IOKit -framework AppKit
+
+iPhoneSimulatorRemoteClientDirectLinking {
+ LIBS += \
+ -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks \
+ -F/Applications/Xcode.app/Contents/OtherFrameworks
+ LIBS += \
+ -framework iPhoneSimulatorRemoteClient
+ QMAKE_RPATHDIR += /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks \
+ /Applications/Xcode.app/Contents/OtherFrameworks
+ /System/Library/PrivateFrameworks \
+}
+
+TEMPLATE = app
+
+# put into a subdir, so we can deploy a separate qt.conf for it
+DESTDIR = $$IDE_LIBEXEC_PATH/ios
+include(../../../rpath.pri)
+
+OBJECTIVE_SOURCES += \
+ main.mm \
+ nsprintf.mm \
+ nsstringexpandPath.mm \
+ iphonesimulator.mm
+
+HEADERS += \
+ iphonesimulator.h \
+ nsprintf.h \
+ nsstringexpandpath.h \
+ version.h \
+ iphonesimulatorremoteclient/iphonesimulatorremoteclient.h
+
+OTHER_FILES = IOSSIM_LICENSE \
+ Info.plist
diff --git a/src/tools/3rdparty/iossim_1_8_2/iphonesimulator.h b/src/tools/3rdparty/iossim_1_8_2/iphonesimulator.h
new file mode 100644
index 0000000000..0770c50ee3
--- /dev/null
+++ b/src/tools/3rdparty/iossim_1_8_2/iphonesimulator.h
@@ -0,0 +1,41 @@
+/* Author: Landon Fuller <landonf@plausiblelabs.com>
+ * Copyright (c) 2008-2011 Plausible Labs Cooperative, Inc.
+ * All rights reserved.
+ *
+ * See the IOSSIM_LICENSE file in this directory for the license on the source code in this file.
+ */
+
+#import <Foundation/Foundation.h>
+#import "iphonesimulatorremoteclient/iphonesimulatorremoteclient.h"
+#import "version.h"
+
+@interface iPhoneSimulator : NSObject <DTiPhoneSimulatorSessionDelegate> {
+@private
+ DTiPhoneSimulatorSystemRoot *sdkRoot;
+ NSFileHandle *stdoutFileHandle;
+ NSFileHandle *stderrFileHandle;
+ DTiPhoneSimulatorSession *session;
+ NSTimer *pidCheckingTimer;
+ BOOL startOnly;
+ BOOL exitOnStartup;
+ BOOL shouldWaitDebugger;
+ BOOL shouldStartDebugger;
+ BOOL useGDB;
+ BOOL verbose;
+ BOOL alreadyPrintedData;
+ BOOL retinaDevice;
+ BOOL tallDevice;
+}
+
+- (id)init;
+- (void)dealloc;
+- (void)runWithArgc:(int)argc argv:(char **)argv;
+
+- (void)createStdioFIFO:(NSFileHandle **)fileHandle ofType:(NSString *)type atPath:(NSString **)path;
+- (void)removeStdioFIFO:(NSFileHandle *)fileHandle atPath:(NSString *)path;
+- (void)stop;
+- (void)checkPid:(NSTimer *)timer;
+- (void)doExit:(int)errorCode;
+- (void)changeDeviceType:(NSString *)family retina:(BOOL)retina isTallDevice:(BOOL)isTallDevice;
+
+@end
diff --git a/src/tools/3rdparty/iossim_1_8_2/iphonesimulator.mm b/src/tools/3rdparty/iossim_1_8_2/iphonesimulator.mm
new file mode 100644
index 0000000000..b06b54276d
--- /dev/null
+++ b/src/tools/3rdparty/iossim_1_8_2/iphonesimulator.mm
@@ -0,0 +1,566 @@
+/* Author: Landon Fuller <landonf@plausiblelabs.com>
+ * Copyright (c) 2008-2011 Plausible Labs Cooperative, Inc.
+ * All rights reserved.
+ *
+ * See the IOSSIM_LICENSE file in this directory for the license on the source code in this file.
+ */
+
+#import "iphonesimulator.h"
+#import "nsstringexpandpath.h"
+#import "nsprintf.h"
+#import <sys/types.h>
+#import <sys/stat.h>
+#import <objc/runtime.h>
+#import <AppKit/NSRunningApplication.h>
+
+NSString *simulatorPrefrencesName = @"com.apple.iphonesimulator";
+NSString *deviceProperty = @"SimulateDevice";
+NSString *deviceIphoneRetina3_5Inch = @"iPhone Retina (3.5-inch)";
+NSString *deviceIphoneRetina4_0Inch = @"iPhone Retina (4-inch)";
+NSString *deviceIphone = @"iPhone";
+NSString *deviceIpad = @"iPad";
+NSString *deviceIpadRetina = @"iPad (Retina)";
+
+/**
+ * A simple iPhoneSimulatorRemoteClient framework.
+ */
+@implementation iPhoneSimulator
+
+- (id)init {
+ self = [super init];
+ session = nil;
+ pidCheckingTimer = nil;
+ return self;
+}
+
+- (void)dealloc {
+ [session release];
+ [pidCheckingTimer release];
+ [super dealloc];
+}
+
+- (void)doExit:(int)errorCode {
+ nsprintf(@"<exit code=\"%d\"/>", errorCode);
+ nsprintf(@"</query_result>");
+ fflush(stdout);
+ fflush(stderr);
+ exit(errorCode);
+}
+
+- (void) printUsage {
+ fprintf(stdout, "<msg>Usage: iossim <command> <options> [--args ...]\n");
+ fprintf(stdout, "\n");
+ fprintf(stdout, "Commands:\n");
+ fprintf(stdout, " showsdks List the available iOS SDK versions\n");
+ fprintf(stdout, " launch <application path> Launch the application at the specified path on the iOS Simulator\n");
+ fprintf(stdout, " start Launch iOS Simulator without an app\n");
+ fprintf(stdout, "\n");
+ fprintf(stdout, "Options:\n");
+ fprintf(stdout, " --version Print the version of ios-sim\n");
+ fprintf(stdout, " --developer-path <developerDir> path to the developer directory (in Xcode)");
+ fprintf(stdout, " --help Show this help text\n");
+ fprintf(stdout, " --verbose Set the output level to verbose\n");
+ fprintf(stdout, " --exit Exit after startup\n");
+ fprintf(stdout, " --wait-for-debugger Wait for debugger to attach\n");
+ fprintf(stdout, " --debug Attach LLDB to the application on startup\n");
+ fprintf(stdout, " --use-gdb Use GDB instead of LLDB. (Requires --debug)\n");
+ fprintf(stdout, " --sdk <sdkversion> The iOS SDK version to run the application on (defaults to the latest)\n");
+ fprintf(stdout, " --family <device family> The device type that should be simulated (defaults to `iphone')\n");
+ fprintf(stdout, " --retina Start a retina device\n");
+ fprintf(stdout, " --tall In combination with --retina flag, start the tall version of the retina device (e.g. iPhone 5 (4-inch))\n");
+ fprintf(stdout, " --uuid <uuid> A UUID identifying the session (is that correct?)\n");
+ fprintf(stdout, " --env <environment file path> A plist file containing environment key-value pairs that should be set\n");
+ fprintf(stdout, " --setenv NAME=VALUE Set an environment variable\n");
+ fprintf(stdout, " --stdout <stdout file path> The path where stdout of the simulator will be redirected to (defaults to stdout of ios-sim)\n");
+ fprintf(stdout, " --stderr <stderr file path> The path where stderr of the simulator will be redirected to (defaults to stderr of ios-sim)\n");
+ fprintf(stdout, " --timeout <seconds> The timeout time to wait for a response from the Simulator. Default value: 30 seconds\n");
+ fprintf(stdout, " --args <...> All following arguments will be passed on to the application</msg>\n");
+ fflush(stdout);
+}
+
+
+- (int) showSDKs {
+ NSUInteger i;
+ id tClass = objc_getClass("DTiPhoneSimulatorSystemRoot");
+ if (tClass == nil) {
+ nsprintf(@"<msg>DTiPhoneSimulatorSystemRoot class is nil.</msg>");
+ return EXIT_FAILURE;
+ }
+ NSArray *roots = [tClass knownRoots];
+
+ nsprintf(@"<device_info>");
+ for (i = 0; i < [roots count]; ++i) {
+ DTiPhoneSimulatorSystemRoot *root = [roots objectAtIndex:i];
+ nsprintf(@"<item><key>sdk%d_name</key><value>%@</value></item>", i, [root sdkDisplayName]);
+ nsprintf(@"<item><key>sdk%d_version</key><value>%@</value></item>", i, [root sdkVersion]);
+ nsprintf(@"<item><key>sdk%d_sysroot</key><value>%@</value></item>", i, [root sdkRootPath]);
+ }
+ nsprintf(@"</device_info>");
+ return EXIT_SUCCESS;
+}
+
+
+- (void)session:(DTiPhoneSimulatorSession *)mySession didEndWithError:(NSError *)error {
+ if (verbose) {
+ nsprintf(@"<msg>Session did end with error %@</msg>", error);
+ }
+
+ if (stderrFileHandle != nil) {
+ NSString *stderrPath = [[mySession sessionConfig] simulatedApplicationStdErrPath];
+ [self removeStdioFIFO:stderrFileHandle atPath:stderrPath];
+ }
+
+ if (stdoutFileHandle != nil) {
+ NSString *stdoutPath = [[mySession sessionConfig] simulatedApplicationStdOutPath];
+ [self removeStdioFIFO:stdoutFileHandle atPath:stdoutPath];
+ }
+
+ if (error != nil)
+ [self doExit:EXIT_FAILURE];
+ else
+ [self doExit:EXIT_SUCCESS];
+}
+
+
+- (void)session:(DTiPhoneSimulatorSession *)mySession didStart:(BOOL)started withError:(NSError *)error {
+ if (startOnly && mySession) {
+ [NSTask launchedTaskWithLaunchPath:@"/usr/bin/osascript"
+ arguments:[NSArray arrayWithObjects:@"-e", @"tell application \"iPhone Simulator\" to activate", nil]];
+ nsprintf(@"<msg>Simulator started (no session)</msg>");
+ [self doExit:EXIT_SUCCESS];
+ return;
+ }
+ if (started) {
+ [NSTask launchedTaskWithLaunchPath:@"/usr/bin/osascript"
+ arguments:[NSArray arrayWithObjects:@"-e", @"tell application \"iPhone Simulator\" to activate", nil]];
+ if (shouldStartDebugger) {
+ char*args[4] = { NULL, NULL, (char*)[[[mySession simulatedApplicationPID] description] UTF8String], NULL };
+ if (useGDB) {
+ args[0] = strdup("gdb");
+ args[1] = strdup("program");
+ } else {
+ args[0] = strdup("lldb");
+ args[1] = strdup("--attach-pid");
+ }
+ // The parent process must live on to process the stdout/stderr fifos,
+ // so start the debugger as a child process.
+ pid_t child_pid = fork();
+ if (child_pid == 0) {
+ execvp(args[0], args);
+ } else if (child_pid < 0) {
+ nsprintf(@"<msg>Could not start debugger process: %@</msg>", errno);
+ [self doExit:EXIT_FAILURE];
+ return;
+ }
+ }
+ if (verbose) {
+ nsprintf(@"<msg>Session started</msg>");
+ }
+ nsprintf(@"<inferior_pid>%@</inferior_pid>", [session simulatedApplicationPID]);
+ fflush(stdout);
+ if (exitOnStartup) {
+ [self doExit:EXIT_SUCCESS];
+ return;
+ }
+ pidCheckingTimer = [[NSTimer scheduledTimerWithTimeInterval:5.0 target:self
+ selector:@selector(checkPid:) userInfo:nil repeats: TRUE] retain];
+ } else {
+ nsprintf(@"<msg>Session could not be started: %@</msg>", error);
+ [self doExit:EXIT_FAILURE];
+ }
+}
+
+- (void)stop {
+ if (session)
+ [session requestEndWithTimeout: 0.1];
+}
+
+- (void)checkPid:(NSTimer *)timer {
+ (void)timer;
+ if (session && [[session simulatedApplicationPID]intValue] > 0) {
+ if (kill((pid_t)[[session simulatedApplicationPID]intValue], 0) == -1) {
+ nsprintf(@"<msg>app stopped</msg>");
+ [self doExit:EXIT_SUCCESS];
+ return;
+ }
+ }
+}
+- (void)stdioDataIsAvailable:(NSNotification *)notification {
+ [[notification object] readInBackgroundAndNotify];
+ NSData *data = [[notification userInfo] valueForKey:NSFileHandleNotificationDataItem];
+ NSString *str = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; /* dangerous if partially encoded data is at the boundary */
+ if (!alreadyPrintedData) {
+ if ([str length] == 0) {
+ return;
+ } else {
+ alreadyPrintedData = YES;
+ }
+ }
+ if ([notification object] == stdoutFileHandle) {
+ printf("<app_output>%s</app_output>\n", [str UTF8String]);
+ } else {
+ nsprintf(@"<app_output>%@</app_output>", str); // handle stderr differently?
+ }
+ fflush(stdout);
+}
+
+
+- (void)createStdioFIFO:(NSFileHandle **)fileHandle ofType:(NSString *)type atPath:(NSString **)path {
+ *path = [NSString stringWithFormat:@"%@/ios-sim-%@-pipe-%d", NSTemporaryDirectory(), type, (int)time(NULL)];
+ if (mkfifo([*path UTF8String], S_IRUSR | S_IWUSR) == -1) {
+ nsprintf(@"<msg>Unable to create %@ named pipe `%@'</msg>", type, *path);
+ [self doExit:EXIT_FAILURE];
+ } else {
+ if (verbose) {
+ nsprintf(@"<msg>Creating named pipe at `%@'</msg>", *path);
+ }
+ int fd = open([*path UTF8String], O_RDONLY | O_NDELAY);
+ *fileHandle = [[[NSFileHandle alloc] initWithFileDescriptor:fd] retain];
+ [*fileHandle readInBackgroundAndNotify];
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(stdioDataIsAvailable:)
+ name:NSFileHandleReadCompletionNotification
+ object:*fileHandle];
+ }
+}
+
+
+- (void)removeStdioFIFO:(NSFileHandle *)fileHandle atPath:(NSString *)path {
+ if (verbose) {
+ nsprintf(@"<msg>Removing named pipe at `%@'</msg>", path);
+ }
+ [fileHandle closeFile];
+ [fileHandle release];
+ if (![[NSFileManager defaultManager] removeItemAtPath:path error:NULL]) {
+ nsprintf(@"<msg>Unable to remove named pipe `%@'</msg>", path);
+ }
+}
+
+
+- (int)launchApp:(NSString *)path withFamily:(NSString *)family
+ uuid:(NSString *)uuid
+ environment:(NSDictionary *)environment
+ stdoutPath:(NSString *)stdoutPath
+ stderrPath:(NSString *)stderrPath
+ timeout:(NSTimeInterval)timeout
+ args:(NSArray *)args {
+ DTiPhoneSimulatorApplicationSpecifier *appSpec;
+ DTiPhoneSimulatorSessionConfig *config;
+ NSError *error = 0;
+ id tClass;
+
+ NSFileManager *fileManager = [[[NSFileManager alloc] init] autorelease];
+ if (!startOnly && ![fileManager fileExistsAtPath:path]) {
+ nsprintf(@"<msg>Application path %@ doesn't exist!</msg>", path);
+ return EXIT_FAILURE;
+ }
+
+ /* Create the app specifier */
+ tClass = objc_getClass("DTiPhoneSimulatorApplicationSpecifier");
+ if (tClass == nil) {
+ nsprintf(@"<msg>DTiPhoneSimulatorApplicationSpecifier class is nil.</msg>");
+ return EXIT_FAILURE;
+ }
+ appSpec = startOnly ? nil : [tClass specifierWithApplicationPath:path];
+
+ if (verbose) {
+ nsprintf(@"<msg>App Spec: %@</msg>", appSpec);
+ nsprintf(@"SDK Root: %@", sdkRoot);
+
+ for (id key in environment) {
+ nsprintf(@"<msg>Env: %@ = %@</msg>", key, [environment objectForKey:key]);
+ }
+ }
+
+
+ NSString *sdkVersion = [sdkRoot sdkVersion];
+ NSString *appSupportDir = [NSString stringWithFormat:@"%@/Library/Application Support/iPhone Simulator/%@",
+ NSHomeDirectory(), sdkVersion];
+ NSMutableDictionary *mutableEnv = [NSMutableDictionary dictionaryWithDictionary:environment];
+ [mutableEnv setObject:appSupportDir forKey:@"CFFIXED_USER_HOME"];
+ [mutableEnv setObject:appSupportDir forKey:@"IPHONE_SHARED_RESOURCES_DIRECTORY"];
+ [mutableEnv setObject:appSupportDir forKey:@"HOME"];
+ [mutableEnv setObject:[sdkRoot sdkRootPath] forKey:@"IPHONE_SIMULATOR_ROOT"];
+ [mutableEnv setObject:[sdkRoot sdkRootPath] forKey:@"DYLD_ROOT_PATH"];
+ [mutableEnv setObject:[sdkRoot sdkRootPath] forKey:@"DYLD_FRAMEWORK_PATH"];
+ [mutableEnv setObject:[sdkRoot sdkRootPath] forKey:@"DYLD_LIBRARY_PATH"];
+ [mutableEnv setObject:@"YES" forKey:@"NSUnbufferedIO"];
+ environment = mutableEnv;
+
+ /* Set up the session configuration */
+ tClass = objc_getClass("DTiPhoneSimulatorSessionConfig");
+ if (tClass == nil) {
+ nsprintf(@"<msg>DTiPhoneSimulatorApplicationSpecifier class is nil.</msg>");
+ return EXIT_FAILURE;
+ }
+ config = [[[tClass alloc] init] autorelease];
+ [config setApplicationToSimulateOnStart:appSpec];
+ [config setSimulatedSystemRoot:sdkRoot];
+ [config setSimulatedApplicationShouldWaitForDebugger:shouldWaitDebugger];
+
+ [config setSimulatedApplicationLaunchArgs:args];
+ [config setSimulatedApplicationLaunchEnvironment:environment];
+
+ if (stderrPath) {
+ stderrFileHandle = nil;
+ } else if (!exitOnStartup) {
+ [self createStdioFIFO:&stderrFileHandle ofType:@"stderr" atPath:&stderrPath];
+ }
+ [config setSimulatedApplicationStdErrPath:stderrPath];
+
+ if (stdoutPath) {
+ stdoutFileHandle = nil;
+ } else if (!exitOnStartup) {
+ [self createStdioFIFO:&stdoutFileHandle ofType:@"stdout" atPath:&stdoutPath];
+ }
+ [config setSimulatedApplicationStdOutPath:stdoutPath];
+
+ [config setLocalizedClientName: @"iossim"];
+
+ // this was introduced in 3.2 of SDK
+ if ([config respondsToSelector:@selector(setSimulatedDeviceFamily:)]) {
+ if (family == nil) {
+ family = @"iphone";
+ }
+
+ if (verbose) {
+ nsprintf(@"using device family %@",family);
+ }
+
+ if ([family isEqualToString:@"ipad"]) {
+[config setSimulatedDeviceFamily:[NSNumber numberWithInt:2]];
+ } else{
+ [config setSimulatedDeviceFamily:[NSNumber numberWithInt:1]];
+ }
+ }
+
+ [self changeDeviceType:family retina:retinaDevice isTallDevice:tallDevice];
+
+ /* Start the session */
+ tClass = objc_getClass("DTiPhoneSimulatorSession");
+ if (tClass == nil) {
+ nsprintf(@"<msg>DTiPhoneSimulatorSession class is nil.</msg>");
+ return EXIT_FAILURE;
+ }
+ session = [[tClass alloc] init];
+ [session setDelegate:self];
+ if (uuid != nil){
+ [session setUuid:uuid];
+ }
+
+ if (![session requestStartWithConfig:config timeout:timeout error:&error]) {
+ nsprintf(@"<msg>Could not start simulator session: %@</msg>", error);
+ return EXIT_FAILURE;
+ }
+
+ return EXIT_SUCCESS;
+}
+
+- (void) changeDeviceType:(NSString *)family retina:(BOOL)retina isTallDevice:(BOOL)isTallDevice {
+ NSString *devicePropertyValue;
+ if (retina) {
+ if (verbose) {
+ nsprintf(@"<msg>using retina</msg>");
+ }
+ if ([family isEqualToString:@"ipad"]) {
+ devicePropertyValue = deviceIpadRetina;
+ }
+ else {
+ if (isTallDevice) {
+ devicePropertyValue = deviceIphoneRetina4_0Inch;
+ } else {
+ devicePropertyValue = deviceIphoneRetina3_5Inch;
+ }
+ }
+ } else {
+ if ([family isEqualToString:@"ipad"]) {
+ devicePropertyValue = deviceIpad;
+ } else {
+ devicePropertyValue = deviceIphone;
+ }
+ }
+ CFPreferencesSetAppValue((CFStringRef)deviceProperty, (CFPropertyListRef)devicePropertyValue, (CFStringRef)simulatorPrefrencesName);
+ CFPreferencesAppSynchronize((CFStringRef)simulatorPrefrencesName);
+}
+
+
+/**
+ * Execute 'main'
+ */
+- (void)runWithArgc:(int)argc argv:(char **)argv {
+ if (argc < 2) {
+ [self printUsage];
+ exit(EXIT_FAILURE);
+ }
+
+ retinaDevice = NO;
+ tallDevice = NO;
+ exitOnStartup = NO;
+ alreadyPrintedData = NO;
+ startOnly = strcmp(argv[1], "start") == 0;
+ nsprintf(@"<query_result>");
+
+ if (strcmp(argv[1], "showsdks") == 0) {
+ [self doExit:[self showSDKs]];
+ return;
+ } else if (strcmp(argv[1], "launch") == 0 || startOnly) {
+ if (strcmp(argv[1], "launch") == 0 && argc < 3) {
+ nsprintf(@"<msg>Missing application path argument</msg>");
+ [self printUsage];
+ [self doExit:EXIT_FAILURE];
+ return;
+ }
+
+ NSString *appPath = nil;
+ int argOffset;
+ if (startOnly) {
+ argOffset = 2;
+ }
+ else {
+ argOffset = 3;
+ appPath = [[NSString stringWithUTF8String:argv[2]] expandPath];
+ }
+
+ NSString *family = nil;
+ NSString *uuid = nil;
+ NSString *stdoutPath = nil;
+ NSString *stderrPath = nil;
+ NSTimeInterval timeout = 30;
+ NSMutableDictionary *environment = [NSMutableDictionary dictionary];
+
+ int i = argOffset;
+ for (; i < argc; i++) {
+ if (strcmp(argv[i], "--version") == 0) {
+ printf("%s\n", IOS_SIM_VERSION);
+ exit(EXIT_SUCCESS);
+ } else if (strcmp(argv[i], "--help") == 0) {
+ [self printUsage];
+ exit(EXIT_SUCCESS);
+ } else if (strcmp(argv[i], "--verbose") == 0) {
+ verbose = YES;
+ } else if (strcmp(argv[i], "--exit") == 0) {
+ exitOnStartup = YES;
+ } else if (strcmp(argv[i], "--wait-for-debugger") == 0) {
+ shouldWaitDebugger = YES;
+ } else if (strcmp(argv[i], "--debug") == 0) {
+ shouldWaitDebugger = YES;
+ shouldStartDebugger = YES;
+ } else if (strcmp(argv[i], "--use-gdb") == 0) {
+ useGDB = YES;
+ } else if (strcmp(argv[i], "--developer-path") == 0) {
+ ++i;
+ } else if (strcmp(argv[i], "--timeout") == 0) {
+ if (i + 1 < argc) {
+ timeout = [[NSString stringWithUTF8String:argv[++i]] doubleValue];
+ NSLog(@"<msg>Timeout: %f second(s)</msg>", timeout);
+ }
+ }
+ else if (strcmp(argv[i], "--sdk") == 0) {
+ i++;
+ NSString* ver = [NSString stringWithCString:argv[i] encoding:NSUTF8StringEncoding];
+ id tClass = objc_getClass("DTiPhoneSimulatorSystemRoot");
+ NSArray *roots;
+ if (tClass == nil) {
+ nsprintf(@"<msg>DTiPhoneSimulatorSystemRoot class is nil.</msg>");
+ [self doExit:EXIT_FAILURE];
+ return;
+ }
+ roots = [tClass knownRoots];
+ for (DTiPhoneSimulatorSystemRoot *root in roots) {
+ NSString *v = [root sdkVersion];
+ if ([v isEqualToString:ver]) {
+ sdkRoot = root;
+ break;
+ }
+ }
+ if (sdkRoot == nil) {
+ fprintf(stdout,"<msg>Unknown or unsupported SDK version: %s</msg>\n",argv[i]);
+ [self showSDKs];
+ exit(EXIT_FAILURE);
+ }
+ } else if (strcmp(argv[i], "--family") == 0) {
+ i++;
+ family = [NSString stringWithUTF8String:argv[i]];
+ } else if (strcmp(argv[i], "--uuid") == 0) {
+ i++;
+ uuid = [NSString stringWithUTF8String:argv[i]];
+ } else if (strcmp(argv[i], "--setenv") == 0) {
+ i++;
+ NSArray *parts = [[NSString stringWithUTF8String:argv[i]] componentsSeparatedByString:@"="];
+ [environment setObject:[parts objectAtIndex:1] forKey:[parts objectAtIndex:0]];
+ } else if (strcmp(argv[i], "--env") == 0) {
+ i++;
+ NSString *envFilePath = [[NSString stringWithUTF8String:argv[i]] expandPath];
+ environment = [NSDictionary dictionaryWithContentsOfFile:envFilePath];
+ if (!environment) {
+ fprintf(stdout, "<msg>Could not read environment from file: %s</msg>\n", argv[i]);
+ [self printUsage];
+ exit(EXIT_FAILURE);
+ }
+ } else if (strcmp(argv[i], "--stdout") == 0) {
+ i++;
+ stdoutPath = [[NSString stringWithUTF8String:argv[i]] expandPath];
+ NSLog(@"stdoutPath: %@", stdoutPath);
+ } else if (strcmp(argv[i], "--stderr") == 0) {
+ i++;
+ stderrPath = [[NSString stringWithUTF8String:argv[i]] expandPath];
+ NSLog(@"stderrPath: %@", stderrPath);
+ } else if (strcmp(argv[i], "--retina") == 0) {
+ retinaDevice = YES;
+ } else if (strcmp(argv[i], "--tall") == 0) {
+ tallDevice = YES;
+ } else if (strcmp(argv[i], "--args") == 0) {
+ i++;
+ break;
+ } else {
+ printf("<msg>unrecognized argument:%s</msg>\n", argv[i]);
+ [self printUsage];
+ [self doExit:EXIT_FAILURE];
+ return;
+ }
+ }
+ NSMutableArray *args = [NSMutableArray arrayWithCapacity:MAX(argc - i,0)];
+ for (; i < argc; i++) {
+ [args addObject:[NSString stringWithUTF8String:argv[i]]];
+ }
+
+ if (sdkRoot == nil) {
+ id tClass = objc_getClass("DTiPhoneSimulatorSystemRoot");
+ if (tClass == nil) {
+ nsprintf(@"<msg>DTiPhoneSimulatorSystemRoot class is nil.</msg>");
+ [self doExit:EXIT_FAILURE];
+ return;
+ }
+ sdkRoot = [tClass defaultRoot];
+ }
+
+ /* Don't exit, adds to runloop */
+ int res = [self launchApp:appPath
+ withFamily:family
+ uuid:uuid
+ environment:environment
+ stdoutPath:stdoutPath
+ stderrPath:stderrPath
+ timeout:timeout
+ args:args];
+ nsprintf(@"<app_started status=\"%@\" />", ((res == 0) ? @"SUCCESS" : @"FAILURE"));
+ fflush(stdout);
+ fflush(stderr);
+ if (res != 0)
+ [self doExit:EXIT_FAILURE];
+ } else {
+ if (argc == 2 && strcmp(argv[1], "--help") == 0) {
+ [self printUsage];
+ [self doExit:EXIT_SUCCESS];
+ } else if (argc == 2 && strcmp(argv[1], "--version") == 0) {
+ printf("%s\n", IOS_SIM_VERSION);
+ [self doExit:EXIT_SUCCESS];
+ } else {
+ fprintf(stdout, "<msg>Unknown command</msg>\n");
+ [self printUsage];
+ [self doExit:EXIT_FAILURE];
+ }
+ }
+}
+
+@end
diff --git a/src/tools/3rdparty/iossim/iphonesimulatorremoteclient/iphonesimulatorremoteclient.h b/src/tools/3rdparty/iossim_1_8_2/iphonesimulatorremoteclient/iphonesimulatorremoteclient.h
index abf69c8067..abf69c8067 100644
--- a/src/tools/3rdparty/iossim/iphonesimulatorremoteclient/iphonesimulatorremoteclient.h
+++ b/src/tools/3rdparty/iossim_1_8_2/iphonesimulatorremoteclient/iphonesimulatorremoteclient.h
diff --git a/src/tools/3rdparty/iossim_1_8_2/main.mm b/src/tools/3rdparty/iossim_1_8_2/main.mm
new file mode 100644
index 0000000000..fb83dc3e19
--- /dev/null
+++ b/src/tools/3rdparty/iossim_1_8_2/main.mm
@@ -0,0 +1,77 @@
+/* Author: Landon Fuller <landonf@plausiblelabs.com>
+ * Copyright (c) 2008-2011 Plausible Labs Cooperative, Inc.
+ * All rights reserved.
+ *
+ * See the IOSSIM_LICENSE file in this directory for the license on the source code in this file.
+ */
+/* derived from https://github.com/phonegap/ios-sim */
+#import <AppKit/AppKit.h>
+#import "iphonesimulator.h"
+#include <QLibrary>
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+#include <QApplication>
+#else
+#include <QGuiApplication>
+#endif
+#include <QString>
+#include <QStringList>
+
+/* to do:
+ * - try to stop inferior when killed (or communicate with creator to allow killing the inferior)
+ * - remove unneeded functionality and streamline a bit
+ */
+
+/*
+ * Runs the iPhoneSimulator backed by a main runloop.
+ */
+int main (int argc, char *argv[]) {
+ int qtargc = 1;
+ char *qtarg = 0;
+ if (argc)
+ qtarg = argv[0];
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+ QApplication a(qtargc, &qtarg);
+#else
+ QGuiApplication a(qtargc, &qtarg);
+#endif
+
+
+ //NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ QString xcodePath = QLatin1String("/Applications/Xcode.app/Contents/Developer/");
+ for (int i = 0; i + 1 < argc; ++i) {
+ if (strcmp(argv[i], "--developer-path") == 0)
+ xcodePath = QString::fromLocal8Bit(argv[i + 1]);
+ }
+ if (!xcodePath.endsWith(QLatin1Char('/')))
+ xcodePath.append(QLatin1Char('/'));
+
+ /* manual loading of the private deps */
+ QStringList deps = QStringList()
+ << QLatin1String("/System/Library/PrivateFrameworks/DebugSymbols.framework/Versions/A/DebugSymbols")
+ << QLatin1String("/System/Library/PrivateFrameworks/CoreSymbolication.framework/CoreSymbolication")
+ << (xcodePath + QLatin1String("../OtherFrameworks/DevToolsFoundation.framework/DevToolsFoundation"));
+ foreach (const QString &libPath, deps) {
+ QLibrary *lib = new QLibrary(libPath);
+ //lib->setLoadHints(QLibrary::ExportExternalSymbolsHint);
+ if (!lib->load())
+ printf("<msg>error loading %s</msg>", libPath.toUtf8().constData());
+ }
+ QLibrary *libIPhoneSimulatorRemoteClient = new QLibrary(xcodePath
+ + QLatin1String("Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/iPhoneSimulatorRemoteClient.framework/iPhoneSimulatorRemoteClient"));
+ //libIPhoneSimulatorRemoteClient->setLoadHints(QLibrary::ResolveAllSymbolsHint|QLibrary::ExportExternalSymbolsHint);
+ if (!libIPhoneSimulatorRemoteClient->load())
+ printf("<msg>error loading iPhoneSimulatorRemoteClient</msg>");
+
+ iPhoneSimulator *sim = [[iPhoneSimulator alloc] init];
+
+ /* Execute command line handler */
+ [sim runWithArgc: argc argv: argv];
+
+ /* Run the loop to handle added input sources, if any */
+
+ int res = a.exec();
+ exit(res);
+ // [pool release];
+ return 0;
+}
diff --git a/src/tools/3rdparty/iossim_1_8_2/nsprintf.h b/src/tools/3rdparty/iossim_1_8_2/nsprintf.h
new file mode 100644
index 0000000000..cee7c00d28
--- /dev/null
+++ b/src/tools/3rdparty/iossim_1_8_2/nsprintf.h
@@ -0,0 +1,6 @@
+/*
+ * See the IOSSIM_LICENSE file in this directory for the license on the source code in this file.
+ */
+int nsvfprintf (FILE *stream, NSString *format, va_list args);
+int nsfprintf (FILE *stream, NSString *format, ...);
+int nsprintf (NSString *format, ...);
diff --git a/src/tools/3rdparty/iossim_1_8_2/nsprintf.mm b/src/tools/3rdparty/iossim_1_8_2/nsprintf.mm
new file mode 100644
index 0000000000..b7413f593c
--- /dev/null
+++ b/src/tools/3rdparty/iossim_1_8_2/nsprintf.mm
@@ -0,0 +1,44 @@
+/*
+ * NSLog() clone, but writes to arbitrary output stream
+ *
+ * See the IOSSIM_LICENSE file in this directory for the license on the source code in this file.
+ */
+
+#import <Foundation/Foundation.h>
+#import <stdio.h>
+
+int nsvfprintf (FILE *stream, NSString *format, va_list args) {
+ int retval;
+
+ NSString *str = (NSString *) CFStringCreateWithFormatAndArguments(NULL, NULL, (CFStringRef) format, args);
+ retval = fprintf(stream, "%s\n", [str UTF8String]);
+ [str release];
+
+ return retval;
+}
+
+int nsfprintf (FILE *stream, NSString *format, ...) {
+ va_list ap;
+ int retval;
+
+ va_start(ap, format);
+ {
+ retval = nsvfprintf(stream, format, ap);
+ }
+ va_end(ap);
+
+ return retval;
+}
+
+int nsprintf (NSString *format, ...) {
+ va_list ap;
+ int retval;
+
+ va_start(ap, format);
+ {
+ retval = nsvfprintf(stdout, format, ap);
+ }
+ va_end(ap);
+
+ return retval;
+}
diff --git a/src/tools/3rdparty/iossim_1_8_2/nsstringexpandpath.h b/src/tools/3rdparty/iossim_1_8_2/nsstringexpandpath.h
new file mode 100644
index 0000000000..3eed139c0e
--- /dev/null
+++ b/src/tools/3rdparty/iossim_1_8_2/nsstringexpandpath.h
@@ -0,0 +1,11 @@
+/*
+ * See the IOSSIM_LICENSE file in this directory for the license on the source code in this file.
+ */
+
+#import <Foundation/Foundation.h>
+
+@interface NSString (ExpandPath)
+
+- (NSString *)expandPath;
+
+@end
diff --git a/src/tools/3rdparty/iossim_1_8_2/nsstringexpandpath.mm b/src/tools/3rdparty/iossim_1_8_2/nsstringexpandpath.mm
new file mode 100644
index 0000000000..53f43e3c12
--- /dev/null
+++ b/src/tools/3rdparty/iossim_1_8_2/nsstringexpandpath.mm
@@ -0,0 +1,18 @@
+/*
+ * See the IOSSIM_LICENSE file in this directory for the license on the source code in this file.
+ */
+
+#import "nsstringexpandpath.h"
+
+@implementation NSString (ExpandPath)
+
+- (NSString *)expandPath {
+ if ([self isAbsolutePath]) {
+ return [self stringByStandardizingPath];
+ } else {
+ NSString *cwd = [[NSFileManager defaultManager] currentDirectoryPath];
+ return [[cwd stringByAppendingPathComponent:self] stringByStandardizingPath];
+ }
+}
+
+@end
diff --git a/src/tools/3rdparty/iossim_1_8_2/version.h b/src/tools/3rdparty/iossim_1_8_2/version.h
new file mode 100644
index 0000000000..9f8c0dfc91
--- /dev/null
+++ b/src/tools/3rdparty/iossim_1_8_2/version.h
@@ -0,0 +1 @@
+#define IOS_SIM_VERSION "1.8.2m"
diff --git a/src/tools/iostool/iostool.qbs b/src/tools/iostool/iostool.qbs
index abb95f0975..e2a40ad446 100644
--- a/src/tools/iostool/iostool.qbs
+++ b/src/tools/iostool/iostool.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcTool
QtcTool {
diff --git a/src/tools/qtcdebugger/qtcdebugger.qbs b/src/tools/qtcdebugger/qtcdebugger.qbs
index 1895eb917f..7358d74eb3 100644
--- a/src/tools/qtcdebugger/qtcdebugger.qbs
+++ b/src/tools/qtcdebugger/qtcdebugger.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcTool
QtcTool {
diff --git a/src/tools/qtcreatorcrashhandler/qtcreatorcrashhandler.qbs b/src/tools/qtcreatorcrashhandler/qtcreatorcrashhandler.qbs
index 2bd9b70d38..9d0bd4524b 100644
--- a/src/tools/qtcreatorcrashhandler/qtcreatorcrashhandler.qbs
+++ b/src/tools/qtcreatorcrashhandler/qtcreatorcrashhandler.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcTool
QtcTool {
diff --git a/src/tools/qtpromaker/qtpromaker.qbs b/src/tools/qtpromaker/qtpromaker.qbs
index b23fb9f0ae..63d01368bc 100644
--- a/src/tools/qtpromaker/qtpromaker.qbs
+++ b/src/tools/qtpromaker/qtpromaker.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcTool
QtcTool {
diff --git a/src/tools/sdktool/getoperation.cpp b/src/tools/sdktool/getoperation.cpp
index 1899cefa1c..2beb77f9e5 100644
--- a/src/tools/sdktool/getoperation.cpp
+++ b/src/tools/sdktool/getoperation.cpp
@@ -69,9 +69,10 @@ int GetOperation::execute() const
foreach (const QString &key, m_keys) {
const QVariant result = get(map, key);
- if (result.isValid())
- return 2;
- std::cout << qPrintable(result.toString()) << std::endl;
+ if (!result.isValid())
+ std::cout << "<invalid>" << std::endl;
+ else
+ std::cout << qPrintable(result.toString()) << std::endl;
}
return 0;
diff --git a/src/tools/sdktool/sdktool.qbs b/src/tools/sdktool/sdktool.qbs
index a917b6fe4a..72d6188052 100644
--- a/src/tools/sdktool/sdktool.qbs
+++ b/src/tools/sdktool/sdktool.qbs
@@ -1,4 +1,4 @@
-import qbs.base 1.0
+import qbs 1.0
import QtcTool
QtcTool {