Commit 21558fa5 authored by hjk's avatar hjk Committed by hjk

projectexplorer: remove useQmlDebugger from generic RunConfiguration

Change-Id: I9eb046348d4b56e64ffc2a2beb057d2fe090f8c3
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@nokia.com>
parent fbeeac56
...@@ -890,7 +890,7 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu ...@@ -890,7 +890,7 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu
if (runConfiguration->debuggerAspect()->useCppDebugger()) if (runConfiguration->debuggerAspect()->useCppDebugger())
sp.languages |= CppLanguage; sp.languages |= CppLanguage;
if (runConfiguration->useQmlDebugger()) { if (runConfiguration->debuggerAspect()->useQmlDebugger()) {
sp.qmlServerAddress = _("127.0.0.1"); sp.qmlServerAddress = _("127.0.0.1");
sp.qmlServerPort = runConfiguration->debuggerAspect()->qmlDebugServerPort(); sp.qmlServerPort = runConfiguration->debuggerAspect()->qmlDebugServerPort();
sp.languages |= QmlLanguage; sp.languages |= QmlLanguage;
......
...@@ -198,7 +198,8 @@ bool ProcessHandle::equals(const ProcessHandle &rhs) const ...@@ -198,7 +198,8 @@ bool ProcessHandle::equals(const ProcessHandle &rhs) const
\class ProjectExplorer::DebuggerProjectSettings \class ProjectExplorer::DebuggerProjectSettings
*/ */
DebuggerProjectSettings::DebuggerProjectSettings() : DebuggerProjectSettings::DebuggerProjectSettings(RunConfiguration *rc) :
m_runConfiguration(rc),
m_useCppDebugger(true), m_useCppDebugger(true),
m_useQmlDebugger(AutoEnableQmlDebugger), m_useQmlDebugger(AutoEnableQmlDebugger),
m_qmlDebugServerPort(Constants::QML_DEFAULT_DEBUG_SERVER_PORT), m_qmlDebugServerPort(Constants::QML_DEFAULT_DEBUG_SERVER_PORT),
...@@ -206,11 +207,17 @@ DebuggerProjectSettings::DebuggerProjectSettings() : ...@@ -206,11 +207,17 @@ DebuggerProjectSettings::DebuggerProjectSettings() :
{} {}
DebuggerProjectSettings::DebuggerProjectSettings(DebuggerProjectSettings *other) : DebuggerProjectSettings::DebuggerProjectSettings(DebuggerProjectSettings *other) :
m_runConfiguration(other->m_runConfiguration),
m_useCppDebugger(other->m_useCppDebugger), m_useCppDebugger(other->m_useCppDebugger),
m_useQmlDebugger(other->m_useQmlDebugger), m_useQmlDebugger(other->m_useQmlDebugger),
m_qmlDebugServerPort(other->m_qmlDebugServerPort) m_qmlDebugServerPort(other->m_qmlDebugServerPort)
{} {}
RunConfiguration *DebuggerProjectSettings::runConfiguration()
{
return m_runConfiguration;
}
void DebuggerProjectSettings::setUseQmlDebugger(bool value) void DebuggerProjectSettings::setUseQmlDebugger(bool value)
{ {
m_useQmlDebugger = value ? EnableQmlDebugger : DisableQmlDebugger; m_useQmlDebugger = value ? EnableQmlDebugger : DisableQmlDebugger;
...@@ -235,22 +242,21 @@ static bool isQtQuickAppProject(Project *project) ...@@ -235,22 +242,21 @@ static bool isQtQuickAppProject(Project *project)
return project->files(Project::ExcludeGeneratedFiles).contains(filePath); return project->files(Project::ExcludeGeneratedFiles).contains(filePath);
} }
DebuggerProjectSettings::QmlDebuggerStatus DebuggerProjectSettings::useQmlDebugger() const bool DebuggerProjectSettings::useQmlDebugger() const
{ {
return m_useQmlDebugger; if (m_useQmlDebugger == DebuggerProjectSettings::AutoEnableQmlDebugger)
return isQtQuickAppProject(m_runConfiguration->target()->project());
return m_useQmlDebugger == DebuggerProjectSettings::EnableQmlDebugger;
} }
bool RunConfiguration::useQmlDebugger() const uint DebuggerProjectSettings::qmlDebugServerPort() const
{ {
DebuggerProjectSettings::QmlDebuggerStatus s = m_debuggerAspect->useQmlDebugger(); return m_qmlDebugServerPort;
if (s == DebuggerProjectSettings::AutoEnableQmlDebugger)
return isQtQuickAppProject(target()->project());
return s == DebuggerProjectSettings::EnableQmlDebugger;
} }
uint DebuggerProjectSettings::qmlDebugServerPort() const void DebuggerProjectSettings::setQmllDebugServerPort(uint port)
{ {
return m_qmlDebugServerPort; m_qmlDebugServerPort = port;
} }
void DebuggerProjectSettings::suppressQmlDebuggingOptions() void DebuggerProjectSettings::suppressQmlDebuggingOptions()
...@@ -306,7 +312,7 @@ void DebuggerProjectSettings::fromMap(const QVariantMap &map) ...@@ -306,7 +312,7 @@ void DebuggerProjectSettings::fromMap(const QVariantMap &map)
RunConfiguration::RunConfiguration(Target *target, const QString &id) : RunConfiguration::RunConfiguration(Target *target, const QString &id) :
ProjectConfiguration(target, id), ProjectConfiguration(target, id),
m_debuggerAspect(new DebuggerProjectSettings) m_debuggerAspect(new DebuggerProjectSettings(this))
{ {
Q_ASSERT(target); Q_ASSERT(target);
addExtraAspects(); addExtraAspects();
......
...@@ -45,14 +45,14 @@ ...@@ -45,14 +45,14 @@
QT_FORWARD_DECLARE_CLASS(QIcon) QT_FORWARD_DECLARE_CLASS(QIcon)
namespace Utils { namespace Utils { class OutputFormatter; }
class OutputFormatter; namespace Debugger { namespace Internal { class DebuggerRunConfigWidget; } }
}
namespace ProjectExplorer { namespace ProjectExplorer {
class Abi; class Abi;
class BuildConfiguration; class BuildConfiguration;
class IRunConfigurationAspect; class DebuggerProjectSettings;
class RunConfiguration;
class RunControl; class RunControl;
class Target; class Target;
...@@ -93,7 +93,7 @@ class PROJECTEXPLORER_EXPORT DebuggerProjectSettings ...@@ -93,7 +93,7 @@ class PROJECTEXPLORER_EXPORT DebuggerProjectSettings
Q_OBJECT Q_OBJECT
public: public:
DebuggerProjectSettings(); DebuggerProjectSettings(RunConfiguration *runConfiguration);
DebuggerProjectSettings(DebuggerProjectSettings *other); DebuggerProjectSettings(DebuggerProjectSettings *other);
enum QmlDebuggerStatus { enum QmlDebuggerStatus {
...@@ -110,15 +110,20 @@ public: ...@@ -110,15 +110,20 @@ public:
void setUseQmlDebugger(bool value); void setUseQmlDebugger(bool value);
void setUseCppDebugger(bool value); void setUseCppDebugger(bool value);
bool useCppDebugger() const; bool useCppDebugger() const;
QmlDebuggerStatus useQmlDebugger() const; bool useQmlDebugger() const;
uint qmlDebugServerPort() const; uint qmlDebugServerPort() const;
void setQmllDebugServerPort(uint port);
void suppressQmlDebuggingOptions(); void suppressQmlDebuggingOptions();
bool areQmlDebuggingOptionsSuppressed() const; bool areQmlDebuggingOptionsSuppressed() const;
RunConfiguration *runConfiguration();
signals: signals:
void debuggersChanged(); void debuggersChanged();
public: private:
friend class RunConfiguration;
friend class Debugger::Internal::DebuggerRunConfigWidget;
RunConfiguration *m_runConfiguration;
bool m_useCppDebugger; bool m_useCppDebugger;
QmlDebuggerStatus m_useQmlDebugger; QmlDebuggerStatus m_useQmlDebugger;
uint m_qmlDebugServerPort; uint m_qmlDebugServerPort;
...@@ -126,7 +131,6 @@ public: ...@@ -126,7 +131,6 @@ public:
}; };
// Documentation inside. // Documentation inside.
class PROJECTEXPLORER_EXPORT RunConfiguration : public ProjectConfiguration class PROJECTEXPLORER_EXPORT RunConfiguration : public ProjectConfiguration
{ {
...@@ -162,7 +166,6 @@ public: ...@@ -162,7 +166,6 @@ public:
} }
virtual ProjectExplorer::Abi abi() const; virtual ProjectExplorer::Abi abi() const;
bool useQmlDebugger() const;
signals: signals:
void isEnabledChanged(bool value); void isEnabledChanged(bool value);
......
...@@ -216,7 +216,7 @@ RunControl *QmlProjectRunControlFactory::createDebugRunControl(QmlProjectRunConf ...@@ -216,7 +216,7 @@ RunControl *QmlProjectRunControlFactory::createDebugRunControl(QmlProjectRunConf
params.displayName = runConfig->displayName(); params.displayName = runConfig->displayName();
params.projectSourceDirectory = runConfig->target()->project()->projectDirectory(); params.projectSourceDirectory = runConfig->target()->project()->projectDirectory();
params.projectSourceFiles = runConfig->target()->project()->files(Project::ExcludeGeneratedFiles); params.projectSourceFiles = runConfig->target()->project()->files(Project::ExcludeGeneratedFiles);
if (runConfig->useQmlDebugger()) if (runConfig->debuggerAspect()->useQmlDebugger())
params.languages |= Debugger::QmlLanguage; params.languages |= Debugger::QmlLanguage;
if (runConfig->debuggerAspect()->useCppDebugger()) if (runConfig->debuggerAspect()->useCppDebugger())
params.languages |= Debugger::CppLanguage; params.languages |= Debugger::CppLanguage;
......
...@@ -84,7 +84,7 @@ static Debugger::DebuggerStartParameters s60DebuggerStartParams(const S60DeviceR ...@@ -84,7 +84,7 @@ static Debugger::DebuggerStartParameters s60DebuggerStartParams(const S60DeviceR
sp.remoteChannel = activeDeployConf->serialPortName(); sp.remoteChannel = activeDeployConf->serialPortName();
sp.processArgs = rc->commandLineArguments(); sp.processArgs = rc->commandLineArguments();
if (rc->useQmlDebugger() && !rc->debuggerAspect()->useCppDebugger()) { if (rc->debuggerAspect()->useQmlDebugger() && !rc->debuggerAspect()->useCppDebugger()) {
sp.requestRemoteSetup = true; sp.requestRemoteSetup = true;
sp.startMode = Debugger::AttachToRemoteServer; sp.startMode = Debugger::AttachToRemoteServer;
} else { } else {
...@@ -99,7 +99,7 @@ static Debugger::DebuggerStartParameters s60DebuggerStartParams(const S60DeviceR ...@@ -99,7 +99,7 @@ static Debugger::DebuggerStartParameters s60DebuggerStartParams(const S60DeviceR
sp.displayName = rc->displayName(); sp.displayName = rc->displayName();
sp.qmlServerAddress = activeDeployConf->deviceAddress(); sp.qmlServerAddress = activeDeployConf->deviceAddress();
sp.qmlServerPort = rc->debuggerAspect()->qmlDebugServerPort(); sp.qmlServerPort = rc->debuggerAspect()->qmlDebugServerPort();
if (rc->useQmlDebugger()) { if (rc->debuggerAspect()->useQmlDebugger()) {
sp.languages |= Debugger::QmlLanguage; sp.languages |= Debugger::QmlLanguage;
QString qmlArgs = rc->qmlCommandLineArguments(); QString qmlArgs = rc->qmlCommandLineArguments();
if (sp.processArgs.length()) if (sp.processArgs.length())
...@@ -162,7 +162,7 @@ bool S60DeviceDebugRunControl::promptToStop(bool *) const ...@@ -162,7 +162,7 @@ bool S60DeviceDebugRunControl::promptToStop(bool *) const
void S60DeviceDebugRunControl::remoteSetupRequested() void S60DeviceDebugRunControl::remoteSetupRequested()
{ {
// This is called from Engine->setupInferior(), ie InferiorSetupRequested state // This is called from Engine->setupInferior(), ie InferiorSetupRequested state
QTC_ASSERT(runConfiguration()->useQmlDebugger() && !runConfiguration()->debuggerAspect()->useCppDebugger(), return); QTC_CHECK(runConfiguration()->debuggerAspect()->useQmlDebugger() && !runConfiguration()->debuggerAspect()->useCppDebugger());
m_codaRunControl = new CodaRunControl(runConfiguration(), DebugRunMode); m_codaRunControl = new CodaRunControl(runConfiguration(), DebugRunMode);
connect(m_codaRunControl, SIGNAL(connected()), this, SLOT(codaConnected())); connect(m_codaRunControl, SIGNAL(connected()), this, SLOT(codaConnected()));
connect(m_codaRunControl, SIGNAL(finished()), this, SLOT(codaFinished())); connect(m_codaRunControl, SIGNAL(finished()), this, SLOT(codaFinished()));
......
...@@ -286,7 +286,7 @@ void S60DeviceRunConfiguration::setCommandLineArguments(const QString &args) ...@@ -286,7 +286,7 @@ void S60DeviceRunConfiguration::setCommandLineArguments(const QString &args)
QString S60DeviceRunConfiguration::qmlCommandLineArguments() const QString S60DeviceRunConfiguration::qmlCommandLineArguments() const
{ {
QString args; QString args;
if (useQmlDebugger()) { if (debuggerAspect()->useQmlDebugger()) {
const S60DeployConfiguration *activeDeployConf = const S60DeployConfiguration *activeDeployConf =
qobject_cast<S60DeployConfiguration *>(qt4Target()->activeDeployConfiguration()); qobject_cast<S60DeployConfiguration *>(qt4Target()->activeDeployConfiguration());
QTC_ASSERT(activeDeployConf, return args); QTC_ASSERT(activeDeployConf, return args);
......
...@@ -63,7 +63,7 @@ public: ...@@ -63,7 +63,7 @@ public:
AbstractRemoteLinuxDebugSupportPrivate(RemoteLinuxRunConfiguration *runConfig, AbstractRemoteLinuxDebugSupportPrivate(RemoteLinuxRunConfiguration *runConfig,
DebuggerEngine *engine) DebuggerEngine *engine)
: engine(engine), deviceConfig(runConfig->deviceConfig()), : engine(engine), deviceConfig(runConfig->deviceConfig()),
qmlDebugging(runConfig->useQmlDebugger()), qmlDebugging(runConfig->debuggerAspect()->useQmlDebugger()),
cppDebugging(runConfig->debuggerAspect()->useCppDebugger()), cppDebugging(runConfig->debuggerAspect()->useCppDebugger()),
state(Inactive), state(Inactive),
gdbServerPort(-1), qmlPort(-1) gdbServerPort(-1), qmlPort(-1)
...@@ -96,7 +96,7 @@ DebuggerStartParameters AbstractRemoteLinuxDebugSupport::startParameters(const R ...@@ -96,7 +96,7 @@ DebuggerStartParameters AbstractRemoteLinuxDebugSupport::startParameters(const R
{ {
DebuggerStartParameters params; DebuggerStartParameters params;
const LinuxDeviceConfiguration::ConstPtr &devConf = runConfig->deviceConfig(); const LinuxDeviceConfiguration::ConstPtr &devConf = runConfig->deviceConfig();
if (runConfig->useQmlDebugger()) { if (runConfig->debuggerAspect()->useQmlDebugger()) {
params.languages |= QmlLanguage; params.languages |= QmlLanguage;
params.qmlServerAddress = runConfig->deviceConfig()->sshParameters().host; params.qmlServerAddress = runConfig->deviceConfig()->sshParameters().host;
params.qmlServerPort = 0; // port is selected later on params.qmlServerPort = 0; // port is selected later on
......
...@@ -361,7 +361,7 @@ QString RemoteLinuxRunConfiguration::alternateRemoteExecutable() const ...@@ -361,7 +361,7 @@ QString RemoteLinuxRunConfiguration::alternateRemoteExecutable() const
int RemoteLinuxRunConfiguration::portsUsedByDebuggers() const int RemoteLinuxRunConfiguration::portsUsedByDebuggers() const
{ {
int ports = 0; int ports = 0;
if (useQmlDebugger()) if (debuggerAspect()->useQmlDebugger())
++ports; ++ports;
if (debuggerAspect()->useCppDebugger()) if (debuggerAspect()->useCppDebugger())
++ports; ++ports;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment