diff --git a/GUI/Model/Device/InstrumentItems.cpp b/GUI/Model/Device/InstrumentItems.cpp index a5f12b514c637fbda7f8971bc00e450e62bb2bf3..f5ede570f87a5a1b953e3db7d56ed102a9426fd8 100644 --- a/GUI/Model/Device/InstrumentItems.cpp +++ b/GUI/Model/Device/InstrumentItems.cpp @@ -109,7 +109,7 @@ InstrumentItem::InstrumentItem() InstrumentItem::~InstrumentItem() = default; -InstrumentItem* InstrumentItem::createItemCopy() const +InstrumentItem* InstrumentItem::clone() const { const auto type = InstrumentsCatalog::type(this); auto* copy = InstrumentsCatalog::create(type); diff --git a/GUI/Model/Device/InstrumentItems.h b/GUI/Model/Device/InstrumentItems.h index 83ee21087ed9815a0f7862e8d0902447091f2ef3..5b05bd14cc4704643986341b38b4f6749a2016f2 100644 --- a/GUI/Model/Device/InstrumentItems.h +++ b/GUI/Model/Device/InstrumentItems.h @@ -60,7 +60,7 @@ public: virtual void readFrom(QXmlStreamReader* r); //! Creates an exact copy; also ID is the same! - InstrumentItem* createItemCopy() const; + InstrumentItem* clone() const; QString id() const { return m_id; } void setId(const QString& id) { m_id = id; } diff --git a/GUI/Model/Job/JobItem.cpp b/GUI/Model/Job/JobItem.cpp index 90a7301bd0a26ba8d5d837823c26045b34dccf01..10b5f34ca9b1ddeb153b07af475cc30a26262fa4 100644 --- a/GUI/Model/Job/JobItem.cpp +++ b/GUI/Model/Job/JobItem.cpp @@ -134,7 +134,7 @@ void JobItem::createParameterTree() void JobItem::cloneItemIntoJob(const InstrumentItem* instrument) { - m_instrument.setCertainItem(instrument->createItemCopy()); + m_instrument.setCertainItem(instrument->clone()); m_instrument.certainItem()->setId(QUuid::createUuid().toString()); } diff --git a/GUI/Model/Type/ModelForSet.cpp b/GUI/Model/Type/ModelForSet.cpp index d3c6cd3255dd1cb3346d9b23b5b2a7bbbfeb2491..0df1e42145aa4de55de37f0dfd4e75b824851061 100644 --- a/GUI/Model/Type/ModelForSet.cpp +++ b/GUI/Model/Type/ModelForSet.cpp @@ -76,7 +76,7 @@ void ModelForSet::cloneItem() { const InstrumentItem* t = set()->currentItem(); ASSERT(t); - InstrumentItem* t2 = t->createItemCopy(); + InstrumentItem* t2 = t->clone(); t2->setId(QUuid::createUuid().toString()); pushItem(t2); } diff --git a/GUI/Model/Type/SetWithModel.h b/GUI/Model/Type/SetWithModel.h index 40dec4fdfa965e4a4deffba9f0e032303b820201..9163d96a74dcdb1cd5c8e0d367e3cdd550f72a8d 100644 --- a/GUI/Model/Type/SetWithModel.h +++ b/GUI/Model/Type/SetWithModel.h @@ -48,6 +48,7 @@ public: if (i != m_current_index) m_current_index = i; } + size_t currentIndex() const { return m_current_index; } const T* currentItem() const { diff --git a/GUI/View/List/InstrumentsQModel.cpp b/GUI/View/List/InstrumentsQModel.cpp index e01afca9cf74f6444e26934d318b9b04af1647fc..1f19c840d04eaafe638184a43155b9249ab6549f 100644 --- a/GUI/View/List/InstrumentsQModel.cpp +++ b/GUI/View/List/InstrumentsQModel.cpp @@ -76,7 +76,7 @@ void InstrumentsQModel::cloneItem() { const InstrumentItem* t = set()->currentItem(); ASSERT(t); - InstrumentItem* t2 = t->createItemCopy(); + InstrumentItem* t2 = t->clone(); t2->setId(QUuid::createUuid().toString()); pushItem(t2); }