[rkward-cvs] SF.net SVN: rkward: [820] trunk/rkward/rkward/misc/rkobjectlistview.cpp
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Thu Oct 5 20:18:39 UTC 2006
Revision: 820
http://svn.sourceforge.net/rkward/?rev=820&view=rev
Author: tfry
Date: 2006-10-05 13:18:35 -0700 (Thu, 05 Oct 2006)
Log Message:
-----------
Make sure to remove deleted items from the map (should fix crashes when loading new workspace)
use const iterator in findObjectItem
Modified Paths:
--------------
trunk/rkward/rkward/misc/rkobjectlistview.cpp
Modified: trunk/rkward/rkward/misc/rkobjectlistview.cpp
===================================================================
--- trunk/rkward/rkward/misc/rkobjectlistview.cpp 2006-10-05 18:47:37 UTC (rev 819)
+++ trunk/rkward/rkward/misc/rkobjectlistview.cpp 2006-10-05 20:18:35 UTC (rev 820)
@@ -180,6 +180,10 @@
RKListViewItem *item = findObjectItem (object);
RK_ASSERT (item);
+ for (QListViewItemIterator it (item); it.current (); ++it) {
+ object_map.remove (static_cast<RKListViewItem *> (*it));
+ // the children will be deleted with the parent, we just need to remove them from the map
+ }
object_map.remove (item);
delete item;
@@ -206,7 +210,7 @@
RKListViewItem *RKObjectListView::findObjectItem (RObject *object) {
RK_TRACE (APP);
- for (ObjectMap::iterator it = object_map.begin (); it != object_map.end (); ++it) {
+ for (ObjectMap::const_iterator it = object_map.constBegin (); it != object_map.constEnd (); ++it) {
if (it.data () == object) return it.key ();
}
return 0;
@@ -318,7 +322,6 @@
return ret;
}
-
//////////////////// RKObjectListViewSettings //////////////////////////
RKObjectListViewSettings::RKObjectListViewSettings () {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the rkward-tracker
mailing list