Commit 132c0293 authored by Leander Schulten's avatar Leander Schulten

Fix Crash. Close #83 and #84

parent 20cf0ea3
Pipeline #286857 passed with stage
in 21 minutes and 26 seconds
......@@ -83,7 +83,7 @@ ControlItemData::ControlItemData(Type t, QObject *parent) : QObject(parent), typ
ControlItemData::ControlItemData(const QJsonObject &o, QObject *parent)
: QObject(parent), startXBlock(o["startXBlock"].toInt()), startYBlock(o["startYBlock"].toInt()), mobileStartXBlock(o["mobileStartXBlock"].toInt(startXBlock)),
mobileStartYBlock(o["mobileStartYBlock"].toInt(startYBlock)), userVisibilityModel(o), type(static_cast<Type>(o["type"].toInt())) {
QObject::connect(UserManagment::get(), &UserManagment::currentUserChanged, [this]() {
userChangedConnection = QObject::connect(UserManagment::get(), &UserManagment::currentUserChanged, [this]() {
emit isVisibleForUserChanged();
propertyChangedForRemote("isVisibleForUser", isVisibleForUser() ? "true" : "false");
});
......@@ -154,6 +154,7 @@ void ControlItemData::setStartYBlock(int i) {
GUI::ControlItemData::~ControlItemData() {
ControlItemSync::get().deregisterControlItenData(this);
QObject::disconnect(userChangedConnection);
}
// start ProgrammControlItemData
......
......@@ -57,6 +57,7 @@ private:
int mobileStartXBlock = 0;
int mobileStartYBlock = 0;
UserVisibilityModel userVisibilityModel;
QMetaObject::Connection userChangedConnection;
static inline int counter = 0;
public:
......
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