diff --git a/include/Variable/Variable.h b/include/Variable/Variable.h index 00ae78a..9a9e525 100644 --- a/include/Variable/Variable.h +++ b/include/Variable/Variable.h @@ -97,9 +97,10 @@ public: operator QUuid() {return _uuid;} QUuid ID(){return _uuid;} signals: - void updated(); - private: - class VariablePrivate; + void updated(QUuid ID); + +private: + class VariablePrivate; spimpl::unique_impl_ptr impl; QUuid _uuid; QReadWriteLock m_lock; diff --git a/include/Variable/VariableModel2.h b/include/Variable/VariableModel2.h index 705aa82..ccdaa7c 100644 --- a/include/Variable/VariableModel2.h +++ b/include/Variable/VariableModel2.h @@ -60,7 +60,7 @@ signals: void asyncChangeRange(const std::shared_ptr& variable, const DateTimeRange& r); public slots: /// Slot called when data of a variable has been updated - void variableUpdated() noexcept; + void variableUpdated(QUuid id) noexcept; void variableAdded(const std::shared_ptr&); void variableDeleted(const std::shared_ptr&); }; diff --git a/src/Variable/Variable.cpp b/src/Variable/Variable.cpp index d83000e..b51366f 100644 --- a/src/Variable/Variable.cpp +++ b/src/Variable/Variable.cpp @@ -54,7 +54,7 @@ static DataSeriesType findDataSeriesType(const QVariantHash &metadata) void Variable::setter(const type& getter) noexcept \ {\ impl->setter(getter);\ - emit updated();\ + emit updated(this->ID());\ }\ struct Variable::VariablePrivate { @@ -165,7 +165,7 @@ void Variable::setRange(const DateTimeRange &range, bool notify) noexcept impl->setRange(range); impl->updateRealRange(); if(notify) - emit this->updated(); + emit this->updated(this->ID()); } V_FW_GETTER_SETTER(cacheRange, setCacheRange, DateTimeRange) @@ -190,10 +190,9 @@ void Variable::updateData(const std::vector &dataSeries, const Da impl->purgeDataSeries(); } if(notify) - emit updated(); + emit updated(this->ID()); } - std::shared_ptr Variable::dataSeries() const noexcept { return impl->dataSeries(); @@ -211,4 +210,3 @@ QVariantHash Variable::metadata() const noexcept impl->unlock(); return metadata; } - diff --git a/src/Variable/VariableModel2.cpp b/src/Variable/VariableModel2.cpp index 2d89231..8ad2833 100644 --- a/src/Variable/VariableModel2.cpp +++ b/src/Variable/VariableModel2.cpp @@ -240,7 +240,7 @@ bool VariableModel2::dropMimeData(const QMimeData *data, Qt::DropAction action, return dropDone; } -void VariableModel2::variableUpdated() noexcept +void VariableModel2::variableUpdated(QUuid id) noexcept { emit dataChanged(QModelIndex(),QModelIndex()); }