fixed: LDDocument created one removal connection to the model for each object added, so removing an object from a model of 9 objects added 9 deletion entries to history

Sun, 11 Mar 2018 16:13:22 +0200

author
Santeri Piippo
date
Sun, 11 Mar 2018 16:13:22 +0200
changeset 1280
5c30efc9032b
parent 1279
0f6a4a7cafec
child 1281
f9c01b455594

fixed: LDDocument created one removal connection to the model for each object added, so removing an object from a model of 9 objects added 9 deletion entries to history

src/lddocument.cpp file | annotate | diff | comparison | revisions
--- a/src/lddocument.cpp	Thu Mar 08 11:39:18 2018 +0200
+++ b/src/lddocument.cpp	Sun Mar 11 16:13:22 2018 +0200
@@ -50,6 +50,13 @@
 			history()->add<MoveHistoryEntry>(start, end, row);
 		}
 	);
+	connect(
+		this,
+		SIGNAL(aboutToRemoveObject(QModelIndex)),
+		this,
+		SLOT(handleImminentObjectRemoval(QModelIndex)),
+		Qt::DirectConnection
+	);
 }
 
 LDDocument::~LDDocument()
@@ -279,13 +286,6 @@
 		this,
 		SLOT(objectChanged(LDObjectState, LDObjectState))
 	);
-	connect(
-		this,
-		SIGNAL(aboutToRemoveObject(QModelIndex)),
-		this,
-		SLOT(handleImminentObjectRemoval(QModelIndex)),
-		Qt::DirectConnection
-	);
 }
 
 void LDDocument::objectChanged(const LDObjectState& before, const LDObjectState& after)

mercurial