aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/ios/iosrunconfiguration.cpp
diff options
context:
space:
mode:
authorhjk <[email protected]>2022-04-11 11:09:46 +0200
committerhjk <[email protected]>2022-04-27 10:03:57 +0000
commit6e5415e95fa26ffbb94b061dbe5a25f145e9d7df (patch)
tree13fa63fed5e574ec0c580fad69a98e6bbacd470a /src/plugins/ios/iosrunconfiguration.cpp
parent5ed95d70888d36ac24e640b8d329dd924038d9a9 (diff)
Ios: Move runControl's runConfiguration calls further up
The data is now pulled out of the runconfig directly instead of relying on the indirection using the runconfig pointer inside RunControl. This is only barely better, but gets rid of one direct user of RunControl::runConfiguration(). Change-Id: If93576ba25ea9f3ddbeae2535217f5c2f361eaf6 Reviewed-by: Christian Stenger <[email protected]>
Diffstat (limited to 'src/plugins/ios/iosrunconfiguration.cpp')
-rw-r--r--src/plugins/ios/iosrunconfiguration.cpp45
1 files changed, 19 insertions, 26 deletions
diff --git a/src/plugins/ios/iosrunconfiguration.cpp b/src/plugins/ios/iosrunconfiguration.cpp
index 1198644a3ac..51a2288c492 100644
--- a/src/plugins/ios/iosrunconfiguration.cpp
+++ b/src/plugins/ios/iosrunconfiguration.cpp
@@ -53,7 +53,6 @@
#include <QLabel>
#include <QLineEdit>
#include <QList>
-#include <QStandardItemModel>
#include <QVariant>
#include <QWidget>
@@ -78,31 +77,6 @@ static IosDeviceType toIosDeviceType(const SimulatorInfo &device)
return iosDeviceType;
}
-class IosDeviceTypeAspect : public BaseAspect
-{
-public:
- IosDeviceTypeAspect(IosRunConfiguration *runConfiguration);
-
- void fromMap(const QVariantMap &map) override;
- void toMap(QVariantMap &map) const override;
- void addToLayout(LayoutBuilder &builder) override;
-
- IosDeviceType deviceType() const;
- void setDeviceType(const IosDeviceType &deviceType);
-
- void updateValues();
- void setDeviceTypeIndex(int devIndex);
- void deviceChanges();
- void updateDeviceType();
-
-public:
- IosDeviceType m_deviceType;
- IosRunConfiguration *m_runConfiguration = nullptr;
- QStandardItemModel m_deviceTypeModel;
- QLabel *m_deviceTypeLabel = nullptr;
- QComboBox *m_deviceTypeComboBox = nullptr;
-};
-
IosRunConfiguration::IosRunConfiguration(Target *target, Utils::Id id)
: RunConfiguration(target, id)
{
@@ -361,6 +335,11 @@ void IosDeviceTypeAspect::setDeviceType(const IosDeviceType &deviceType)
IosDeviceTypeAspect::IosDeviceTypeAspect(IosRunConfiguration *runConfiguration)
: m_runConfiguration(runConfiguration)
{
+ addDataExtractor(this, &IosDeviceTypeAspect::deviceType, &Data::deviceType);
+ addDataExtractor(this, &IosDeviceTypeAspect::bundleDirectory, &Data::bundleDirectory);
+ addDataExtractor(this, &IosDeviceTypeAspect::applicationName, &Data::applicationName);
+ addDataExtractor(this, &IosDeviceTypeAspect::localExecutable, &Data::localExecutable);
+
connect(DeviceManager::instance(), &DeviceManager::updated,
this, &IosDeviceTypeAspect::deviceChanges);
connect(KitManager::instance(), &KitManager::kitsChanged,
@@ -427,6 +406,20 @@ void IosDeviceTypeAspect::updateValues()
}
}
+FilePath IosDeviceTypeAspect::bundleDirectory() const
+{
+ return m_runConfiguration->bundleDirectory();
+}
+
+QString IosDeviceTypeAspect::applicationName() const
+{
+ return m_runConfiguration->applicationName();
+}
+
+FilePath IosDeviceTypeAspect::localExecutable() const
+{
+ return m_runConfiguration->localExecutable();
+}
// IosRunConfigurationFactory