diff --git a/ground/src/plugins/coreplugin/iuavgadgetconfiguration.h b/ground/src/plugins/coreplugin/iuavgadgetconfiguration.h index 49aee2a74..f4f465b73 100644 --- a/ground/src/plugins/coreplugin/iuavgadgetconfiguration.h +++ b/ground/src/plugins/coreplugin/iuavgadgetconfiguration.h @@ -47,7 +47,7 @@ public: void setLocked(bool locked) { m_locked = locked; } virtual QByteArray saveState() const = 0; - virtual IUAVGadgetConfiguration *clone(QString name) = 0; + virtual IUAVGadgetConfiguration *clone() = 0; signals: diff --git a/ground/src/plugins/coreplugin/uavgadgetinstancemanager.cpp b/ground/src/plugins/coreplugin/uavgadgetinstancemanager.cpp index 088955381..1ac03da7a 100644 --- a/ground/src/plugins/coreplugin/uavgadgetinstancemanager.cpp +++ b/ground/src/plugins/coreplugin/uavgadgetinstancemanager.cpp @@ -198,7 +198,9 @@ void UAVGadgetInstanceManager::cloneConfiguration(IUAVGadgetConfiguration *conf { QString name = suggestName(configToClone->classId(), configToClone->name()); - IUAVGadgetConfiguration *config = configToClone->clone(name); + IUAVGadgetConfiguration *config = configToClone->clone(); + config->setName(name); + config->setProvisionalName(name); IUAVGadgetFactory *f = factory(config->classId()); IOptionsPage *p = f->createOptionsPage(config); IOptionsPage *page = new UAVGadgetOptionsPageDecorator(p, config); diff --git a/ground/src/plugins/map/mapgadgetconfiguration.cpp b/ground/src/plugins/map/mapgadgetconfiguration.cpp index 12e9a7d98..26419e4fa 100644 --- a/ground/src/plugins/map/mapgadgetconfiguration.cpp +++ b/ground/src/plugins/map/mapgadgetconfiguration.cpp @@ -47,11 +47,9 @@ MapGadgetConfiguration::MapGadgetConfiguration(QString classId, const QByteArray } } -IUAVGadgetConfiguration *MapGadgetConfiguration::clone(QString name) +IUAVGadgetConfiguration *MapGadgetConfiguration::clone() { MapGadgetConfiguration *m = new MapGadgetConfiguration(this->classId()); - m->setName(name); - m->setProvisionalName(name); m->m_defaultZoom = m_defaultZoom; m->m_defaultLatitude = m_defaultLatitude; m->m_defaultLongitude = m_defaultLongitude; diff --git a/ground/src/plugins/map/mapgadgetconfiguration.h b/ground/src/plugins/map/mapgadgetconfiguration.h index 00a890734..ae3bbef6c 100644 --- a/ground/src/plugins/map/mapgadgetconfiguration.h +++ b/ground/src/plugins/map/mapgadgetconfiguration.h @@ -44,7 +44,7 @@ public: double longitude() { return m_defaultLongitude; } void setLongitude(double lon) { m_defaultLongitude = lon; } QByteArray saveState() const; - IUAVGadgetConfiguration *clone(QString name); + IUAVGadgetConfiguration *clone(); signals: public slots: