src/gui.cc

changeset 560
39085791128f
parent 557
04e140bdeb0b
child 561
1d90296ad3fc
--- a/src/gui.cc	Wed Dec 18 17:03:35 2013 +0200
+++ b/src/gui.cc	Wed Dec 18 17:44:31 2013 +0200
@@ -266,7 +266,7 @@
 
 	// Delete the objects that were being selected
 	for (LDObject* obj : selCopy)
-		delete obj;
+		obj->deleteSelf();
 
 	refresh();
 	return selCopy.size();
@@ -540,7 +540,7 @@
 LDObject::Type ForgeWindow::getUniformSelectedType()
 {	LDObject::Type result = LDObject::Unidentified;
 
-	for (LDObject * obj : selection())
+	for (LDObject* obj : selection())
 	{	if (result != LDObject::Unidentified && obj->getColor() != result)
 			return LDObject::Unidentified;
 
@@ -606,12 +606,11 @@
 }
 
 // =============================================================================
+// TODO: what the heh?
 // -----------------------------------------------------------------------------
 void ForgeWindow::deleteObjects (QList<LDObject*> objs)
-{	for (LDObject * obj : objs)
-	{	getCurrentDocument()->forgetObject (obj);
-		delete obj;
-	}
+{	for (LDObject* obj : objs)
+		obj->deleteSelf();
 }
 
 // =============================================================================
@@ -785,7 +784,7 @@
 void makeColorComboBox (QComboBox* box)
 {	std::map<int, int> counts;
 
-	for (LDObject * obj : getCurrentDocument()->getObjects())
+	for (LDObject* obj : getCurrentDocument()->getObjects())
 	{	if (!obj->isColored())
 			continue;
 
@@ -908,7 +907,7 @@
 	ui->objectList->clear();
 	LDDocument* f = getCurrentDocument();
 
-for (LDObject * obj : *f)
+for (LDObject* obj : *f)
 		ui->objectList->addItem (obj->qObjListEntry);
 
 #endif

mercurial