client: Don't send dataChanged() before actually changing the data
authorManuel Nickschas <sputnick@quassel-irc.org>
Wed, 29 Aug 2018 19:02:41 +0000 (21:02 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Mon, 3 Sep 2018 20:13:17 +0000 (22:13 +0200)
The PropertyMapItem didn't set a changed property before sending
the signal, so consumers synchronously reacting to dataChanged()
would still access the old value.

Not sure if this issue is the cause for some of the weird model
behavior we tend to see at times...

src/client/treemodel.cpp

index f02f731..f87d336 100644 (file)
@@ -316,8 +316,9 @@ bool PropertyMapItem::setData(int column, const QVariant &value, int role)
     if (column >= columnCount() || role != Qt::DisplayRole)
         return false;
 
+    setProperty(_propertyOrder[column].toLatin1(), value);
     emit dataChanged(column);
-    return setProperty(_propertyOrder[column].toLatin1(), value);
+    return true;
 }