Commit f3e1b6bb authored by Eike Ziller's avatar Eike Ziller

Merge remote-tracking branch 'origin/4.4'

Change-Id: Idfb9177bc09e4db0b5750832f119fa5e19d74c29
parents d522ec37 611f373d
...@@ -68,7 +68,7 @@ bool ProcessHandle::equals(const ProcessHandle &rhs) const ...@@ -68,7 +68,7 @@ bool ProcessHandle::equals(const ProcessHandle &rhs) const
return m_pid == rhs.m_pid; return m_pid == rhs.m_pid;
} }
#ifndef Q_OS_MACOS #ifndef Q_OS_OSX
bool ProcessHandle::activate() bool ProcessHandle::activate()
{ {
return false; return false;
......
...@@ -74,7 +74,6 @@ bool AndroidPlugin::initialize(const QStringList &arguments, QString *errorMessa ...@@ -74,7 +74,6 @@ bool AndroidPlugin::initialize(const QStringList &arguments, QString *errorMessa
RunControl::registerWorker<AndroidRunConfiguration, AndroidRunSupport>(NORMAL_RUN_MODE); RunControl::registerWorker<AndroidRunConfiguration, AndroidRunSupport>(NORMAL_RUN_MODE);
RunControl::registerWorker<AndroidRunConfiguration, AndroidDebugSupport>(DEBUG_RUN_MODE); RunControl::registerWorker<AndroidRunConfiguration, AndroidDebugSupport>(DEBUG_RUN_MODE);
RunControl::registerWorker<AndroidRunConfiguration, AndroidDebugSupport>(DEBUG_RUN_MODE_WITH_BREAK_ON_MAIN);
RunControl::registerWorker<AndroidRunConfiguration, AndroidQmlProfilerSupport>(QML_PROFILER_RUN_MODE); RunControl::registerWorker<AndroidRunConfiguration, AndroidQmlProfilerSupport>(QML_PROFILER_RUN_MODE);
new AndroidConfigurations(this); new AndroidConfigurations(this);
......
...@@ -280,9 +280,7 @@ AndroidRunnerWorker::AndroidRunnerWorker(RunControl *runControl, const AndroidRu ...@@ -280,9 +280,7 @@ AndroidRunnerWorker::AndroidRunnerWorker(RunControl *runControl, const AndroidRu
auto runConfig = runControl->runConfiguration(); auto runConfig = runControl->runConfiguration();
auto aspect = runConfig->extraAspect<Debugger::DebuggerRunConfigurationAspect>(); auto aspect = runConfig->extraAspect<Debugger::DebuggerRunConfigurationAspect>();
Core::Id runMode = runControl->runMode(); Core::Id runMode = runControl->runMode();
const bool debuggingMode = const bool debuggingMode = runMode == ProjectExplorer::Constants::DEBUG_RUN_MODE;
(runMode == ProjectExplorer::Constants::DEBUG_RUN_MODE
|| runMode == ProjectExplorer::Constants::DEBUG_RUN_MODE_WITH_BREAK_ON_MAIN);
m_useCppDebugger = debuggingMode && aspect->useCppDebugger(); m_useCppDebugger = debuggingMode && aspect->useCppDebugger();
if (debuggingMode && aspect->useQmlDebugger()) if (debuggingMode && aspect->useQmlDebugger())
m_qmlDebugServices = QmlDebug::QmlDebuggerServices; m_qmlDebugServices = QmlDebug::QmlDebuggerServices;
......
...@@ -374,13 +374,13 @@ void TestRunner::debugTests() ...@@ -374,13 +374,13 @@ void TestRunner::debugTests()
processOutput(outputreader, msg, format); processOutput(outputreader, msg, format);
}); });
connect(runControl, &ProjectExplorer::RunControl::finished, connect(runControl, &ProjectExplorer::RunControl::stopped,
outputreader, &QObject::deleteLater); outputreader, &QObject::deleteLater);
} }
connect(this, &TestRunner::requestStopTestRun, runControl, connect(this, &TestRunner::requestStopTestRun, runControl,
&ProjectExplorer::RunControl::initiateStop); &ProjectExplorer::RunControl::initiateStop);
connect(runControl, &ProjectExplorer::RunControl::finished, this, &TestRunner::onFinished); connect(runControl, &ProjectExplorer::RunControl::stopped, this, &TestRunner::onFinished);
ProjectExplorer::ProjectExplorerPlugin::startRunControl(runControl); ProjectExplorer::ProjectExplorerPlugin::startRunControl(runControl);
} }
......
...@@ -80,8 +80,6 @@ bool BareMetalPlugin::initialize(const QStringList &arguments, QString *errorStr ...@@ -80,8 +80,6 @@ bool BareMetalPlugin::initialize(const QStringList &arguments, QString *errorStr
(ProjectExplorer::Constants::NORMAL_RUN_MODE, constraint); (ProjectExplorer::Constants::NORMAL_RUN_MODE, constraint);
RunControl::registerWorker<BareMetalDebugSupport> RunControl::registerWorker<BareMetalDebugSupport>
(ProjectExplorer::Constants::DEBUG_RUN_MODE, constraint); (ProjectExplorer::Constants::DEBUG_RUN_MODE, constraint);
RunControl::registerWorker<BareMetalDebugSupport>
(ProjectExplorer::Constants::DEBUG_RUN_MODE_WITH_BREAK_ON_MAIN, constraint);
return true; return true;
} }
......
...@@ -143,6 +143,7 @@ ReadOnlyFilesDialog::ReadOnlyFilesDialog(const QList<QString> &fileNames, QWidge ...@@ -143,6 +143,7 @@ ReadOnlyFilesDialog::ReadOnlyFilesDialog(const QList<QString> &fileNames, QWidge
: QDialog(parent) : QDialog(parent)
, d(new ReadOnlyFilesDialogPrivate(this)) , d(new ReadOnlyFilesDialogPrivate(this))
{ {
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
d->initDialog(fileNames); d->initDialog(fileNames);
} }
......
...@@ -813,7 +813,8 @@ public: ...@@ -813,7 +813,8 @@ public:
void handleExecStep() void handleExecStep()
{ {
if (currentEngine()->state() == DebuggerNotReady) { if (currentEngine()->state() == DebuggerNotReady) {
ProjectExplorerPlugin::runStartupProject(ProjectExplorer::Constants::DEBUG_RUN_MODE_WITH_BREAK_ON_MAIN); DebuggerRunTool::setBreakOnMainNextTime();
ProjectExplorerPlugin::runStartupProject(ProjectExplorer::Constants::DEBUG_RUN_MODE);
} else { } else {
currentEngine()->resetLocation(); currentEngine()->resetLocation();
if (boolSetting(OperateByInstruction)) if (boolSetting(OperateByInstruction))
...@@ -826,7 +827,8 @@ public: ...@@ -826,7 +827,8 @@ public:
void handleExecNext() void handleExecNext()
{ {
if (currentEngine()->state() == DebuggerNotReady) { if (currentEngine()->state() == DebuggerNotReady) {
ProjectExplorerPlugin::runStartupProject(ProjectExplorer::Constants::DEBUG_RUN_MODE_WITH_BREAK_ON_MAIN); DebuggerRunTool::setBreakOnMainNextTime();
ProjectExplorerPlugin::runStartupProject(ProjectExplorer::Constants::DEBUG_RUN_MODE);
} else { } else {
currentEngine()->resetLocation(); currentEngine()->resetLocation();
if (boolSetting(OperateByInstruction)) if (boolSetting(OperateByInstruction))
...@@ -2079,7 +2081,7 @@ void DebuggerPluginPrivate::attachToUnstartedApplicationDialog() ...@@ -2079,7 +2081,7 @@ void DebuggerPluginPrivate::attachToUnstartedApplicationDialog()
return; return;
if (dlg->hideOnAttach()) if (dlg->hideOnAttach())
connect(rc, &RunControl::finished, dlg, &UnstartedAppWatcherDialog::startWatching); connect(rc, &RunControl::stopped, dlg, &UnstartedAppWatcherDialog::startWatching);
}); });
dlg->show(); dlg->show();
...@@ -2742,19 +2744,16 @@ void DebuggerPluginPrivate::updateDebugActions() ...@@ -2742,19 +2744,16 @@ void DebuggerPluginPrivate::updateDebugActions()
// Step into/next: Start and break at 'main' unless a debugger is running. // Step into/next: Start and break at 'main' unless a debugger is running.
if (m_snapshotHandler->currentIndex() < 0) { if (m_snapshotHandler->currentIndex() < 0) {
QString toolTip; m_stepAction->setEnabled(canRun);
const bool canRunAndBreakMain m_nextAction->setEnabled(canRun);
= ProjectExplorerPlugin::canRunStartupProject(ProjectExplorer::Constants::DEBUG_RUN_MODE_WITH_BREAK_ON_MAIN, &toolTip); if (canRun) {
m_stepAction->setEnabled(canRunAndBreakMain);
m_nextAction->setEnabled(canRunAndBreakMain);
if (canRunAndBreakMain) {
Project *project = SessionManager::startupProject(); Project *project = SessionManager::startupProject();
QTC_ASSERT(project, return); QTC_ASSERT(project, return);
toolTip = tr("Start \"%1\" and break at function \"main()\"") whyNot = tr("Start \"%1\" and break at function \"main()\"")
.arg(project->displayName()); .arg(project->displayName());
} }
m_stepAction->setToolTip(toolTip); m_stepAction->setToolTip(whyNot);
m_nextAction->setToolTip(toolTip); m_nextAction->setToolTip(whyNot);
} }
} }
...@@ -3064,8 +3063,6 @@ void DebuggerPluginPrivate::extensionsInitialized() ...@@ -3064,8 +3063,6 @@ void DebuggerPluginPrivate::extensionsInitialized()
RunControl::registerWorker<DebuggerRunTool> RunControl::registerWorker<DebuggerRunTool>
(ProjectExplorer::Constants::DEBUG_RUN_MODE, constraint); (ProjectExplorer::Constants::DEBUG_RUN_MODE, constraint);
RunControl::registerWorker<DebuggerRunTool>
(ProjectExplorer::Constants::DEBUG_RUN_MODE_WITH_BREAK_ON_MAIN, constraint);
} }
DebuggerEngine *currentEngine() DebuggerEngine *currentEngine()
......
...@@ -73,9 +73,6 @@ enum { debug = 0 }; ...@@ -73,9 +73,6 @@ enum { debug = 0 };
namespace Debugger { namespace Debugger {
namespace Internal { namespace Internal {
const auto DebugRunMode = ProjectExplorer::Constants::DEBUG_RUN_MODE;
const auto DebugRunModeWithBreakOnMain = ProjectExplorer::Constants::DEBUG_RUN_MODE_WITH_BREAK_ON_MAIN;
DebuggerEngine *createCdbEngine(QStringList *error, DebuggerStartMode sm); DebuggerEngine *createCdbEngine(QStringList *error, DebuggerStartMode sm);
DebuggerEngine *createGdbEngine(bool useTerminal, DebuggerStartMode sm); DebuggerEngine *createGdbEngine(bool useTerminal, DebuggerStartMode sm);
DebuggerEngine *createPdbEngine(); DebuggerEngine *createPdbEngine();
...@@ -86,6 +83,13 @@ DebuggerEngine *createLldbEngine(); ...@@ -86,6 +83,13 @@ DebuggerEngine *createLldbEngine();
} // namespace Internal } // namespace Internal
static bool breakOnMainNextTime = false;
void DebuggerRunTool::setBreakOnMainNextTime()
{
breakOnMainNextTime = true;
}
static QLatin1String engineTypeName(DebuggerEngineType et) static QLatin1String engineTypeName(DebuggerEngineType et)
{ {
switch (et) { switch (et) {
...@@ -272,7 +276,6 @@ static bool fixupParameters(DebuggerRunParameters &rp, RunControl *runControl, Q ...@@ -272,7 +276,6 @@ static bool fixupParameters(DebuggerRunParameters &rp, RunControl *runControl, Q
RunConfiguration *runConfig = runControl->runConfiguration(); RunConfiguration *runConfig = runControl->runConfiguration();
if (!runConfig) if (!runConfig)
return false; return false;
Core::Id runMode = runControl->runMode();
const Kit *kit = runConfig->target()->kit(); const Kit *kit = runConfig->target()->kit();
QTC_ASSERT(kit, return false); QTC_ASSERT(kit, return false);
...@@ -449,8 +452,10 @@ static bool fixupParameters(DebuggerRunParameters &rp, RunControl *runControl, Q ...@@ -449,8 +452,10 @@ static bool fixupParameters(DebuggerRunParameters &rp, RunControl *runControl, Q
if (rp.startMode == NoStartMode) if (rp.startMode == NoStartMode)
rp.startMode = StartInternal; rp.startMode = StartInternal;
if (runMode == DebugRunModeWithBreakOnMain) if (breakOnMainNextTime) {
rp.breakOnMain = true; rp.breakOnMain = true;
breakOnMainNextTime = false;
}
return true; return true;
} }
...@@ -634,7 +639,7 @@ RunControl *createAndScheduleRun(const DebuggerRunParameters &rp, Kit *kit) ...@@ -634,7 +639,7 @@ RunControl *createAndScheduleRun(const DebuggerRunParameters &rp, Kit *kit)
{ {
RunConfiguration *runConfig = dummyRunConfigForKit(kit); RunConfiguration *runConfig = dummyRunConfigForKit(kit);
QTC_ASSERT(runConfig, return nullptr); QTC_ASSERT(runConfig, return nullptr);
auto runControl = new RunControl(runConfig, DebugRunMode); auto runControl = new RunControl(runConfig, ProjectExplorer::Constants::DEBUG_RUN_MODE);
(void) new DebuggerRunTool(runControl, rp); (void) new DebuggerRunTool(runControl, rp);
ProjectExplorerPlugin::startRunControl(runControl); ProjectExplorerPlugin::startRunControl(runControl);
return runControl; return runControl;
......
...@@ -79,6 +79,8 @@ public: ...@@ -79,6 +79,8 @@ public:
void appendSolibSearchPath(const QString &str); void appendSolibSearchPath(const QString &str);
static void setBreakOnMainNextTime();
signals: signals:
void aboutToNotifyInferiorSetupOk(); void aboutToNotifyInferiorSetupOk();
......
...@@ -200,12 +200,16 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error) ...@@ -200,12 +200,16 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
action = new QAction(tr("Technical Support"), this); action = new QAction(tr("Technical Support"), this);
cmd = ActionManager::registerAction(action, "Help.TechSupport"); cmd = ActionManager::registerAction(action, "Help.TechSupport");
ActionManager::actionContainer(Core::Constants::M_HELP)->addAction(cmd, Core::Constants::G_HELP_SUPPORT); ActionManager::actionContainer(Core::Constants::M_HELP)->addAction(cmd, Core::Constants::G_HELP_SUPPORT);
connect(action, &QAction::triggered, this, &HelpPlugin::slotOpenSupportPage); connect(action, &QAction::triggered, this, [this] {
showLinkInHelpMode(QUrl("qthelp://org.qt-project.qtcreator/doc/technical-support.html"));
});
action = new QAction(tr("Report Bug..."), this); action = new QAction(tr("Report Bug..."), this);
cmd = ActionManager::registerAction(action, "Help.ReportBug"); cmd = ActionManager::registerAction(action, "Help.ReportBug");
ActionManager::actionContainer(Core::Constants::M_HELP)->addAction(cmd, Core::Constants::G_HELP_SUPPORT); ActionManager::actionContainer(Core::Constants::M_HELP)->addAction(cmd, Core::Constants::G_HELP_SUPPORT);
connect(action, &QAction::triggered, this, &HelpPlugin::slotReportBug); connect(action, &QAction::triggered, this, [] {
QDesktopServices::openUrl(QUrl("https://bugreports.qt.io"));
});
action = new QAction(tr("System Information..."), this); action = new QAction(tr("System Information..."), this);
cmd = ActionManager::registerAction(action, "Help.SystemInformation"); cmd = ActionManager::registerAction(action, "Help.SystemInformation");
...@@ -638,16 +642,6 @@ void HelpPlugin::handleHelpRequest(const QUrl &url, HelpManager::HelpViewerLocat ...@@ -638,16 +642,6 @@ void HelpPlugin::handleHelpRequest(const QUrl &url, HelpManager::HelpViewerLocat
ICore::raiseWindow(viewer); ICore::raiseWindow(viewer);
} }
void HelpPlugin::slotOpenSupportPage()
{
showLinkInHelpMode(QUrl("qthelp://org.qt-project.qtcreator/doc/technical-support.html"));
}
void HelpPlugin::slotReportBug()
{
QDesktopServices::openUrl(QUrl("https://bugreports.qt.io"));
}
class DialogClosingOnEscape : public QDialog class DialogClosingOnEscape : public QDialog
{ {
public: public:
......
...@@ -98,8 +98,6 @@ private: ...@@ -98,8 +98,6 @@ private:
void highlightSearchTermsInContextHelp(); void highlightSearchTermsInContextHelp();
void handleHelpRequest(const QUrl &url, Core::HelpManager::HelpViewerLocation location); void handleHelpRequest(const QUrl &url, Core::HelpManager::HelpViewerLocation location);
void slotOpenSupportPage();
void slotReportBug();
void slotSystemInformation(); void slotSystemInformation();
void resetFilter(); void resetFilter();
......
...@@ -56,6 +56,7 @@ TextBrowserHelpViewer::TextBrowserHelpViewer(QWidget *parent) ...@@ -56,6 +56,7 @@ TextBrowserHelpViewer::TextBrowserHelpViewer(QWidget *parent)
setLayout(layout); setLayout(layout);
layout->setContentsMargins(0, 0, 0, 0); layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(m_textBrowser, 10); layout->addWidget(m_textBrowser, 10);
setFocusProxy(m_textBrowser);
QPalette p = palette(); QPalette p = palette();
p.setColor(QPalette::Inactive, QPalette::Highlight, p.setColor(QPalette::Inactive, QPalette::Highlight,
p.color(QPalette::Active, QPalette::Highlight)); p.color(QPalette::Active, QPalette::Highlight));
......
...@@ -153,7 +153,6 @@ bool IosRunControlFactory::canRun(RunConfiguration *runConfiguration, ...@@ -153,7 +153,6 @@ bool IosRunControlFactory::canRun(RunConfiguration *runConfiguration,
{ {
if (mode != ProjectExplorer::Constants::NORMAL_RUN_MODE if (mode != ProjectExplorer::Constants::NORMAL_RUN_MODE
&& mode != ProjectExplorer::Constants::DEBUG_RUN_MODE && mode != ProjectExplorer::Constants::DEBUG_RUN_MODE
&& mode != ProjectExplorer::Constants::DEBUG_RUN_MODE_WITH_BREAK_ON_MAIN
&& mode != ProjectExplorer::Constants::QML_PROFILER_RUN_MODE) { && mode != ProjectExplorer::Constants::QML_PROFILER_RUN_MODE) {
return false; return false;
} }
......
...@@ -406,7 +406,7 @@ void AppOutputPane::createNewOutputWindow(RunControl *rc) ...@@ -406,7 +406,7 @@ void AppOutputPane::createNewOutputWindow(RunControl *rc)
this, &AppOutputPane::slotRunControlChanged); this, &AppOutputPane::slotRunControlChanged);
connect(rc, &RunControl::started, connect(rc, &RunControl::started,
this, &AppOutputPane::slotRunControlChanged); this, &AppOutputPane::slotRunControlChanged);
connect(rc, &RunControl::finished, connect(rc, &RunControl::stopped,
this, &AppOutputPane::slotRunControlFinished); this, &AppOutputPane::slotRunControlFinished);
connect(rc, &RunControl::applicationProcessHandleChanged, connect(rc, &RunControl::applicationProcessHandleChanged,
this, &AppOutputPane::enableDefaultButtons); this, &AppOutputPane::enableDefaultButtons);
......
...@@ -2059,8 +2059,7 @@ void ProjectExplorerPluginPrivate::startRunControl(RunControl *runControl) ...@@ -2059,8 +2059,7 @@ void ProjectExplorerPluginPrivate::startRunControl(RunControl *runControl)
m_outputPane->showTabFor(runControl); m_outputPane->showTabFor(runControl);
Core::Id runMode = runControl->runMode(); Core::Id runMode = runControl->runMode();
bool popup = (runMode == Constants::NORMAL_RUN_MODE && dd->m_projectExplorerSettings.showRunOutput) bool popup = (runMode == Constants::NORMAL_RUN_MODE && dd->m_projectExplorerSettings.showRunOutput)
|| ((runMode == Constants::DEBUG_RUN_MODE || runMode == Constants::DEBUG_RUN_MODE_WITH_BREAK_ON_MAIN) || (runMode == Constants::DEBUG_RUN_MODE && m_projectExplorerSettings.showDebugOutput);
&& m_projectExplorerSettings.showDebugOutput);
m_outputPane->setBehaviorOnOutput(runControl, popup ? AppOutputPane::Popup : AppOutputPane::Flash); m_outputPane->setBehaviorOnOutput(runControl, popup ? AppOutputPane::Popup : AppOutputPane::Flash);
runControl->initiateStart(); runControl->initiateStart();
emit m_instance->updateRunActions(); emit m_instance->updateRunActions();
......
...@@ -180,7 +180,6 @@ const char NORMAL_RUN_MODE[]="RunConfiguration.NormalRunMode"; ...@@ -180,7 +180,6 @@ const char NORMAL_RUN_MODE[]="RunConfiguration.NormalRunMode";
const char QML_PROFILER_RUN_MODE[]="RunConfiguration.QmlProfilerRunMode"; const char QML_PROFILER_RUN_MODE[]="RunConfiguration.QmlProfilerRunMode";
const char PERFPROFILER_RUN_MODE[]="PerfProfiler.RunMode"; const char PERFPROFILER_RUN_MODE[]="PerfProfiler.RunMode";
const char DEBUG_RUN_MODE[]="RunConfiguration.DebugRunMode"; const char DEBUG_RUN_MODE[]="RunConfiguration.DebugRunMode";
const char DEBUG_RUN_MODE_WITH_BREAK_ON_MAIN[]="RunConfiguration.DebugRunModeWithBreakOnMain";
// Navigation Widget // Navigation Widget
const char PROJECTTREE_ID[] = "Projects"; const char PROJECTTREE_ID[] = "Projects";
......
...@@ -1216,7 +1216,7 @@ void RunControlPrivate::setState(RunControlState newState) ...@@ -1216,7 +1216,7 @@ void RunControlPrivate::setState(RunControlState newState)
foreach (auto worker, m_workers) foreach (auto worker, m_workers)
if (worker) if (worker)
worker->onFinished(); worker->onFinished();
emit q->finished(); emit q->stopped();
break; break;
default: default:
break; break;
...@@ -1525,11 +1525,6 @@ void RunWorker::setStopTimeout(int ms) ...@@ -1525,11 +1525,6 @@ void RunWorker::setStopTimeout(int ms)
d->stopWatchdogInterval = ms; d->stopWatchdogInterval = ms;
} }
void RunWorker::reportData(int channel, const QVariant &data)
{
emit dataReported(channel, data);
}
void RunWorker::recordData(const QString &channel, const QVariant &data) void RunWorker::recordData(const QString &channel, const QVariant &data)
{ {
d->data[channel] = data; d->data[channel] = data;
......
...@@ -340,8 +340,6 @@ public: ...@@ -340,8 +340,6 @@ public:
void setStartTimeout(int ms); void setStartTimeout(int ms);
void setStopTimeout(int ms); void setStopTimeout(int ms);
void reportData(int channel, const QVariant &data);
void recordData(const QString &channel, const QVariant &data); void recordData(const QString &channel, const QVariant &data);
QVariant recordedData(const QString &channel) const; QVariant recordedData(const QString &channel) const;
...@@ -366,7 +364,6 @@ public: ...@@ -366,7 +364,6 @@ public:
static QString userMessageForProcessError(QProcess::ProcessError, const QString &programName); static QString userMessageForProcessError(QProcess::ProcessError, const QString &programName);
signals: signals:
void dataReported(int channel, const QVariant &data);
void started(); void started();
void stopped(); void stopped();
...@@ -481,7 +478,7 @@ signals: ...@@ -481,7 +478,7 @@ signals:
const QString &msg, Utils::OutputFormat format); const QString &msg, Utils::OutputFormat format);
void aboutToStart(); void aboutToStart();
void started(); void started();
void finished(); void stopped();
void applicationProcessHandleChanged(QPrivateSignal); // Use setApplicationProcessHandle void applicationProcessHandleChanged(QPrivateSignal); // Use setApplicationProcessHandle
private: private:
......
...@@ -55,7 +55,7 @@ WaitForStopDialog::WaitForStopDialog(QList<ProjectExplorer::RunControl *> runCon ...@@ -55,7 +55,7 @@ WaitForStopDialog::WaitForStopDialog(QList<ProjectExplorer::RunControl *> runCon
updateProgressText(); updateProgressText();
foreach (RunControl *rc, runControls) foreach (RunControl *rc, runControls)
connect(rc, &RunControl::finished, this, &WaitForStopDialog::runControlFinished); connect(rc, &RunControl::stopped, this, &WaitForStopDialog::runControlFinished);
m_timer.start(); m_timer.start();
} }
......
...@@ -28,7 +28,6 @@ SOURCES += \ ...@@ -28,7 +28,6 @@ SOURCES += \
qmlprofilerrangemodel.cpp \ qmlprofilerrangemodel.cpp \
qmlprofilerrunconfigurationaspect.cpp \ qmlprofilerrunconfigurationaspect.cpp \
qmlprofilerruncontrol.cpp \ qmlprofilerruncontrol.cpp \
qmlprofilerruncontrolfactory.cpp \
qmlprofilersettings.cpp \ qmlprofilersettings.cpp \
qmlprofilerstatemanager.cpp \ qmlprofilerstatemanager.cpp \
qmlprofilerstatewidget.cpp \ qmlprofilerstatewidget.cpp \
...@@ -72,7 +71,6 @@ HEADERS += \ ...@@ -72,7 +71,6 @@ HEADERS += \
qmlprofilerrangemodel.h \ qmlprofilerrangemodel.h \
qmlprofilerrunconfigurationaspect.h \ qmlprofilerrunconfigurationaspect.h \
qmlprofilerruncontrol.h \ qmlprofilerruncontrol.h \
qmlprofilerruncontrolfactory.h \
qmlprofilersettings.h \ qmlprofilersettings.h \
qmlprofilerstatemanager.h \ qmlprofilerstatemanager.h \
qmlprofilerstatewidget.h \ qmlprofilerstatewidget.h \
......
...@@ -45,7 +45,6 @@ QtcPlugin { ...@@ -45,7 +45,6 @@ QtcPlugin {
"qmlprofileroptionspage.cpp", "qmlprofileroptionspage.h", "qmlprofileroptionspage.cpp", "qmlprofileroptionspage.h",
"qmlprofilerplugin.cpp", "qmlprofilerplugin.h", "qmlprofilerplugin.cpp", "qmlprofilerplugin.h",
"qmlprofilerrunconfigurationaspect.cpp", "qmlprofilerrunconfigurationaspect.h", "qmlprofilerrunconfigurationaspect.cpp", "qmlprofilerrunconfigurationaspect.h",
"qmlprofilerruncontrolfactory.cpp", "qmlprofilerruncontrolfactory.h",
"qmlprofilerrangemodel.cpp", "qmlprofilerrangemodel.h", "qmlprofilerrangemodel.cpp", "qmlprofilerrangemodel.h",
"qmlprofilerruncontrol.cpp", "qmlprofilerruncontrol.h", "qmlprofilerruncontrol.cpp", "qmlprofilerruncontrol.h",
"qmlprofilersettings.cpp", "qmlprofilersettings.h", "qmlprofilersettings.cpp", "qmlprofilersettings.h",
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
****************************************************************************/ ****************************************************************************/
#include "qmlprofilerplugin.h" #include "qmlprofilerplugin.h"
#include "qmlprofilerruncontrolfactory.h" #include "qmlprofilerrunconfigurationaspect.h"
#include "qmlprofileroptionspage.h" #include "qmlprofileroptionspage.h"
#include "qmlprofilertool.h" #include "qmlprofilertool.h"
#include "qmlprofilertimelinemodel.h" #include "qmlprofilertimelinemodel.h"
...@@ -57,15 +57,34 @@ ...@@ -57,15 +57,34 @@
#endif // WITH_TESTS #endif // WITH_TESTS
#include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginmanager.h>
#include <projectexplorer/environmentaspect.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/runconfiguration.h>
#include <projectexplorer/target.h>
#include <utils/hostosinfo.h> #include <utils/hostosinfo.h>
#include <utils/qtcassert.h>
#include <QtPlugin> #include <QtPlugin>
using namespace ProjectExplorer;
namespace QmlProfiler { namespace QmlProfiler {
namespace Internal { namespace Internal {
Q_GLOBAL_STATIC(QmlProfilerSettings, qmlProfilerGlobalSettings) Q_GLOBAL_STATIC(QmlProfilerSettings, qmlProfilerGlobalSettings)
class QmlProfilerRunControlFactory : public IRunControlFactory
{
public:
IRunConfigurationAspect *createRunConfigurationAspect(RunConfiguration *rc) override
{
return new QmlProfilerRunConfigurationAspect(rc);
}
};
bool QmlProfilerPlugin::initialize(const QStringList &arguments, QString *errorString) bool QmlProfilerPlugin::initialize(const QStringList &arguments, QString *errorString)
{ {
Q_UNUSED(arguments) Q_UNUSED(arguments)
...@@ -80,8 +99,21 @@ void QmlProfilerPlugin::extensionsInitialized() ...@@ -80,8 +99,21 @@ void QmlProfilerPlugin::extensionsInitialized()
{ {
(void) new QmlProfilerTool(this); (void) new QmlProfilerTool(this);
addAutoReleasedObject(new QmlProfilerRunControlFactory()); addAutoReleasedObject(new QmlProfilerOptionsPage);
addAutoReleasedObject(new Internal::QmlProfilerOptionsPage()); addAutoReleasedObject(new QmlProfilerRunControlFactory);
auto constraint = [](RunConfiguration *runConfiguration) {
Target *target = runConfiguration ? runConfiguration->target() : nullptr;
Kit *kit = target ? target->kit() : nullptr;
return DeviceTypeKitInformation::deviceTypeId(kit)
== ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE;
};
RunControl::registerWorkerCreator(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE,
[this](RunControl *runControl) { return new QmlProfilerRunner(runControl); });
RunControl::registerWorker<LocalQmlProfilerSupport>
(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE, constraint);
} }
ExtensionSystem::IPlugin::ShutdownFlag QmlProfilerPlugin::aboutToShutdown() ExtensionSystem::IPlugin::ShutdownFlag QmlProfilerPlugin::aboutToShutdown()
......
/****************************************************************************
**
** Copyright (C) 2016 Kläralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#include "qmlprofilerruncontrolfactory.h"
#include "qmlprofilerruncontrol.h"
#include "qmlprofilerrunconfigurationaspect.h"
#include <projectexplorer/environmentaspect.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/target.h>
#include <utils/qtcassert.h>
using namespace ProjectExplorer;
namespace QmlProfiler {
namespace Internal {
static bool isLocal(RunConfiguration *runConfiguration)
{
Target *target = runConfiguration ? runConfiguration->target() : 0;
Kit *kit = target ? target->kit() : 0;
return DeviceTypeKitInformation::deviceTypeId(kit) == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE;
}
QmlProfilerRunControlFactory::QmlProfilerRunControlFactory(QObject *parent) :
IRunControlFactory(parent)
{
RunControl::registerWorkerCreator(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE,
[this](RunControl *runControl) { return new QmlProfilerRunner(runControl); });
}
bool QmlProfilerRunControlFactory::canRun(RunConfiguration *runConfiguration, Core::Id mode) const
{
return mode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE && isLocal(runConfiguration);
}
RunControl *QmlProfilerRunControlFactory::create(RunConfiguration *runConfiguration, Core::Id mode, QString *)
{
auto runControl = new RunControl(runConfiguration, mode);
(void) new LocalQmlProfilerSupport(runControl);
return runControl;
}
ProjectExplorer::IRunConfigurationAspect *
QmlProfilerRunControlFactory::createRunConfigurationAspect(ProjectExplorer::RunConfiguration *rc)
{
return new QmlProfilerRunConfigurationAspect(rc);
}