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,6 +36,7 @@
#include <projectexplorer/target.h>
#include <projectexplorer/toolchain.h>
#include <utils/algorithm.h>
#include <utils/qtcassert.h>
using namespace ProjectExplorer;

View File

@@ -126,7 +126,7 @@ private:
friend class CMakeProjectImporter;
};
class InitialCMakeArgumentsAspect final : public ProjectExplorer::StringAspect
class InitialCMakeArgumentsAspect final : public Utils::StringAspect
{
Q_OBJECT

View File

@@ -44,6 +44,7 @@
#include <utils/headerviewstretcher.h>
#include <utils/infolabel.h>
#include <utils/itemviews.h>
#include <utils/layoutbuilder.h>
#include <utils/progressindicator.h>
#include <utils/qtcassert.h>
@@ -54,6 +55,7 @@
#include <QMenu>
using namespace ProjectExplorer;
using namespace Utils;
namespace CMakeProjectManager {
namespace Internal {
@@ -100,7 +102,7 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
int row = 0;
auto buildDirAspect = bc->buildDirectoryAspect();
connect(buildDirAspect, &ProjectConfigurationAspect::changed, this, [this]() {
connect(buildDirAspect, &BaseAspect::changed, this, [this]() {
m_configModel->flush(); // clear out config cache...;
});
auto initialCMakeAspect = bc->aspect<InitialCMakeArgumentsAspect>();

View File

@@ -42,6 +42,7 @@
#include <projectexplorer/target.h>
#include <utils/algorithm.h>
#include <utils/layoutbuilder.h>
#include <QBoxLayout>
#include <QListWidget>

View File

@@ -28,9 +28,10 @@
#include <projectexplorer/abstractprocessstep.h>
#include <utils/treemodel.h>
namespace Utils { class CommandLine; }
namespace ProjectExplorer { class StringAspect; }
namespace Utils {
class CommandLine;
class StringAspect;
} // Utils
namespace CMakeProjectManager {
namespace Internal {
@@ -103,8 +104,8 @@ private:
friend class CMakeBuildStepConfigWidget;
QStringList m_buildTargets; // Convention: Empty string member signifies "Current executable"
ProjectExplorer::StringAspect *m_cmakeArguments = nullptr;
ProjectExplorer::StringAspect *m_toolArguments = nullptr;
Utils::StringAspect *m_cmakeArguments = nullptr;
Utils::StringAspect *m_toolArguments = nullptr;
bool m_waiting = false;
Utils::TreeModel<Utils::TreeItem, CMakeTargetItem> m_buildTargetModel;

View File

@@ -32,7 +32,6 @@
#include "cmaketoolmanager.h"
#include <coreplugin/icore.h>
#include <coreplugin/variablechooser.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorersettings.h>
@@ -49,6 +48,7 @@
#include <utils/environment.h>
#include <utils/macroexpander.h>
#include <utils/qtcassert.h>
#include <utils/variablechooser.h>
#include <QComboBox>
#include <QDialog>
@@ -877,7 +877,7 @@ private:
"You may provide a type hint by adding \":TYPE\" before the \"=\"."));
m_editor->setMinimumSize(800, 200);
auto chooser = new Core::VariableChooser(m_dialog);
auto chooser = new Utils::VariableChooser(m_dialog);
chooser->addSupportedWidget(m_editor);
chooser->addMacroExpanderProvider([this]() { return kit()->macroExpander(); });