summaryrefslogtreecommitdiffstats
path: root/src/interfaceframework/qifproxyserviceobject.cpp
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@qt.io>2022-10-25 16:23:31 +0200
committerDominik Holland <dominik.holland@qt.io>2022-12-07 11:28:38 +0100
commit5f8e923455d27ab910e468567a00a8e1eb8db42a (patch)
treef4b425dc7049fd7b8cd66f889424911617a8b5b8 /src/interfaceframework/qifproxyserviceobject.cpp
parentbbdf723ace753ccda30745ff8186a5156c42712a (diff)
Add a new QIfConfiguration class
This class provides a way to store and update settings for ServiceObjects, Features and the SimulationEngine. The configurationId of an Object decides to which configuration group it belongs. Default values for Configurations are loaded from a ini file and can be overridden using environment variables. This first commit adds the API for storing service settings. Those service settings are passed to the matching ServiceObjects. This can be used for backend specific settings e.g. a server url for the autogenerated remote objects backends. Fixes: QTBUG-99078 Task-number: QTBUG-99079 Task-number: QTBUG-99081 Change-Id: I814335af1944b87921ecde7873f035d71d183721 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
Diffstat (limited to 'src/interfaceframework/qifproxyserviceobject.cpp')
-rw-r--r--src/interfaceframework/qifproxyserviceobject.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/interfaceframework/qifproxyserviceobject.cpp b/src/interfaceframework/qifproxyserviceobject.cpp
index 7a27ee48..54b7b865 100644
--- a/src/interfaceframework/qifproxyserviceobject.cpp
+++ b/src/interfaceframework/qifproxyserviceobject.cpp
@@ -89,4 +89,35 @@ QIfFeatureInterface *QIfProxyServiceObject::interfaceInstance(const QString &int
return d->m_interfaceMap.value(interface);
}
+QString QIfProxyServiceObject::id() const
+{
+ Q_D(const QIfProxyServiceObject);
+ QString id;
+ if (d->m_serviceInterface)
+ id = d->m_serviceInterface->id();
+
+ if (id.isEmpty())
+ id = QIfServiceObject::id();
+ return id;
+}
+
+QString QIfProxyServiceObject::configurationId() const
+{
+ Q_D(const QIfProxyServiceObject);
+ if (d->m_serviceInterface)
+ return d->m_serviceInterface->configurationId();
+
+ return QIfServiceObject::configurationId();
+}
+
+void QIfProxyServiceObject::updateServiceSettings(const QVariantMap &settings)
+{
+ Q_D(const QIfProxyServiceObject);
+ if (d->m_serviceInterface)
+ d->m_serviceInterface->updateServiceSettings(settings);
+
+ //Always also call the base class to keep the property in sync
+ QIfServiceObject::updateServiceSettings(settings);
+}
+
QT_END_NAMESPACE