forked from qt-creator/qt-creator
DebuggerAspect: Simplify handling of Qml debugging
There should not be a need to have the linkQmlDebuggingLibrary Q_PROPERTY anymore. The property is added for the benefit of the DebuggerAspect, which can just check relevant BuildConfigurationAspect directly. Change-Id: Ic47ca9e26911e096564fe77bd14bebe959b4f116 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -195,12 +195,6 @@ bool CMakeBuildConfiguration::fromMap(const QVariantMap &map)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
FilePath CMakeBuildConfiguration::shadowBuildDirectory(const FilePath &projectFilePath,
|
FilePath CMakeBuildConfiguration::shadowBuildDirectory(const FilePath &projectFilePath,
|
||||||
const Kit *k,
|
const Kit *k,
|
||||||
const QString &bcName,
|
const QString &bcName,
|
||||||
@@ -382,12 +376,6 @@ void CMakeBuildConfiguration::setWarning(const QString &message)
|
|||||||
emit warningOccured(m_warning);
|
emit warningOccured(m_warning);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CMakeBuildConfiguration::isQmlDebuggingEnabled() const
|
|
||||||
{
|
|
||||||
return aspect<QtSupport::QmlDebuggingAspect>()->setting() == TriState::Enabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
QString CMakeBuildConfiguration::error() const
|
QString CMakeBuildConfiguration::error() const
|
||||||
{
|
{
|
||||||
return m_error;
|
return m_error;
|
||||||
|
@@ -46,11 +46,6 @@ class CMakeBuildConfiguration final : public ProjectExplorer::BuildConfiguration
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
// used in DebuggerRunConfigurationAspect
|
|
||||||
Q_PROPERTY(bool linkQmlDebuggingLibrary
|
|
||||||
READ isQmlDebuggingEnabled
|
|
||||||
NOTIFY configurationForCMakeChanged)
|
|
||||||
|
|
||||||
friend class ProjectExplorer::BuildConfigurationFactory;
|
friend class ProjectExplorer::BuildConfigurationFactory;
|
||||||
CMakeBuildConfiguration(ProjectExplorer::Target *target, Core::Id id);
|
CMakeBuildConfiguration(ProjectExplorer::Target *target, Core::Id id);
|
||||||
~CMakeBuildConfiguration() final;
|
~CMakeBuildConfiguration() final;
|
||||||
@@ -96,8 +91,6 @@ private:
|
|||||||
void setError(const QString &message);
|
void setError(const QString &message);
|
||||||
void setWarning(const QString &message);
|
void setWarning(const QString &message);
|
||||||
|
|
||||||
bool isQmlDebuggingEnabled() const;
|
|
||||||
|
|
||||||
CMakeConfig m_configurationForCMake;
|
CMakeConfig m_configurationForCMake;
|
||||||
CMakeConfig m_initialConfiguration;
|
CMakeConfig m_initialConfiguration;
|
||||||
QString m_error;
|
QString m_error;
|
||||||
|
@@ -27,17 +27,18 @@
|
|||||||
|
|
||||||
#include "debuggerconstants.h"
|
#include "debuggerconstants.h"
|
||||||
|
|
||||||
|
#include <coreplugin/helpmanager.h>
|
||||||
#include <coreplugin/icontext.h>
|
#include <coreplugin/icontext.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/helpmanager.h>
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
|
#include <projectexplorer/buildstep.h>
|
||||||
|
#include <projectexplorer/buildsteplist.h>
|
||||||
#include <projectexplorer/kitinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/runconfiguration.h>
|
#include <projectexplorer/runconfiguration.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <projectexplorer/buildconfiguration.h>
|
#include <qtsupport/qtbuildaspects.h>
|
||||||
#include <projectexplorer/buildstep.h>
|
|
||||||
#include <projectexplorer/buildsteplist.h>
|
|
||||||
|
|
||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
@@ -242,12 +243,9 @@ bool DebuggerRunConfigurationAspect::useQmlDebugger() const
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Try to find a build configuration to check whether qml debugging is enabled there
|
// Try to find a build configuration to check whether qml debugging is enabled there
|
||||||
// (Using the Qt metatype system to avoid a hard build system dependency)
|
|
||||||
//
|
|
||||||
if (BuildConfiguration *bc = m_target->activeBuildConfiguration()) {
|
if (BuildConfiguration *bc = m_target->activeBuildConfiguration()) {
|
||||||
const QVariant linkProperty = bc->property("linkQmlDebuggingLibrary");
|
const auto aspect = bc->aspect<QtSupport::QmlDebuggingAspect>();
|
||||||
if (linkProperty.isValid() && linkProperty.canConvert(QVariant::Bool))
|
return aspect && aspect->setting() == TriState::Enabled;
|
||||||
return linkProperty.toBool();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return !languages.contains(ProjectExplorer::Constants::CXX_LANGUAGE_ID);
|
return !languages.contains(ProjectExplorer::Constants::CXX_LANGUAGE_ID);
|
||||||
|
@@ -311,11 +311,6 @@ QString QbsBuildConfiguration::equivalentCommandLine(const QbsBuildStepData &ste
|
|||||||
return commandLine.arguments();
|
return commandLine.arguments();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QbsBuildConfiguration::isQmlDebuggingEnabled() const
|
|
||||||
{
|
|
||||||
return qmlDebuggingSetting() == TriState::Enabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
TriState QbsBuildConfiguration::qmlDebuggingSetting() const
|
TriState QbsBuildConfiguration::qmlDebuggingSetting() const
|
||||||
{
|
{
|
||||||
return aspect<QtSupport::QmlDebuggingAspect>()->setting();
|
return aspect<QtSupport::QmlDebuggingAspect>()->setting();
|
||||||
|
@@ -61,11 +61,6 @@ class QbsBuildConfiguration final : public ProjectExplorer::BuildConfiguration
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
// used in DebuggerRunConfigurationAspect
|
|
||||||
Q_PROPERTY(bool linkQmlDebuggingLibrary
|
|
||||||
READ isQmlDebuggingEnabled
|
|
||||||
NOTIFY qbsConfigurationChanged)
|
|
||||||
|
|
||||||
friend class ProjectExplorer::BuildConfigurationFactory;
|
friend class ProjectExplorer::BuildConfigurationFactory;
|
||||||
QbsBuildConfiguration(ProjectExplorer::Target *target, Core::Id id);
|
QbsBuildConfiguration(ProjectExplorer::Target *target, Core::Id id);
|
||||||
~QbsBuildConfiguration() final;
|
~QbsBuildConfiguration() final;
|
||||||
@@ -90,7 +85,6 @@ public:
|
|||||||
QString configurationName() const;
|
QString configurationName() const;
|
||||||
QString equivalentCommandLine(const QbsBuildStepData &stepData) const;
|
QString equivalentCommandLine(const QbsBuildStepData &stepData) const;
|
||||||
|
|
||||||
bool isQmlDebuggingEnabled() const;
|
|
||||||
ProjectExplorer::TriState qmlDebuggingSetting() const;
|
ProjectExplorer::TriState qmlDebuggingSetting() const;
|
||||||
ProjectExplorer::TriState qtQuickCompilerSetting() const;
|
ProjectExplorer::TriState qtQuickCompilerSetting() const;
|
||||||
ProjectExplorer::TriState separateDebugInfoSetting() const;
|
ProjectExplorer::TriState separateDebugInfoSetting() const;
|
||||||
|
@@ -427,11 +427,6 @@ TriState QmakeBuildConfiguration::qmlDebugging() const
|
|||||||
return aspect<QmlDebuggingAspect>()->setting();
|
return aspect<QmlDebuggingAspect>()->setting();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QmakeBuildConfiguration::linkQmlDebuggingLibrary() const
|
|
||||||
{
|
|
||||||
return qmlDebugging() == TriState::Enabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QmakeBuildConfiguration::forceQmlDebugging(bool enable)
|
void QmakeBuildConfiguration::forceQmlDebugging(bool enable)
|
||||||
{
|
{
|
||||||
aspect<QmlDebuggingAspect>()->setSetting(enable ? TriState::Enabled : TriState::Disabled);
|
aspect<QmlDebuggingAspect>()->setSetting(enable ? TriState::Enabled : TriState::Disabled);
|
||||||
|
@@ -44,9 +44,6 @@ class QMAKEPROJECTMANAGER_EXPORT QmakeBuildConfiguration : public ProjectExplore
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
// used in DebuggerRunConfigurationAspect
|
|
||||||
Q_PROPERTY(bool linkQmlDebuggingLibrary READ linkQmlDebuggingLibrary NOTIFY qmlDebuggingChanged)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QmakeBuildConfiguration(ProjectExplorer::Target *target, Core::Id id);
|
QmakeBuildConfiguration(ProjectExplorer::Target *target, Core::Id id);
|
||||||
~QmakeBuildConfiguration() override;
|
~QmakeBuildConfiguration() override;
|
||||||
@@ -103,7 +100,6 @@ public:
|
|||||||
void forceSeparateDebugInfo(bool sepDebugInfo);
|
void forceSeparateDebugInfo(bool sepDebugInfo);
|
||||||
|
|
||||||
ProjectExplorer::TriState qmlDebugging() const;
|
ProjectExplorer::TriState qmlDebugging() const;
|
||||||
bool linkQmlDebuggingLibrary() const;
|
|
||||||
void forceQmlDebugging(bool enable);
|
void forceQmlDebugging(bool enable);
|
||||||
|
|
||||||
ProjectExplorer::TriState useQtQuickCompiler() const;
|
ProjectExplorer::TriState useQtQuickCompiler() const;
|
||||||
|
Reference in New Issue
Block a user