forked from qt-creator/qt-creator
ProjectExplorer: Use full class for TriState value
Allows more compact code on the user side in most cases and can hide the internal 'int-ness' from user code by wrapping Variant conversions in the TriState class itself. Change-Id: I4c91e0cd798ee988a0b9cb057749251a4efebaff Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -38,10 +38,10 @@
|
||||
|
||||
using namespace QmakeProjectManager;
|
||||
using namespace Internal;
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
using Utils::FilePath;
|
||||
using Utils::QtcProcess;
|
||||
using ProjectExplorer::BaseTriStateAspect;
|
||||
using QtSupport::QtVersionManager;
|
||||
using QtSupport::BaseQtVersion;
|
||||
|
||||
@@ -192,14 +192,14 @@ void MakeFileParse::parseAssignments(QList<QMakeAssignment> *assignments)
|
||||
m_config.osType = QMakeStepConfig::NoOsType;
|
||||
} else if (value == QLatin1String("qml_debug")) {
|
||||
if (qa.op == QLatin1String("+="))
|
||||
m_config.linkQmlDebuggingQQ2 = BaseTriStateAspect::Value::Enabled;
|
||||
m_config.linkQmlDebuggingQQ2 = TriState::Enabled;
|
||||
else
|
||||
m_config.linkQmlDebuggingQQ2 = BaseTriStateAspect::Value::Disabled;
|
||||
m_config.linkQmlDebuggingQQ2 = TriState::Disabled;
|
||||
} else if (value == QLatin1String("qtquickcompiler")) {
|
||||
if (qa.op == QLatin1String("+="))
|
||||
m_config.useQtQuickCompiler = BaseTriStateAspect::Value::Enabled;
|
||||
m_config.useQtQuickCompiler = TriState::Enabled;
|
||||
else
|
||||
m_config.useQtQuickCompiler = BaseTriStateAspect::Value::Disabled;
|
||||
m_config.useQtQuickCompiler = TriState::Disabled;
|
||||
} else if (value == QLatin1String("force_debug_info")) {
|
||||
if (qa.op == QLatin1String("+="))
|
||||
foundForceDebugInfo = true;
|
||||
@@ -225,7 +225,7 @@ void MakeFileParse::parseAssignments(QList<QMakeAssignment> *assignments)
|
||||
}
|
||||
|
||||
if (foundForceDebugInfo && foundSeparateDebugInfo) {
|
||||
m_config.separateDebugInfo = ProjectExplorer::BaseTriStateAspect::Value::Enabled;
|
||||
m_config.separateDebugInfo = TriState::Enabled;
|
||||
} else if (foundForceDebugInfo) {
|
||||
// Found only force_debug_info, so readd it
|
||||
QMakeAssignment newQA;
|
||||
@@ -376,11 +376,11 @@ void MakeFileParse::parseCommandLine(const QString &command, const QString &proj
|
||||
qCDebug(logging()) << " TargetArch" << m_config.archConfig;
|
||||
qCDebug(logging()) << " OsType" << m_config.osType;
|
||||
qCDebug(logging()) << " LinkQmlDebuggingQQ2"
|
||||
<< (m_config.linkQmlDebuggingQQ2 == BaseTriStateAspect::Value::Enabled);
|
||||
<< (m_config.linkQmlDebuggingQQ2 == TriState::Enabled);
|
||||
qCDebug(logging()) << " Qt Quick Compiler"
|
||||
<< (m_config.useQtQuickCompiler == BaseTriStateAspect::Value::Enabled);
|
||||
<< (m_config.useQtQuickCompiler == TriState::Enabled);
|
||||
qCDebug(logging()) << " Separate Debug Info"
|
||||
<< (m_config.separateDebugInfo == BaseTriStateAspect::Value::Enabled);
|
||||
<< (m_config.separateDebugInfo == TriState::Enabled);
|
||||
|
||||
// Create command line of all unfiltered arguments
|
||||
foreach (const QMakeAssignment &qa, assignments)
|
||||
@@ -525,8 +525,8 @@ void QmakeProjectManagerPlugin::testMakefileParser()
|
||||
const QMakeStepConfig qmsc = parser.config();
|
||||
QCOMPARE(qmsc.archConfig, static_cast<QMakeStepConfig::TargetArchConfig>(archConfig));
|
||||
QCOMPARE(qmsc.osType, static_cast<QMakeStepConfig::OsType>(osType));
|
||||
QCOMPARE(qmsc.linkQmlDebuggingQQ2 == BaseTriStateAspect::Value::Enabled, linkQmlDebuggingQQ2);
|
||||
QCOMPARE(qmsc.useQtQuickCompiler == BaseTriStateAspect::Value::Enabled, useQtQuickCompiler);
|
||||
QCOMPARE(qmsc.separateDebugInfo == BaseTriStateAspect::Value::Enabled, separateDebugInfo);
|
||||
QCOMPARE(qmsc.linkQmlDebuggingQQ2 == TriState::Enabled, linkQmlDebuggingQQ2);
|
||||
QCOMPARE(qmsc.useQtQuickCompiler == TriState::Enabled, useQtQuickCompiler);
|
||||
QCOMPARE(qmsc.separateDebugInfo == TriState::Enabled, separateDebugInfo);
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user