Utils/ProjectExplorer: Move re-usabled bits of aspects to Utils

Classes involved are BaseAspect and some derived classes,
LayoutBuilder and VariableChooser.

This is mostly mechanical, with various include/using changes
to make it compile.

Change-Id: I624a457f3555f102e541c4c71e33a9423af32250
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2020-09-18 12:11:40 +02:00
parent 834cb8d114
commit cec468d78a
108 changed files with 751 additions and 621 deletions

View File

@@ -36,15 +36,15 @@
#include <QTextStream>
#include <QLoggingCategory>
using namespace QmakeProjectManager;
using namespace Internal;
using namespace ProjectExplorer;
using namespace Utils;;
using Utils::FilePath;
using Utils::QtcProcess;
using QtSupport::QtVersionManager;
using QtSupport::BaseQtVersion;
namespace QmakeProjectManager {
namespace Internal {
static QString findQMakeLine(const QString &makefile, const QString &key)
{
QFile fi(makefile);
@@ -396,6 +396,8 @@ void MakeFileParse::parseCommandLine(const QString &command, const QString &proj
}
}
} // Internal
} // QmakeProjectManager
// Unit tests:

View File

@@ -27,10 +27,11 @@
#include "qmakeprojectmanager_global.h"
#include <projectexplorer/projectconfigurationaspects.h>
#include <projectexplorer/buildconfiguration.h>
#include <qtsupport/baseqtversion.h>
#include <utils/aspects.h>
namespace ProjectExplorer { class FileNode; }
namespace QmakeProjectManager {
@@ -96,13 +97,13 @@ public:
static bool isBuildDirAtSafeLocation(const QString &sourceDir, const QString &buildDir);
bool isBuildDirAtSafeLocation() const;
ProjectExplorer::TriState separateDebugInfo() const;
Utils::TriState separateDebugInfo() const;
void forceSeparateDebugInfo(bool sepDebugInfo);
ProjectExplorer::TriState qmlDebugging() const;
Utils::TriState qmlDebugging() const;
void forceQmlDebugging(bool enable);
ProjectExplorer::TriState useQtQuickCompiler() const;
Utils::TriState useQtQuickCompiler() const;
void forceQtQuickCompiler(bool enable);
signals:

View File

@@ -33,7 +33,6 @@
#include "qmakesettings.h"
#include "qmakestep.h"
#include <coreplugin/variablechooser.h>
#include <projectexplorer/target.h>
#include <projectexplorer/toolchain.h>
#include <projectexplorer/buildsteplist.h>
@@ -43,7 +42,9 @@
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/xcodebuildparser.h>
#include <utils/qtcprocess.h>
#include <utils/variablechooser.h>
#include <QDir>
#include <QFileInfo>

View File

@@ -46,14 +46,15 @@
#include <coreplugin/icore.h>
#include <coreplugin/icontext.h>
#include <coreplugin/variablechooser.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtversionmanager.h>
#include <qtsupport/qtsupportconstants.h>
#include <utils/algorithm.h>
#include <utils/hostosinfo.h>
#include <utils/qtcprocess.h>
#include <utils/utilsicons.h>
#include <utils/variablechooser.h>
#include <QComboBox>
#include <QDir>
@@ -580,7 +581,8 @@ BuildStepConfigWidget *QMakeStep::createConfigWidget()
if (QmakeBuildConfiguration *bc = qmakeBuildConfiguration())
BuildManager::buildLists({bc->cleanSteps()});
});
auto chooser = new Core::VariableChooser(qmakeAdditonalArgumentsLineEdit);
auto chooser = new VariableChooser(qmakeAdditonalArgumentsLineEdit);
chooser->addMacroExpanderProvider([this] { return macroExpander(); });
chooser->addSupportedWidget(qmakeAdditonalArgumentsLineEdit);

View File

@@ -28,8 +28,8 @@
#include "qmakeprojectmanager_global.h"
#include <projectexplorer/abstractprocessstep.h>
#include <projectexplorer/projectconfigurationaspects.h>
#include <utils/aspects.h>
#include <utils/fileutils.h>
#include <memory>
@@ -83,9 +83,9 @@ public:
QString targetTriple;
TargetArchConfig archConfig = NoArch;
OsType osType = NoOsType;
ProjectExplorer::TriState separateDebugInfo;
ProjectExplorer::TriState linkQmlDebuggingQQ2;
ProjectExplorer::TriState useQtQuickCompiler;
Utils::TriState separateDebugInfo;
Utils::TriState linkQmlDebuggingQQ2;
Utils::TriState useQtQuickCompiler;
};
@@ -103,9 +103,9 @@ inline bool operator !=(const QMakeStepConfig &a, const QMakeStepConfig &b) {
inline QDebug operator<<(QDebug dbg, const QMakeStepConfig &c)
{
dbg << c.archConfig << c.osType
<< (c.linkQmlDebuggingQQ2 == ProjectExplorer::TriState::Enabled)
<< (c.useQtQuickCompiler == ProjectExplorer::TriState::Enabled)
<< (c.separateDebugInfo == ProjectExplorer::TriState::Enabled);
<< (c.linkQmlDebuggingQQ2 == Utils::TriState::Enabled)
<< (c.useQtQuickCompiler == Utils::TriState::Enabled)
<< (c.separateDebugInfo == Utils::TriState::Enabled);
return dbg;
}