[rkward-cvs] SF.net SVN: rkward: [844] trunk/rkward/rkward

tfry at users.sourceforge.net tfry at users.sourceforge.net
Wed Oct 11 11:36:31 UTC 2006


Revision: 844
          http://svn.sourceforge.net/rkward/?rev=844&view=rev
Author:   tfry
Date:     2006-10-11 04:36:24 -0700 (Wed, 11 Oct 2006)

Log Message:
-----------
Make sure to watch newly created symbols. Fix column deletion logic

Modified Paths:
--------------
    trunk/rkward/rkward/core/rcontainerobject.cpp
    trunk/rkward/rkward/core/renvironmentobject.cpp
    trunk/rkward/rkward/core/renvironmentobject.h
    trunk/rkward/rkward/misc/rkobjectlistview.cpp
    trunk/rkward/rkward/robjectbrowser.cpp

Modified: trunk/rkward/rkward/core/rcontainerobject.cpp
===================================================================
--- trunk/rkward/rkward/core/rcontainerobject.cpp	2006-10-11 11:35:56 UTC (rev 843)
+++ trunk/rkward/rkward/core/rcontainerobject.cpp	2006-10-11 11:36:24 UTC (rev 844)
@@ -266,7 +266,7 @@
 	RK_TRACE (OBJECTS);
 
 	if (!removed_in_workspace) {
-		RCommand *command = new RCommand (removeChildCommand (object), RCommand::App | RCommand::Sync);
+		RCommand *command = new RCommand (removeChildCommand (object), RCommand::App | RCommand::Sync | RCommand::ObjectListUpdate);
 		RKGlobals::rInterface ()->issueCommand (command, 0);
 	}
 

Modified: trunk/rkward/rkward/core/renvironmentobject.cpp
===================================================================
--- trunk/rkward/rkward/core/renvironmentobject.cpp	2006-10-11 11:35:56 UTC (rev 843)
+++ trunk/rkward/rkward/core/renvironmentobject.cpp	2006-10-11 11:36:24 UTC (rev 844)
@@ -63,19 +63,6 @@
 	return (name + "$" + short_child_name);
 }
 
-RObject *REnvironmentObject::createNewChild (const QString &name, RKEditor *creator, bool container, bool data_frame) {
-	RK_TRACE (OBJECTS);
-
-	RObject *obj = RContainerObject::createNewChild (name, creator, container, data_frame);
-
-	if (type & GlobalEnv) {
-		RKGlobals::rInterface ()->issueCommand (".rk.watch.symbol (" + rQuote (name) + ")", RCommand::App | RCommand::Sync, QString::null, 0);
-	}
-
-	return obj;
-}
-
-
 void REnvironmentObject::writeMetaData (RCommandChain *chain) {
 	RK_TRACE (OBJECTS);
 

Modified: trunk/rkward/rkward/core/renvironmentobject.h
===================================================================
--- trunk/rkward/rkward/core/renvironmentobject.h	2006-10-11 11:35:56 UTC (rev 843)
+++ trunk/rkward/rkward/core/renvironmentobject.h	2006-10-11 11:36:24 UTC (rev 844)
@@ -38,8 +38,6 @@
 	QString makeChildName (const QString &short_child_name, bool misplaced=false);
 /** reimplemented from RContainerObject: If this is an environment var, call RContainerObject::writeMetaData (). Else, do nothing. An environment has no meta data. */
 	void writeMetaData (RCommandChain *chain);
-/** reimplemented from RContainerObject: If this is the global env, add a watch for the new child */
-	RObject *createNewChild (const QString &name, RKEditor *creator=0, bool container=false, bool data_frame=false);
 protected:
 	bool updateStructure (RData *new_data);
 /** reimplemented from RContainerObject to raise an assert if this is not the isGlobalEnv (). Otherwise calls "remove (objectname)" instead of objectname <- NULL" */

Modified: trunk/rkward/rkward/misc/rkobjectlistview.cpp
===================================================================
--- trunk/rkward/rkward/misc/rkobjectlistview.cpp	2006-10-11 11:35:56 UTC (rev 843)
+++ trunk/rkward/rkward/misc/rkobjectlistview.cpp	2006-10-11 11:36:24 UTC (rev 844)
@@ -198,10 +198,13 @@
 
 	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
+	// also take care of removing the children of the removed item!
+	// this can NOT be done by using QListViewItemIterator (item), as that is NOT constrained to the children!
+	RObject **children = object->children ();
+	for (unsigned int i = 0; i < object->numChildren (); ++i) {
+		objectRemoved (children[i]);
 	}
+
 	object_map.remove (item);
 	delete item;
 	

Modified: trunk/rkward/rkward/robjectbrowser.cpp
===================================================================
--- trunk/rkward/rkward/robjectbrowser.cpp	2006-10-11 11:35:56 UTC (rev 843)
+++ trunk/rkward/rkward/robjectbrowser.cpp	2006-10-11 11:36:24 UTC (rev 844)
@@ -112,7 +112,7 @@
 		QString valid = RObjectList::getGlobalEnv ()->validizeName (name);
 		if (valid != name) KMessageBox::sorry (this, i18n ("The name you specified was already in use or not valid. Renamed to %1").arg (valid), i18n ("Invalid Name"));
 		RObject *copy = RObjectList::getGlobalEnv ()->createNewChild (valid, 0, true, true);
-		RKGlobals::rInterface ()->issueCommand (RObject::rQuote (valid) + " <- " + object->getFullName (), RCommand::App);
+		RKGlobals::rInterface ()->issueCommand (RObject::rQuote (valid) + " <- " + object->getFullName (), RCommand::App | RCommand::ObjectListUpdate);
 		copy->updateFromR ();
 	}
 }
@@ -126,7 +126,7 @@
 	QString valid = RObjectList::getGlobalEnv ()->validizeName (name);
 	if (valid != name) KMessageBox::sorry (this, i18n ("An object named '%1' already exists in the GlobalEnv. Created the copy as '%2' instead.").arg (name).arg (valid), i18n ("Name already in use"));
 	RObject *copy = RObjectList::getGlobalEnv ()->createNewChild (valid, 0, true, true);
-	RKGlobals::rInterface ()->issueCommand (RObject::rQuote (valid) + " <- " + object->getFullName (), RCommand::App);
+	RKGlobals::rInterface ()->issueCommand (RObject::rQuote (valid) + " <- " + object->getFullName (), RCommand::App | RCommand::ObjectListUpdate);
 	copy->updateFromR ();
 }
 


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