Notice to GitKraken users: A vulnerability has been found in the SSH key generation of GitKraken versions 7.6.0 to 8.0.0 (https://www.gitkraken.com/blog/weak-ssh-key-fix). If you use GitKraken and have generated a SSH key using one of these versions, please remove it both from your local workstation and from your LRZ GitLab profile.

21.10.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit 0249b136 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Removed all occasions where references to DataHandles were used, since...

Removed all occasions where references to DataHandles were used, since especially their use in signals may lead to segfaults or other undesired behavior.
parent 4700bbba
...@@ -150,7 +150,7 @@ namespace campvis { ...@@ -150,7 +150,7 @@ namespace campvis {
* \param name Name of the added data. * \param name Name of the added data.
* \param dh DataHandle to the newly added data. * \param dh DataHandle to the newly added data.
*/ */
void onDataContainerDataAdded(const std::string& name, const DataHandle& dh); void onDataContainerDataAdded(const std::string& name, DataHandle dh);
/** /**
* Slot getting called when one of the observed properties changed and notifies its observers. * Slot getting called when one of the observed properties changed and notifies its observers.
......
...@@ -115,7 +115,7 @@ namespace campvis { ...@@ -115,7 +115,7 @@ namespace campvis {
return _dataContainer; return _dataContainer;
} }
void DataContainerInspectorWidget::onDataContainerDataAdded(const std::string& key, const DataHandle& dh) { void DataContainerInspectorWidget::onDataContainerDataAdded(const std::string& key, DataHandle dh) {
// copy QtDataHandle because signal will be handled by a different thread an indefinite amount of time later: // copy QtDataHandle because signal will be handled by a different thread an indefinite amount of time later:
emit dataContainerChanged(QString::fromStdString(key), QtDataHandle(dh)); emit dataContainerChanged(QString::fromStdString(key), QtDataHandle(dh));
} }
......
...@@ -87,7 +87,7 @@ namespace campvis { ...@@ -87,7 +87,7 @@ namespace campvis {
/** /**
* Slot called when _dataContainer has changed and emitted the s_dataAdded signal. * Slot called when _dataContainer has changed and emitted the s_dataAdded signal.
*/ */
void onDataContainerDataAdded(const std::string&, const DataHandle&); void onDataContainerDataAdded(const std::string&, DataHandle);
/** /**
* Size hint for the default window size * Size hint for the default window size
......
...@@ -82,7 +82,7 @@ namespace campvis { ...@@ -82,7 +82,7 @@ namespace campvis {
// ================================================================================================ // ================================================================================================
DataHandleTreeItem::DataHandleTreeItem(const QtDataHandle& dataHandle, const std::string& name, TreeItem* parent) DataHandleTreeItem::DataHandleTreeItem(QtDataHandle dataHandle, const std::string& name, TreeItem* parent)
: TreeItem(parent) : TreeItem(parent)
, _dataHandle(dataHandle) , _dataHandle(dataHandle)
, _name(name) , _name(name)
...@@ -150,7 +150,7 @@ namespace campvis { ...@@ -150,7 +150,7 @@ namespace campvis {
DataHandleTreeItem::~DataHandleTreeItem() { DataHandleTreeItem::~DataHandleTreeItem() {
} }
void DataHandleTreeItem::setDataHandle(const QtDataHandle& dataHandle) { void DataHandleTreeItem::setDataHandle(QtDataHandle dataHandle) {
_dataHandle = dataHandle; _dataHandle = dataHandle;
updateChildren(); updateChildren();
} }
......
...@@ -62,7 +62,7 @@ namespace campvis { ...@@ -62,7 +62,7 @@ namespace campvis {
* \param name Name of the QtDataHandle * \param name Name of the QtDataHandle
* \param parent Parent TreeItem * \param parent Parent TreeItem
*/ */
DataHandleTreeItem(const QtDataHandle& dataHandle, const std::string& name, TreeItem* parent); DataHandleTreeItem(QtDataHandle dataHandle, const std::string& name, TreeItem* parent);
/** /**
* Destructor, deletes the QtDataHandle * Destructor, deletes the QtDataHandle
...@@ -77,7 +77,7 @@ namespace campvis { ...@@ -77,7 +77,7 @@ namespace campvis {
* \note DataHandleTreeItem takes ownership of this pointer. * \note DataHandleTreeItem takes ownership of this pointer.
* \param dataHandle The QtDataHandle to wrap around, DataHandleTreeItem takes ownership of this pointer! * \param dataHandle The QtDataHandle to wrap around, DataHandleTreeItem takes ownership of this pointer!
*/ */
void setDataHandle(const QtDataHandle& dataHandle); void setDataHandle(QtDataHandle dataHandle);
private: private:
/** /**
......
...@@ -46,6 +46,7 @@ namespace campvis { ...@@ -46,6 +46,7 @@ namespace campvis {
sl.append(QString::fromStdString(tmp[i].first)); sl.append(QString::fromStdString(tmp[i].first));
_combobox->addItems(sl); _combobox->addItems(sl);
dc->s_dataAdded.connect(this, &DataNamePropertyWidget::onDataAdded); dc->s_dataAdded.connect(this, &DataNamePropertyWidget::onDataAdded);
connect(this, SIGNAL(s_dataAddedQt(const QString&, QtDataHandle)), this, SLOT(onDataAddedQt(const QString&, QtDataHandle)));
setCurrentComboBoxText(QString::fromStdString(property->getValue())); setCurrentComboBoxText(QString::fromStdString(property->getValue()));
} }
...@@ -98,9 +99,13 @@ namespace campvis { ...@@ -98,9 +99,13 @@ namespace campvis {
--_ignorePropertyUpdates; --_ignorePropertyUpdates;
} }
void DataNamePropertyWidget::onDataAdded(const std::string& key, const DataHandle& /*dh*/) { void DataNamePropertyWidget::onDataAdded(const std::string& key, DataHandle dh) {
if (_combobox->findText(QString::fromStdString(key)) == -1) { emit s_dataAddedQt(QString::fromStdString(key), dh);
_combobox->addItem(QString::fromStdString(key)); }
void DataNamePropertyWidget::onDataAddedQt(const QString& key, QtDataHandle dh) {
if (_combobox->findText(key) == -1) {
_combobox->addItem(key);
} }
} }
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "sigslot/sigslot.h" #include "sigslot/sigslot.h"
#include "core/properties/datanameproperty.h" #include "core/properties/datanameproperty.h"
#include "application/gui/qtdatahandle.h"
#include "application/gui/properties/abstractpropertywidget.h" #include "application/gui/properties/abstractpropertywidget.h"
#include "application/gui/properties/propertywidgetfactory.h" #include "application/gui/properties/propertywidgetfactory.h"
...@@ -64,10 +65,14 @@ namespace campvis { ...@@ -64,10 +65,14 @@ namespace campvis {
*/ */
virtual void updateWidgetFromProperty(); virtual void updateWidgetFromProperty();
void onDataAdded(const std::string& key, const DataHandle& dh); void onDataAdded(const std::string& key, DataHandle dh);
private slots: private slots:
void onTextChanged(const QString& text); void onTextChanged(const QString& text);
void onDataAddedQt(const QString& key, QtDataHandle dh);
signals:
void s_dataAddedQt(const QString& key, QtDataHandle dh);
private: private:
/** /**
......
...@@ -55,7 +55,7 @@ namespace campvis { ...@@ -55,7 +55,7 @@ namespace campvis {
return dh; return dh;
} }
void DataContainer::addDataHandle(const std::string& name, const DataHandle& dh) { void DataContainer::addDataHandle(const std::string& name, DataHandle dh) {
if (name.empty()) { if (name.empty()) {
LERROR("Tried to add data with empty name to DataContainer."); LERROR("Tried to add data with empty name to DataContainer.");
return; return;
......
...@@ -82,7 +82,7 @@ namespace campvis { ...@@ -82,7 +82,7 @@ namespace campvis {
* \param name Key for accessing the DataHandle within this DataContainer * \param name Key for accessing the DataHandle within this DataContainer
* \param data DataHandle to add. * \param data DataHandle to add.
*/ */
void addDataHandle(const std::string& name, const DataHandle& dh); void addDataHandle(const std::string& name, DataHandle dh);
/** /**
* Checks whether this DataContainer contains a DataHandle with the given name. * Checks whether this DataContainer contains a DataHandle with the given name.
...@@ -146,7 +146,7 @@ namespace campvis { ...@@ -146,7 +146,7 @@ namespace campvis {
* Signal emitted when data has been added to this DataContainer (this includes also data being replaced). * Signal emitted when data has been added to this DataContainer (this includes also data being replaced).
* First parameter is the name of the added data, second parameter contains a DataHandle to the new data. * First parameter is the name of the added data, second parameter contains a DataHandle to the new data.
*/ */
sigslot::signal2<const std::string&, const DataHandle&> s_dataAdded; sigslot::signal2<const std::string&, DataHandle> s_dataAdded;
/// Signal emitted when list of DataHandles has changed. /// Signal emitted when list of DataHandles has changed.
sigslot::signal0 s_changed; sigslot::signal0 s_changed;
......
...@@ -75,7 +75,7 @@ namespace campvis { ...@@ -75,7 +75,7 @@ namespace campvis {
* Gets the DataHandle. * Gets the DataHandle.
* \return dh * \return dh
*/ */
const DataHandle& getDataHandle() const { DataHandle getDataHandle() const {
return dh; return dh;
} }
......
...@@ -247,7 +247,7 @@ namespace campvis { ...@@ -247,7 +247,7 @@ namespace campvis {
#endif #endif
} }
void AbstractPipeline::onDataContainerDataAdded(const std::string& name, const DataHandle& dh) { void AbstractPipeline::onDataContainerDataAdded(const std::string& name, DataHandle dh) {
if (name == _renderTargetID.getValue()) { if (name == _renderTargetID.getValue()) {
s_renderTargetChanged(); s_renderTargetChanged();
} }
......
...@@ -207,7 +207,7 @@ namespace campvis { ...@@ -207,7 +207,7 @@ namespace campvis {
* \param name Name of the added data. * \param name Name of the added data.
* \param dh DataHandle to the newly added data. * \param dh DataHandle to the newly added data.
*/ */
virtual void onDataContainerDataAdded(const std::string& name, const DataHandle& dh); virtual void onDataContainerDataAdded(const std::string& name, DataHandle dh);
/// Pointer to the DataContainer containing local working set of data for this Pipeline, must not be 0. /// Pointer to the DataContainer containing local working set of data for this Pipeline, must not be 0.
DataContainer* _data; DataContainer* _data;
......
...@@ -127,7 +127,7 @@ namespace campvis { ...@@ -127,7 +127,7 @@ namespace campvis {
} }
} }
void AutoEvaluationPipeline::onDataContainerDataAdded(const std::string& name, const DataHandle& dh) { void AutoEvaluationPipeline::onDataContainerDataAdded(const std::string& name, DataHandle dh) {
{ {
// acquire read lock // acquire read lock
tbb::spin_rw_mutex::scoped_lock lock(_pmMutex, false); tbb::spin_rw_mutex::scoped_lock lock(_pmMutex, false);
......
...@@ -86,7 +86,7 @@ namespace campvis { ...@@ -86,7 +86,7 @@ namespace campvis {
* \param name Name of the added data. * \param name Name of the added data.
* \param dh DataHandle to the newly added data. * \param dh DataHandle to the newly added data.
*/ */
virtual void onDataContainerDataAdded(const std::string& name, const DataHandle& dh); virtual void onDataContainerDataAdded(const std::string& name, DataHandle dh);
/** /**
* Recursively looks for all DataNameProperties in \a pc and adds them to the port map. * Recursively looks for all DataNameProperties in \a pc and adds them to the port map.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment