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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Mon Oct 2 22:37:56 UTC 2006


Revision: 794
          http://svn.sourceforge.net/rkward/?rev=794&view=rev
Author:   tfry
Date:     2006-10-02 15:37:25 -0700 (Mon, 02 Oct 2006)

Log Message:
-----------
Make sure new objects get created in the .GlobalEnv

Modified Paths:
--------------
    trunk/rkward/rkward/agents/rkloadagent.cpp
    trunk/rkward/rkward/agents/rksaveagent.cpp
    trunk/rkward/rkward/core/rcontainerobject.h
    trunk/rkward/rkward/core/renvironmentobject.cpp
    trunk/rkward/rkward/core/robject.cpp
    trunk/rkward/rkward/core/robjectlist.cpp
    trunk/rkward/rkward/core/robjectlist.h
    trunk/rkward/rkward/misc/rkobjectlistview.cpp
    trunk/rkward/rkward/plugin/rkcomponentproperties.cpp
    trunk/rkward/rkward/plugin/rkvarselector.cpp
    trunk/rkward/rkward/rbackend/rinterface.cpp
    trunk/rkward/rkward/rkglobals.cpp
    trunk/rkward/rkward/rkglobals.h
    trunk/rkward/rkward/rkward.cpp
    trunk/rkward/rkward/robjectbrowser.cpp
    trunk/rkward/rkward/windows/rkworkplace.cpp

Modified: trunk/rkward/rkward/agents/rkloadagent.cpp
===================================================================
--- trunk/rkward/rkward/agents/rkloadagent.cpp	2006-10-02 21:40:13 UTC (rev 793)
+++ trunk/rkward/rkward/agents/rkloadagent.cpp	2006-10-02 22:37:25 UTC (rev 794)
@@ -51,15 +51,15 @@
 		update_was_delete = true;
 		command = new RCommand ("remove (list=ls (all.names=TRUE))", RCommand::App);
 		RKGlobals::rInterface ()->issueCommand (command);
-		RKGlobals::rObjectList ()->updateFromR ();
+		RObjectList::getObjectList ()->updateFromR ();
 	}
 
 	command = new RCommand ("load (\"" + url.path () + "\")", RCommand::App, QString::null, this, WORKSPACE_LOAD_COMMAND);
 	RKGlobals::rInterface ()->issueCommand (command);
 
-	connect (RKGlobals::rObjectList (), SIGNAL (updateComplete ()), this, SLOT (listUpdateComplete ()));
+	connect (RObjectList::getObjectList (), SIGNAL (updateComplete ()), this, SLOT (listUpdateComplete ()));
 	
-	RKGlobals::rObjectList ()->setWorkspaceURL (url);
+	RObjectList::getObjectList ()->setWorkspaceURL (url);
 }
 
 RKLoadAgent::~RKLoadAgent () {
@@ -72,8 +72,8 @@
 	if (command->getFlags () == WORKSPACE_LOAD_COMMAND) {
 		KIO::NetAccess::removeTempFile (tmpfile);
 		if (command->failed ()) {
-			KMessageBox::error (0, i18n ("There has been an error opening file '%1':\n%2").arg (RKGlobals::rObjectList ()->getWorkspaceURL ().path ()).arg (command->error ()), i18n ("Error loading workspace"));
-			RKGlobals::rObjectList ()->setWorkspaceURL (QString::null);
+			KMessageBox::error (0, i18n ("There has been an error opening file '%1':\n%2").arg (RObjectList::getObjectList ()->getWorkspaceURL ().path ()).arg (command->error ()), i18n ("Error loading workspace"));
+			RObjectList::getObjectList ()->setWorkspaceURL (QString::null);
 		}
 		RKwardApp::getApp ()->slotSetStatusReady ();
 		RKwardApp::getApp ()->setCaption (QString::null);	// trigger update of caption
@@ -84,7 +84,7 @@
 	RK_TRACE (APP);
 	if (update_was_delete) {
 		update_was_delete = false;
-		RKGlobals::rObjectList ()->updateFromR ();
+		RObjectList::getObjectList ()->updateFromR ();
 		return;
 	}
 	RKWorkplace::mainWorkplace ()->restoreWorkplace ();

Modified: trunk/rkward/rkward/agents/rksaveagent.cpp
===================================================================
--- trunk/rkward/rkward/agents/rksaveagent.cpp	2006-10-02 21:40:13 UTC (rev 793)
+++ trunk/rkward/rkward/agents/rksaveagent.cpp	2006-10-02 22:37:25 UTC (rev 794)
@@ -92,7 +92,7 @@
 			}
 		}
 	} else {
-		RKGlobals::rObjectList ()->setWorkspaceURL (save_url);
+		RObjectList::getObjectList ()->setWorkspaceURL (save_url);
 		RKwardApp::getApp ()->setCaption (QString::null);	// trigger update of caption
 		done ();
 		return;

Modified: trunk/rkward/rkward/core/rcontainerobject.h
===================================================================
--- trunk/rkward/rkward/core/rcontainerobject.h	2006-10-02 21:40:13 UTC (rev 793)
+++ trunk/rkward/rkward/core/rcontainerobject.h	2006-10-02 22:37:25 UTC (rev 794)
@@ -53,13 +53,13 @@
 	/** creates a new child. Right now only RKVariables (false, false), or data.frames (true, true), or unspecified containers (true, false) can be created.
 	API will likely change. The child is NOT created in the workspace. That's your resonsibility. All this function returns is a new RObject* of the given
 	type and with the name (if neccessary) changed to a legal value. TODO: checking for and changing illegal names is not yet implemented */
-	RObject *createNewChild (const QString &name, RKEditor *creator=0, bool container=false, bool data_frame=false);
+	virtual RObject *createNewChild (const QString &name, RKEditor *creator=0, bool container=false, bool data_frame=false);
 
 	/** returns true, if there are no children in this container. Note: of course the object list may not be up to date! */
 	bool isEmpty () { return childmap.isEmpty (); };
 
 	/** given child_name, constructs a name which is as close as possible to the orginial but valid (i.e. not alreay in use, not contaning illegal characters */
-	QString validizeName (const QString &child_name);
+	virtual QString validizeName (const QString &child_name);
 
 	/** reimplemented from RObject to actually search for the object */
 	virtual RObject *findObject (const QString &name, bool is_canonified=false);

Modified: trunk/rkward/rkward/core/renvironmentobject.cpp
===================================================================
--- trunk/rkward/rkward/core/renvironmentobject.cpp	2006-10-02 21:40:13 UTC (rev 793)
+++ trunk/rkward/rkward/core/renvironmentobject.cpp	2006-10-02 22:37:25 UTC (rev 794)
@@ -26,7 +26,7 @@
 	RK_TRACE (OBJECTS);
 
 	type = Environment;
-	if (parent != RKGlobals::rObjectList ()) {
+	if (parent != RObjectList::getObjectList ()) {
 		type |= EnvironmentVar;
 	}
 
@@ -63,7 +63,7 @@
 	RK_TRACE (OBJECTS);
 
 	RCommand *command = new RCommand (".rk.get.environment.structure (" + getFullName () + ")", RCommand::App | RCommand::Sync | RCommand::GetStructuredData, QString::null, this, ROBJECT_UDPATE_STRUCTURE_COMMAND);
-	RKGlobals::rInterface ()->issueCommand (command, RKGlobals::rObjectList()->getUpdateCommandChain ());
+	RKGlobals::rInterface ()->issueCommand (command, RObjectList::getObjectList ()->getUpdateCommandChain ());
 }
 
 bool REnvironmentObject::updateStructure (RData *new_data) {

Modified: trunk/rkward/rkward/core/robject.cpp
===================================================================
--- trunk/rkward/rkward/core/robject.cpp	2006-10-02 21:40:13 UTC (rev 793)
+++ trunk/rkward/rkward/core/robject.cpp	2006-10-02 22:37:25 UTC (rev 794)
@@ -39,6 +39,7 @@
 	classnames = 0;
 	num_classes = 0;
 	dimensions = new int[1];	// safe initialization
+	dimensions[0] = 0;
 	num_dimensions = 0;
 }
 
@@ -190,7 +191,7 @@
 	RK_TRACE (OBJECTS);
 
 	RCommand *command = new RCommand (".rk.get.structure (" + getFullName () + ", " + rQuote (getShortName ()) + ")", RCommand::App | RCommand::Sync | RCommand::GetStructuredData, QString::null, this, ROBJECT_UDPATE_STRUCTURE_COMMAND);
-	RKGlobals::rInterface ()->issueCommand (command, RKGlobals::rObjectList()->getUpdateCommandChain ());
+	RKGlobals::rInterface ()->issueCommand (command, RObjectList::getObjectList ()->getUpdateCommandChain ());
 }
 
 void RObject::rCommandDone (RCommand *command) {

Modified: trunk/rkward/rkward/core/robjectlist.cpp
===================================================================
--- trunk/rkward/rkward/core/robjectlist.cpp	2006-10-02 21:40:13 UTC (rev 793)
+++ trunk/rkward/rkward/core/robjectlist.cpp	2006-10-02 22:37:25 UTC (rev 794)
@@ -35,8 +35,13 @@
 
 #include "../debug.h"
 
+// static
+RObjectList *RObjectList::object_list = 0;
+
 RObjectList::RObjectList () : RContainerObject (0, QString::null) {
 	RK_TRACE (OBJECTS);
+	object_list = this;
+
 	update_timer = new QTimer (this);
 	
 	connect (update_timer, SIGNAL (timeout ()), this, SLOT (timeout ()));
@@ -46,8 +51,9 @@
 	type = RObject::Workspace;
 	
 	update_chain = 0;
-	toplevel_environments = 0;
-	num_toplevel_environments = 0;
+	toplevel_environments = new REnvironmentObject*[1];
+	num_toplevel_environments = 1;
+	toplevel_environments[0] = createTopLevelEnvironment (".GlobalEnv");
 }
 
 RObjectList::~RObjectList () {
@@ -121,19 +127,7 @@
 	for (unsigned int i = 0; i < env_count; ++i) {
 		QString name = env_names[i];
 		if (childmap.find (name) == childmap.end ()) {
-			REnvironmentObject *envobj = new REnvironmentObject (this, env_names[i]);
-
-			if (name == ".GlobalEnv") {
-				envobj->type |= GlobalEnv;
-			} else if (name.contains (':')) {
-				envobj->namespace_name = name.section (':', 1);
-			} else if (name == "Autoloads") {
-				envobj->type |= GlobalEnv;              // this is wrong! but it's a temporary HACK to get things to work
-			}
-
-			childmap.insert (name, envobj);
-			RKGlobals::tracker ()->addObject (envobj, 0);
-			envobj->updateFromR ();
+			createTopLevelEnvironment (name);
 		} else {
 			RObject *obj = childmap[name];
 			// for now, we only update the .GlobalEnv. All others we assume to be static
@@ -156,6 +150,26 @@
 	}
 }
 
+REnvironmentObject *RObjectList::createTopLevelEnvironment (const QString &name) {
+	RK_TRACE (OBJECTS);
+	RK_ASSERT (childmap.find (name) == childmap.end ());
+	REnvironmentObject *envobj = new REnvironmentObject (this, name);
+
+	if (name == ".GlobalEnv") {
+		envobj->type |= GlobalEnv;
+	} else if (name.contains (':')) {
+		envobj->namespace_name = name.section (':', 1);
+	} else if (name == "Autoloads") {
+		envobj->type |= GlobalEnv;              // this is wrong! but it's a temporary HACK to get things to work
+	}
+
+	childmap.insert (name, envobj);
+	RKGlobals::tracker ()->addObject (envobj, 0);
+	envobj->updateFromR ();
+
+	return envobj;
+}
+
 RObject *RObjectList::findObject (const QString &name, bool is_canonified) {
 	RK_TRACE (OBJECTS);
 
@@ -181,7 +195,7 @@
 	QString current_level = canonified.section (QChar ('$'), 0, 0);
 	QString remainder = canonified.section (QChar ('$'), 1);
 
-	for (int i = 0; i < num_toplevel_environments; ++i) {
+	for (unsigned int i = 0; i < num_toplevel_environments; ++i) {
 		RObject *found = toplevel_environments[i]->findChild (current_level);
 		if (found) {
 			if (remainder.isEmpty ()) return (found);
@@ -191,9 +205,23 @@
 	return 0;
 }
 
-bool RObjectList::updateStructure (RData *new_data) {
+RObject *RObjectList::createNewChild (const QString &name, RKEditor *creator, bool container, bool data_frame) {
 	RK_TRACE (OBJECTS);
+	RK_ASSERT (childmap.find (".GlobalEnv") != childmap.end ());
 
+	return (static_cast<RContainerObject *> (childmap[".GlobalEnv"])->createNewChild (name, creator, container, data_frame));
+}
+
+QString RObjectList::validizeName (const QString &child_name) {
+	RK_TRACE (OBJECTS);
+	RK_ASSERT (childmap.find (".GlobalEnv") != childmap.end ());
+
+	return (static_cast<RContainerObject *> (childmap[".GlobalEnv"])->validizeName (child_name));
+}
+
+bool RObjectList::updateStructure (RData *) {
+	RK_TRACE (OBJECTS);
+
 	RK_ASSERT (false);
 
 	return true;
@@ -223,8 +251,8 @@
 	if (removed_in_workspace) {
 		// remove from list of toplevel environments
 		REnvironmentObject **new_toplevel_envs = new REnvironmentObject*[num_toplevel_environments];
-		int num_new_toplevel_envs = 0;
-		for (int i=0; i < num_toplevel_environments; ++i) {
+		unsigned int num_new_toplevel_envs = 0;
+		for (unsigned int i=0; i < num_toplevel_environments; ++i) {
 			if (toplevel_environments[i] != object) new_toplevel_envs[num_new_toplevel_envs++] = toplevel_environments[i];
 		}
 		RK_ASSERT ((num_toplevel_environments - 1) == num_new_toplevel_envs);

Modified: trunk/rkward/rkward/core/robjectlist.h
===================================================================
--- trunk/rkward/rkward/core/robjectlist.h	2006-10-02 21:40:13 UTC (rev 793)
+++ trunk/rkward/rkward/core/robjectlist.h	2006-10-02 22:37:25 UTC (rev 794)
@@ -57,7 +57,14 @@
 	/** reimplemented from RContainerObject to search the environments in search order */
 	RObject *findObject (const QString &name, bool canonified=false);
 
+	/** reimplemented from RContainerObject to create the child in the .GlobalEnv */
+	RObject *createNewChild (const QString &name, RKEditor *creator=0, bool container=false, bool data_frame=false);
+	/** reimplemented from RContainerObject to validize the name in .GlobalEnv */
+	QString validizeName (const QString &child_name);
+
 	KURL getWorkspaceURL () { return current_url; };
+
+	static RObjectList *getObjectList () { return object_list; };
 public slots:
 	void timeout ();
 signals:
@@ -87,7 +94,11 @@
 	REnvironmentObject **toplevel_environments;
 	unsigned int num_toplevel_environments;
 
+	REnvironmentObject *createTopLevelEnvironment (const QString &name);
+
 	KURL current_url;
+
+	static RObjectList *object_list;
 };
 
 /**

Modified: trunk/rkward/rkward/misc/rkobjectlistview.cpp
===================================================================
--- trunk/rkward/rkward/misc/rkobjectlistview.cpp	2006-10-02 21:40:13 UTC (rev 793)
+++ trunk/rkward/rkward/misc/rkobjectlistview.cpp	2006-10-02 22:37:25 UTC (rev 794)
@@ -117,14 +117,14 @@
 
 void RKObjectListView::initialize (bool fetch_list) {
 	RK_TRACE (APP);
-	addObject (0, RKGlobals::rObjectList (), fetch_list);
+	addObject (0, RObjectList::getObjectList (), fetch_list);
 	
 	connect (RKGlobals::tracker (), SIGNAL (objectRemoved (RObject *)), this, SLOT (objectRemoved (RObject*)));
 	connect (RKGlobals::tracker (), SIGNAL (objectPropertiesChanged (RObject *)), this, SLOT (objectPropertiesChanged (RObject*)));
 	connect (RKGlobals::tracker (), SIGNAL (objectAdded (RObject *)), this, SLOT (objectAdded (RObject*)));
 
-	connect (RKGlobals::rObjectList (), SIGNAL (updateComplete ()), this, SLOT (updateComplete ()));
-	connect (RKGlobals::rObjectList (), SIGNAL (updateStarted ()), this, SLOT (updateStarted ()));
+	connect (RObjectList::getObjectList (), SIGNAL (updateComplete ()), this, SLOT (updateComplete ()));
+	connect (RObjectList::getObjectList (), SIGNAL (updateStarted ()), this, SLOT (updateStarted ()));
 
 	emit (listChanged ());
 	update_in_progress = false;
@@ -150,8 +150,11 @@
 void RKObjectListView::objectAdded (RObject *object) {
 	RK_TRACE (APP);
 
-	RKListViewItem *parent = findObjectItem (object->getContainer ());
-	RK_ASSERT (parent);
+	RKListViewItem *parent = 0;
+	if (!object->isType (RObject::Workspace)) {
+		parent = findObjectItem (object->getContainer ());
+		RK_ASSERT (parent);
+	}
 	addObject (parent, object, true);
 	
 	if (update_in_progress) {

Modified: trunk/rkward/rkward/plugin/rkcomponentproperties.cpp
===================================================================
--- trunk/rkward/rkward/plugin/rkcomponentproperties.cpp	2006-10-02 21:40:13 UTC (rev 793)
+++ trunk/rkward/rkward/plugin/rkcomponentproperties.cpp	2006-10-02 22:37:25 UTC (rev 794)
@@ -794,7 +794,7 @@
 	QStringList slist = QStringList::split (separator, value);
 
 	for (QStringList::const_iterator it = slist.begin (); it != slist.end (); ++it) {
-		RObject *obj = RKGlobals::rObjectList ()->findObject (value);
+		RObject *obj = RObjectList::getObjectList ()->findObject (value);
 		if (obj && isObjectValid (obj)) {
 			object_list.append (obj);
 		} else {
@@ -813,7 +813,7 @@
 	QStringList slist = QStringList::split (separator, value);
 
 	for (QStringList::const_iterator it = slist.begin (); it != slist.end (); ++it) {
-		RObject *obj = RKGlobals::rObjectList ()->findObject (value);
+		RObject *obj = RObjectList::getObjectList ()->findObject (value);
 		if (!(obj && isObjectValid (obj))) {
 			return false;
 		}

Modified: trunk/rkward/rkward/plugin/rkvarselector.cpp
===================================================================
--- trunk/rkward/rkward/plugin/rkvarselector.cpp	2006-10-02 21:40:13 UTC (rev 793)
+++ trunk/rkward/rkward/plugin/rkvarselector.cpp	2006-10-02 22:37:25 UTC (rev 794)
@@ -36,7 +36,7 @@
 	addChild ("available", available = new RKComponentPropertyRObjects (this, false));
 	addChild ("selected", selected = new RKComponentPropertyRObjects (this, false));
 
-	RKGlobals::rObjectList ()->updateFromR ();
+	RObjectList::getObjectList ()->updateFromR ();
 	QVBoxLayout  *vbox = new QVBoxLayout (this, RKGlobals::spacingHint ());
 	
 	QLabel *label = new QLabel (element.attribute ("label", "Select Variable(s)"), this);

Modified: trunk/rkward/rkward/rbackend/rinterface.cpp
===================================================================
--- trunk/rkward/rkward/rbackend/rinterface.cpp	2006-10-02 21:40:13 UTC (rev 793)
+++ trunk/rkward/rkward/rbackend/rinterface.cpp	2006-10-02 22:37:25 UTC (rev 794)
@@ -284,14 +284,14 @@
 		RObject *obj = 0;
 		if (request->call_length >= 2) {
 			QString object_name = request->call[1];
-			obj = RKGlobals::rObjectList ()->findObject (object_name);
+			obj = RObjectList::getObjectList ()->findObject (object_name);
 		}
 		if (obj) {
 			RObject::ChangeSet *set = new RObject::ChangeSet;
 			set->from_index = -1;
 			set->to_index = -1;
 			// for now a complete update is needed, in case new objects were added
-			RKGlobals::rObjectList ()->updateFromR ();
+			RObjectList::getObjectList ()->updateFromR ();
 			RKGlobals::tracker ()->objectDataChanged (obj, set);
 			
 			issueCommand (".rk.rkreply <- \"Sync scheduled for object '" + obj->getFullName () + "'\"", RCommand::App | RCommand::Sync, QString::null, 0, 0, request->in_chain);

Modified: trunk/rkward/rkward/rkglobals.cpp
===================================================================
--- trunk/rkward/rkward/rkglobals.cpp	2006-10-02 21:40:13 UTC (rev 793)
+++ trunk/rkward/rkward/rkglobals.cpp	2006-10-02 22:37:25 UTC (rev 794)
@@ -19,7 +19,6 @@
 #include <qstring.h>
 
 RInterface *RKGlobals::rinter;
-RObjectList *RKGlobals::list;
 RKModificationTracker *RKGlobals::mtracker;
 RKComponentMap *RKGlobals::cmap;
 KHelpDlg *RKGlobals::helpdlg;

Modified: trunk/rkward/rkward/rkglobals.h
===================================================================
--- trunk/rkward/rkward/rkglobals.h	2006-10-02 21:40:13 UTC (rev 793)
+++ trunk/rkward/rkward/rkglobals.h	2006-10-02 22:37:25 UTC (rev 794)
@@ -42,8 +42,6 @@
 
 /// static pointer to the RInterface
 	static RInterface *rInterface () { return rinter; };
-/// static pointer to the RObjectList
-	static RObjectList *rObjectList () { return list; };
 /// static pointer to the RKModificationTracker
 	static RKModificationTracker *tracker () { return mtracker; };
 /// static pointer to the RKComponentMap
@@ -66,7 +64,6 @@
 private:
 	friend class RKwardApp;
 	static RInterface *rinter;
-	static RObjectList *list;
 	static RKModificationTracker *mtracker;
 	static RKComponentMap *cmap;
 	static KHelpDlg *helpdlg;

Modified: trunk/rkward/rkward/rkward.cpp
===================================================================
--- trunk/rkward/rkward/rkward.cpp	2006-10-02 21:40:13 UTC (rev 793)
+++ trunk/rkward/rkward/rkward.cpp	2006-10-02 22:37:25 UTC (rev 794)
@@ -96,7 +96,6 @@
 
 	rkward_app = this;
 	RKGlobals::rinter = 0;
-	RKGlobals::list = 0;
 	RKSettings::settings_tracker = new RKSettingsTracker (this);
 	
 	// Nice docks a la Kdevelop.
@@ -153,7 +152,7 @@
 	RK_TRACE (APP);
 	closeAllViews ();
 	delete RKGlobals::rInterface ();
-	delete RKGlobals::rObjectList ();
+	delete RObjectList::getObjectList ();
 	delete object_browser;
 	delete RKGlobals::tracker ();
 }
@@ -211,7 +210,7 @@
 		} else if (result->result == StartupDialog::ChoseFile) {
 			slotFileOpenWorkspace ();
 		} else if (result->result == StartupDialog::EmptyTable) {
-			RObject *object = RKGlobals::rObjectList ()->createNewChild (i18n ("my.data"), 0, true, true);
+			RObject *object = RObjectList::getObjectList ()->createNewChild (i18n ("my.data"), 0, true, true);
 			// usually an explicit call to activateView should not be necessary. Somehow however, here, it is.
 			RKWorkplace::mainWorkplace ()->editObject (object, true);
 		}
@@ -259,7 +258,7 @@
 	}
 	
 	RKGlobals::rinter = new RInterface ();
-	RKGlobals::list = new RObjectList ();
+	new RObjectList ();
 
 	RKGlobals::rInterface ()->startThread ();
 	object_browser->initialize ();
@@ -461,11 +460,11 @@
 	slotSetStatusBarText (i18n ("Exiting..."));
 	saveOptions ();
 
-	if (!RKGlobals::rObjectList ()->isEmpty ()) {
+	if (!RObjectList::getObjectList ()->isEmpty ()) {
 		int res;
 		res = KMessageBox::questionYesNoCancel (this, i18n ("Quitting RKWard: Do you want to save the workspace?\nRKWard will remain open if you press Cancel"), i18n ("Save Workspace?"));
 		if (res == KMessageBox::Yes) {
-			new RKSaveAgent (RKGlobals::rObjectList ()->getWorkspaceURL (), false, RKSaveAgent::Quit);
+			new RKSaveAgent (RObjectList::getObjectList ()->getWorkspaceURL (), false, RKSaveAgent::Quit);
 		} else if (res != KMessageBox::No) {
 			slotSetStatusReady ();
 			return false;
@@ -512,9 +511,9 @@
 	QString name = KInputDialog::getText (i18n ("New dataset"), i18n ("Enter name for the new dataset"), "my.data", &ok, this);
 
 	if (ok) {
-		QString valid = RKGlobals::rObjectList ()->validizeName (name);
+		QString valid = RObjectList::getObjectList ()->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 *object = RKGlobals::rObjectList ()->createNewChild (valid, 0, true, true);
+		RObject *object = RObjectList::getObjectList ()->createNewChild (valid, 0, true, true);
 		RKWorkplace::mainWorkplace ()->editObject (object, true);
 	}
 	
@@ -538,7 +537,7 @@
 
 void RKwardApp::fileOpenAskSave (const KURL &url) {
 	RK_TRACE (APP);
-	if (RKGlobals::rObjectList ()->isEmpty ()) {
+	if (RObjectList::getObjectList ()->isEmpty ()) {
 		fileOpenNoSave (url);
 		return;
 	}
@@ -548,7 +547,7 @@
 	if (res == KMessageBox::No) {
 		fileOpenNoSave (url);
 	} else if (res == KMessageBox::Yes) {
-		new RKSaveAgent (RKGlobals::rObjectList ()->getWorkspaceURL (), false, RKSaveAgent::Load, url);
+		new RKSaveAgent (RObjectList::getObjectList ()->getWorkspaceURL (), false, RKSaveAgent::Load, url);
 	}
 	// else: cancel. Don't do anything
 }
@@ -572,12 +571,12 @@
 
 void RKwardApp::slotFileSaveWorkspace () {
 	RK_TRACE (APP);
-	new RKSaveAgent (RKGlobals::rObjectList ()->getWorkspaceURL ());
+	new RKSaveAgent (RObjectList::getObjectList ()->getWorkspaceURL ());
 }
 
 void RKwardApp::slotFileSaveWorkspaceAs () {
 	RK_TRACE (APP);
-	new RKSaveAgent (RKGlobals::rObjectList ()->getWorkspaceURL (), true);
+	new RKSaveAgent (RObjectList::getObjectList ()->getWorkspaceURL (), true);
 }
 
 void RKwardApp::slotSetStatusBarText (const QString &text) {
@@ -685,8 +684,8 @@
 void RKwardApp::setCaption (const QString &) {
 	RK_TRACE (APP);
 
-	QString wcaption = RKGlobals::rObjectList ()->getWorkspaceURL ().fileName ();
-	if (wcaption.isEmpty ()) wcaption = RKGlobals::rObjectList ()->getWorkspaceURL ().prettyURL ();
+	QString wcaption = RObjectList::getObjectList ()->getWorkspaceURL ().fileName ();
+	if (wcaption.isEmpty ()) wcaption = RObjectList::getObjectList ()->getWorkspaceURL ().prettyURL ();
 	if (wcaption.isEmpty ()) wcaption = i18n ("[Unnamed Workspace]");
 	wcaption.append (" - " + RKWorkplace::mainWorkplace ()->view ()->activeCaption ());
 	KMdiMainFrm::setCaption (wcaption);

Modified: trunk/rkward/rkward/robjectbrowser.cpp
===================================================================
--- trunk/rkward/rkward/robjectbrowser.cpp	2006-10-02 21:40:13 UTC (rev 793)
+++ trunk/rkward/rkward/robjectbrowser.cpp	2006-10-02 22:37:25 UTC (rev 794)
@@ -66,13 +66,13 @@
 }
 
 void RObjectBrowser::initialize () {
-	list_view->initialize (false);
+	list_view->initialize (true);
 	
 	connect (update_button, SIGNAL (clicked ()), this, SLOT (updateButtonClicked ()));
 }
 
 void RObjectBrowser::updateButtonClicked () {
-	RKGlobals::rObjectList ()->updateFromR ();
+	RObjectList::getObjectList ()->updateFromR ();
 }
 
 void RObjectBrowser::popupEdit () {
@@ -103,7 +103,7 @@
 	RObject *object = list_view->menuObject ();
 	QPopupMenu *menu = list_view->contextMenu ();
 
-	if ((!object) || (object == RKGlobals::rObjectList ())) {
+	if ((!object) || (object == RObjectList::getObjectList ())) {
 		menu->setItemVisible (Edit, false);
 		menu->setItemVisible (View, false);
 		menu->setItemVisible (Rename, false);
@@ -123,7 +123,7 @@
 	RObject *object = list_view->findItemObject (static_cast<RKListViewItem*> (item));
 	
 	if (!object) return;
-	if (object == RKGlobals::rObjectList ()) return;
+	if (object == RObjectList::getObjectList ()) return;
 	QWidget *w = RKWorkplace::mainWorkplace ()->activeAttachedWindow ();
 	if (!w) return;
 	

Modified: trunk/rkward/rkward/windows/rkworkplace.cpp
===================================================================
--- trunk/rkward/rkward/windows/rkworkplace.cpp	2006-10-02 21:40:13 UTC (rev 793)
+++ trunk/rkward/rkward/windows/rkworkplace.cpp	2006-10-02 22:37:25 UTC (rev 794)
@@ -288,7 +288,7 @@
 		QString specification = desc.section (QChar (':'), 1);
 
 		if (type == "data") {
-			RObject *object = RKGlobals::rObjectList ()->findObject (specification);
+			RObject *object = RObjectList::getObjectList ()->findObject (specification);
 			if (object) editObject (object, false);
 		} else if (type == "script") {
 			openScriptEditor (specification);


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