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