diff options
author | Eike Ziller <eike.ziller@qt.io> | 2018-05-14 09:52:58 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2018-05-14 09:52:58 +0200 |
commit | e7123b140eb7e5d392542d087cdf5320336dec8a (patch) | |
tree | e4bb5d4d0461fcacb724c4f3f15c5843d16c982f /src | |
parent | f6d1d5b41e13600d5dd9ae0de80827f8ec57d44c (diff) | |
parent | 2278ebed1e0d290861a5616f4238eeec68607443 (diff) |
Merge remote-tracking branch 'origin/4.7'
Change-Id: I9d433fa6ce4f60a2acfbdb21da9f727cac8d7526
Diffstat (limited to 'src')
11 files changed, 54 insertions, 20 deletions
diff --git a/src/plugins/coreplugin/locator/commandlocator.cpp b/src/plugins/coreplugin/locator/commandlocator.cpp index 2768dca3a3..7546d0f9b0 100644 --- a/src/plugins/coreplugin/locator/commandlocator.cpp +++ b/src/plugins/coreplugin/locator/commandlocator.cpp @@ -31,6 +31,7 @@ #include <utils/stringutils.h> #include <QAction> +#include <QTimer> namespace Core { @@ -104,8 +105,11 @@ void CommandLocator::accept(LocatorFilterEntry entry, const int index = entry.internalData.toInt(); QTC_ASSERT(index >= 0 && index < d->commands.size(), return); QAction *action = d->commands.at(index)->action(); - QTC_ASSERT(action->isEnabled(), return); - action->trigger(); + // avoid nested stack trace and blocking locator by delayed triggering + QTimer::singleShot(0, action, [action] { + if (action->isEnabled()) + action->trigger(); + }); } void CommandLocator::refresh(QFutureInterface<void> &) diff --git a/src/plugins/coreplugin/menubarfilter.cpp b/src/plugins/coreplugin/menubarfilter.cpp index 029b8f2253..6a82d8676e 100644 --- a/src/plugins/coreplugin/menubarfilter.cpp +++ b/src/plugins/coreplugin/menubarfilter.cpp @@ -36,6 +36,7 @@ #include <QMenuBar> #include <QPointer> #include <QRegularExpression> +#include <QTimer> using namespace Core::Internal; using namespace Core; @@ -77,8 +78,12 @@ void MenuBarFilter::accept(LocatorFilterEntry selection, QString *newText, Q_UNUSED(newText); Q_UNUSED(selectionStart); Q_UNUSED(selectionLength); - if (auto action = selection.internalData.value<QPointer<QAction>>()) - action->trigger(); + if (auto action = selection.internalData.value<QPointer<QAction>>()) { + QTimer::singleShot(0, action, [action] { + if (action->isEnabled()) + action->trigger(); + }); + } } void MenuBarFilter::refresh(QFutureInterface<void> &future) diff --git a/src/plugins/cpptools/compileroptionsbuilder.cpp b/src/plugins/cpptools/compileroptionsbuilder.cpp index 57f937fb18..d6921b07ff 100644 --- a/src/plugins/cpptools/compileroptionsbuilder.cpp +++ b/src/plugins/cpptools/compileroptionsbuilder.cpp @@ -53,6 +53,11 @@ QStringList CompilerOptionsBuilder::build(CppTools::ProjectFile::Kind fileKind, { m_options.clear(); + if (fileKind == ProjectFile::CHeader || fileKind == ProjectFile::CSource) { + QTC_ASSERT(m_projectPart.languageVersion <= ProjectPart::LatestCVersion, + return QStringList();); + } + addWordWidth(); addTargetTriple(); addExtraCodeModelFlags(); @@ -118,7 +123,8 @@ void CompilerOptionsBuilder::addExtraCodeModelFlags() void CompilerOptionsBuilder::enableExceptions() { - add(QLatin1String("-fcxx-exceptions")); + if (m_projectPart.languageVersion > ProjectPart::LatestCVersion) + add(QLatin1String("-fcxx-exceptions")); add(QLatin1String("-fexceptions")); } @@ -286,6 +292,7 @@ void CompilerOptionsBuilder::addOptionsForLanguage(bool checkForBorlandExtension QStringList opts; const ProjectPart::LanguageExtensions languageExtensions = m_projectPart.languageExtensions; const bool gnuExtensions = languageExtensions & ProjectPart::GnuExtensions; + switch (m_projectPart.languageVersion) { case ProjectPart::C89: opts << (gnuExtensions ? QLatin1String("-std=gnu89") : QLatin1String("-std=c89")); @@ -471,8 +478,7 @@ QString CompilerOptionsBuilder::includeOption() const bool CompilerOptionsBuilder::excludeDefineDirective(const ProjectExplorer::Macro ¯o) const { - // This is a quick fix for QTCREATORBUG-11501. - // TODO: do a proper fix, see QTCREATORBUG-11709. + // TODO: Remove in QtCreator 4.7 if (macro.key == "__cplusplus") return true; diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 9f683f3ec8..f92b55d6ea 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1188,7 +1188,8 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it, if (!kit) kit = guessKitFromAbis(Abi::abisOfBinary(FileName::fromString(executable))); - auto runControl = new RunControl(nullptr, ProjectExplorer::Constants::DEBUG_RUN_MODE); + IDevice::ConstPtr device = DeviceKitInformation::device(kit); + auto runControl = new RunControl(device, ProjectExplorer::Constants::DEBUG_RUN_MODE); auto debugger = new DebuggerRunTool(runControl, kit); debugger->setInferiorExecutable(executable); if (pid) { @@ -1953,7 +1954,8 @@ void DebuggerPluginPrivate::attachCore() setConfigValue("LastExternalStartScript", dlg.overrideStartScript()); setConfigValue("LastForceLocalCoreFile", dlg.forcesLocalCoreFile()); - auto runControl = new RunControl(nullptr, ProjectExplorer::Constants::DEBUG_RUN_MODE); + IDevice::ConstPtr device = DeviceKitInformation::device(dlg.kit()); + auto runControl = new RunControl(device, ProjectExplorer::Constants::DEBUG_RUN_MODE); auto debugger = new DebuggerRunTool(runControl, dlg.kit()); debugger->setInferiorExecutable(dlg.localExecutableFile()); debugger->setCoreFileName(dlg.localCoreFile()); @@ -1980,7 +1982,8 @@ void DebuggerPluginPrivate::startRemoteCdbSession() return; setConfigValue(connectionKey, dlg.connection()); - auto runControl = new RunControl(nullptr, ProjectExplorer::Constants::DEBUG_RUN_MODE); + IDevice::ConstPtr device = DeviceKitInformation::device(kit); + auto runControl = new RunControl(device, ProjectExplorer::Constants::DEBUG_RUN_MODE); auto debugger = new DebuggerRunTool(runControl, kit); debugger->setStartMode(AttachToRemoteServer); debugger->setCloseMode(KillAtClose); @@ -2038,7 +2041,7 @@ void DebuggerPluginPrivate::attachToRunningApplication() if (device->type() == PE::DESKTOP_DEVICE_TYPE) { attachToRunningProcess(kit, process, false); } else { - auto runControl = new RunControl(nullptr, ProjectExplorer::Constants::DEBUG_RUN_MODE); + auto runControl = new RunControl(device, ProjectExplorer::Constants::DEBUG_RUN_MODE); auto debugger = new RemoteAttachRunner(runControl, kit, process.pid); debugger->startRunControl(); } diff --git a/src/plugins/projectexplorer/abstractmsvctoolchain.cpp b/src/plugins/projectexplorer/abstractmsvctoolchain.cpp index 12c5a15316..fd2948c458 100644 --- a/src/plugins/projectexplorer/abstractmsvctoolchain.cpp +++ b/src/plugins/projectexplorer/abstractmsvctoolchain.cpp @@ -133,15 +133,27 @@ ToolChain::CompilerFlags AbstractMsvcToolChain::compilerFlags(const QStringList if (cxxflags.contains(QLatin1String("/Za"))) flags &= ~MicrosoftExtensions; + bool cLanguage = (language() == ProjectExplorer::Constants::C_LANGUAGE_ID); + switch (m_abi.osFlavor()) { case Abi::WindowsMsvc2010Flavor: - case Abi::WindowsMsvc2012Flavor: flags |= StandardCxx11; + case Abi::WindowsMsvc2012Flavor: + if (cLanguage) + flags |= StandardC99; + else + flags |= StandardCxx11; break; case Abi::WindowsMsvc2013Flavor: - case Abi::WindowsMsvc2015Flavor: flags |= StandardCxx14; + case Abi::WindowsMsvc2015Flavor: + if (cLanguage) + flags |= StandardC99; + else + flags |= StandardCxx14; break; case Abi::WindowsMsvc2017Flavor: - if (cxxflags.contains("/std:c++17") || cxxflags.contains("/std:c++latest")) + if (cLanguage) + flags |= StandardC11; + else if (cxxflags.contains("/std:c++17") || cxxflags.contains("/std:c++latest")) flags |= StandardCxx17; else flags |= StandardCxx14; diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index a77478a52c..c29e1807e6 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -921,6 +921,12 @@ RunControl::RunControl(RunConfiguration *runConfiguration, Core::Id mode) : #endif } +RunControl::RunControl(const IDevice::ConstPtr &device, Core::Id mode) + : RunControl(nullptr, mode) +{ + d->device = device; +} + RunControl::~RunControl() { #ifdef WITH_JOURNALD diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index 8a918a9773..292ac59d2e 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -461,6 +461,7 @@ class PROJECTEXPLORER_EXPORT RunControl : public QObject public: RunControl(RunConfiguration *runConfiguration, Core::Id mode); + RunControl(const IDevice::ConstPtr &device, Core::Id mode); ~RunControl() override; void initiateStart(); diff --git a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp index ce2b764d3b..d80a64fb4b 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp @@ -109,6 +109,8 @@ void QbsBuildConfiguration::initialize(const BuildInfo *info) BuildStepList *buildSteps = stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD); auto bs = new QbsBuildStep(buildSteps); + if (info->buildType == Release) + bs->setQmlDebuggingEnabled(false); bs->setQbsConfiguration(bd); buildSteps->appendStep(bs); diff --git a/src/plugins/qmldesigner/componentsplugin/componentsplugin.h b/src/plugins/qmldesigner/componentsplugin/componentsplugin.h index 1f43ada810..30e0cc5aa1 100644 --- a/src/plugins/qmldesigner/componentsplugin/componentsplugin.h +++ b/src/plugins/qmldesigner/componentsplugin/componentsplugin.h @@ -35,9 +35,7 @@ namespace QmlDesigner { class ComponentsPlugin : public QObject, QmlDesigner::IWidgetPlugin { Q_OBJECT -#if QT_VERSION >= 0x050000 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QmlDesignerPlugin" FILE "componentsplugin.json") -#endif Q_DISABLE_COPY(ComponentsPlugin) Q_INTERFACES(QmlDesigner::IWidgetPlugin) public: diff --git a/src/plugins/qmldesigner/qtquickplugin/qtquickplugin.h b/src/plugins/qmldesigner/qtquickplugin/qtquickplugin.h index 08dc48a450..831c8f65e7 100644 --- a/src/plugins/qmldesigner/qtquickplugin/qtquickplugin.h +++ b/src/plugins/qmldesigner/qtquickplugin/qtquickplugin.h @@ -35,9 +35,7 @@ namespace QmlDesigner { class QtQuickPlugin : public QObject, QmlDesigner::IWidgetPlugin { Q_OBJECT -#if QT_VERSION >= 0x050000 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QmlDesignerPlugin" FILE "qtquickplugin.json") -#endif Q_DISABLE_COPY(QtQuickPlugin) Q_INTERFACES(QmlDesigner::IWidgetPlugin) public: diff --git a/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp b/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp index 867b95273b..6192f17bf4 100644 --- a/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp @@ -577,9 +577,8 @@ QVariant QmlProfilerStatisticsRelativesModel::dataForMainEntry(qint64 totalDurat case RelativeCallCount: return 1; case RelativeDetails: return tr("Main Program"); } - default: - return QVariant(); } + return QVariant(); } QVariant QmlProfilerStatisticsRelativesModel::data(const QModelIndex &index, int role) const |