diff --git a/client/src/dialog/objectselectlistdialog.cpp b/client/src/dialog/objectselectlistdialog.cpp index 619b2c62..f7a1d9ca 100644 --- a/client/src/dialog/objectselectlistdialog.cpp +++ b/client/src/dialog/objectselectlistdialog.cpp @@ -33,6 +33,7 @@ #include "../widget/tablewidget.hpp" #include "../widget/alertwidget.hpp" #include +#include ObjectSelectListDialog::ObjectSelectListDialog(Method& method, bool multiSelect, QWidget* parent) : ObjectSelectListDialog(static_cast(method), multiSelect, parent) @@ -147,9 +148,16 @@ void ObjectSelectListDialog::acceptRows(const QModelIndexList& indexes) { if(auto* m = dynamic_cast(&m_item)) { + // Call method only once for each row, not for every index in row + std::unordered_set rowsDone; + for(const auto& index : indexes) { + if(rowsDone.find(index.row()) != rowsDone.end()) + continue; + callMethod(*m, nullptr, m_tableWidget->getRowObjectId(index.row())); + rowsDone.insert(index.row()); } }