[Kst] extragear/graphics/kst/src/libkstapp

Duncan Hanson duncan.hanson at gmail.com
Fri May 12 02:47:20 CEST 2006


SVN commit 539919 by dhanson:

BUG:127177 rewrote KstTopLevelView::deleteSelectedObjects so that deep children can be removed.

 M  +13 -9     ksttoplevelview.cpp  


--- trunk/extragear/graphics/kst/src/libkstapp/ksttoplevelview.cpp #539918:539919
@@ -1601,18 +1601,22 @@
 
 void KstTopLevelView::deleteSelectedObjects() {
   QValueList<KstViewObject*> toBeDeleted;
-  for (KstViewObjectList::Iterator it = _children.begin(); it != _children.end(); ++it) {
-    if ((*it)->isSelected()) {
-      toBeDeleted.push_front(*it);
-    }  
-  }
+
+  _selectionList.clear();
+  recursivelyQuery(&KstViewObject::isSelected, _selectionList, false);
+
+  KstViewObject *selection;
   
-  clearFocus();
+  while (!_selectionList.isEmpty()) {
+    selection = _selectionList.front();
     
-  while (!toBeDeleted.isEmpty()) {
-    removeChild(toBeDeleted.front());
-    toBeDeleted.pop_front();  
+    if (selection->parent()) {
+      selection->parent()->removeChild(selection);
+    }
+    _selectionList.pop_front();
   }
+
+  clearFocus();
   paint(KstPainter::P_PAINT);
 }
 


More information about the Kst mailing list