forked from qt-creator/qt-creator
ProjectExplorer: Copy more RunConfiguration data to RunControl
The aspects are now responsible for defining what data needs to be copied and also to provide a suitable interface (kind of source-compatible to direct use) for access. The important change here is that RunControl::aspect(...) doesn't need to access RunControl::runConfiguration() in fully aspectified RunConfigurations anymore. In not-fully aspectified the runConfig access is moved to the user code to make the problem visible there. Long term, aspectification should be finished. As an additional benefit, the resolving of macros etc can now be done at the correct time. Change-Id: I690d9f8f696ce9b4efd42082ba3f81b514efcb77 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -37,14 +37,14 @@
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <utils/layoutbuilder.h>
|
||||
#include <utils/mimeutils.h>
|
||||
|
||||
#include <QComboBox>
|
||||
|
||||
#include <utils/layoutbuilder.h>
|
||||
|
||||
using namespace Core;
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
namespace QmlProjectManager {
|
||||
|
||||
@@ -60,6 +60,9 @@ QmlMainFileAspect::QmlMainFileAspect(Target *target)
|
||||
: m_target(target)
|
||||
, m_scriptFile(M_CURRENT_FILE)
|
||||
{
|
||||
addDataExtractor(this, &QmlMainFileAspect::mainScript, &Data::mainScript);
|
||||
addDataExtractor(this, &QmlMainFileAspect::currentFile, &Data::currentFile);
|
||||
|
||||
connect(EditorManager::instance(), &EditorManager::currentEditorChanged,
|
||||
this, &QmlMainFileAspect::changeCurrentFile);
|
||||
connect(EditorManager::instance(), &EditorManager::currentDocumentStateChanged,
|
||||
|
||||
@@ -47,6 +47,7 @@ class QmlBuildSystem;
|
||||
class QMLPROJECTMANAGER_EXPORT QmlMainFileAspect : public Utils::BaseAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit QmlMainFileAspect(ProjectExplorer::Target *target);
|
||||
~QmlMainFileAspect() override;
|
||||
@@ -57,6 +58,12 @@ public:
|
||||
FileInSettings
|
||||
};
|
||||
|
||||
struct Data : BaseAspect::Data
|
||||
{
|
||||
QString mainScript;
|
||||
QString currentFile;
|
||||
};
|
||||
|
||||
void addToLayout(Utils::LayoutBuilder &builder) final;
|
||||
void toMap(QVariantMap &map) const final;
|
||||
void fromMap(const QVariantMap &map) final;
|
||||
@@ -74,7 +81,6 @@ public:
|
||||
QmlBuildSystem *qmlBuildSystem() const;
|
||||
|
||||
public:
|
||||
|
||||
ProjectExplorer::Target *m_target = nullptr;
|
||||
QPointer<QComboBox> m_fileListCombo;
|
||||
QStandardItemModel m_fileListModel;
|
||||
|
||||
Reference in New Issue
Block a user