[rkward-cvs] SF.net SVN: rkward: [2274] branches/KDE4_port/rkward

tfry at users.sourceforge.net tfry at users.sourceforge.net
Mon Nov 26 13:37:43 UTC 2007


Revision: 2274
          http://rkward.svn.sourceforge.net/rkward/?rev=2274&view=rev
Author:   tfry
Date:     2007-11-26 05:37:42 -0800 (Mon, 26 Nov 2007)

Log Message:
-----------
Take care of some warnings

Modified Paths:
--------------
    branches/KDE4_port/rkward/core/rcontainerobject.cpp
    branches/KDE4_port/rkward/core/rcontainerobject.h
    branches/KDE4_port/rkward/core/robjectlist.cpp
    branches/KDE4_port/rkward/core/robjectlist.h
    branches/KDE4_port/rkward/dataeditor/rkeditordataframe.cpp
    branches/KDE4_port/rkward/dialogs/rkloadlibsdialog.cpp
    branches/KDE4_port/rkward/dialogs/startupdialog.cpp
    branches/KDE4_port/rkward/misc/rksaveobjectchooser.cpp

Modified: branches/KDE4_port/rkward/core/rcontainerobject.cpp
===================================================================
--- branches/KDE4_port/rkward/core/rcontainerobject.cpp	2007-11-26 12:15:54 UTC (rev 2273)
+++ branches/KDE4_port/rkward/core/rcontainerobject.cpp	2007-11-26 13:37:42 UTC (rev 2274)
@@ -296,6 +296,7 @@
 
 RObject *RContainerObject::createPendingChild (const QString &name, int position, bool container, bool data_frame) {
 	RK_TRACE (OBJECTS);
+	RK_ASSERT (isType (GlobalEnv) || isInGlobalEnv ());
 
 #warning TODO validize name
 	RObject *ret;
@@ -398,6 +399,7 @@
 
 QString RContainerObject::validizeName (const QString &child_name, bool unique) const {
 	RK_TRACE (OBJECTS);
+	RK_ASSERT (isType (GlobalEnv) || isInGlobalEnv ());
 
 	QString ret = child_name;
 	if (ret.isEmpty ()) ret = "var";

Modified: branches/KDE4_port/rkward/core/rcontainerobject.h
===================================================================
--- branches/KDE4_port/rkward/core/rcontainerobject.h	2007-11-26 12:15:54 UTC (rev 2273)
+++ branches/KDE4_port/rkward/core/rcontainerobject.h	2007-11-26 13:37:42 UTC (rev 2274)
@@ -58,13 +58,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 necessary) changed to a legal value. TODO: checking for and changing illegal names is not yet implemented */
-	virtual RObject *createPendingChild (const QString &name, int position=-1, bool container=false, bool data_frame=false);
+	RObject *createPendingChild (const QString &name, int position=-1, 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 () const { return childmap.isEmpty (); };
 
 	/** given child_name, constructs a name which is as close as possible to the orginial but valid (i.e. not already in use, not contaning illegal characters */
-	virtual QString validizeName (const QString &child_name, bool unique=true) const;
+	QString validizeName (const QString &child_name, bool unique=true) const;
 
 	/** reimplemented from RObject to actually search for the object */
 	virtual RObject *findObject (const QString &name, bool is_canonified=false) const;

Modified: branches/KDE4_port/rkward/core/robjectlist.cpp
===================================================================
--- branches/KDE4_port/rkward/core/robjectlist.cpp	2007-11-26 12:15:54 UTC (rev 2273)
+++ branches/KDE4_port/rkward/core/robjectlist.cpp	2007-11-26 13:37:42 UTC (rev 2274)
@@ -209,18 +209,6 @@
 	return 0;
 }
 
-RObject *RObjectList::createPendingChild (const QString &name, int position, bool container, bool data_frame) {
-	RK_TRACE (OBJECTS);
-#warning TODO: this is bad style. Callers should call this on getGlobalEnv() directly.
-	return (getGlobalEnv ()->createPendingChild (name, position, container, data_frame));
-}
-
-QString RObjectList::validizeName (const QString &child_name, bool unique) const {
-	RK_TRACE (OBJECTS);
-
-	return (getGlobalEnv ()->validizeName (child_name, unique));
-}
-
 bool RObjectList::updateStructure (RData *) {
 	RK_TRACE (OBJECTS);
 

Modified: branches/KDE4_port/rkward/core/robjectlist.h
===================================================================
--- branches/KDE4_port/rkward/core/robjectlist.h	2007-11-26 12:15:54 UTC (rev 2273)
+++ branches/KDE4_port/rkward/core/robjectlist.h	2007-11-26 13:37:42 UTC (rev 2274)
@@ -58,12 +58,6 @@
 	/** reimplemented from RContainerObject to search the environments in search order */
 	void findObjectsMatching (const QString &partial_name, RObjectSearchMap *current_list, bool name_is_canonified=false) const;
 
-	/** reimplemented from RContainerObject to create the child in the .GlobalEnv */
-	RObject *createPendingChild (const QString &name, int position=-1, bool container=false, bool data_frame=false);
-
-	/** reimplemented from RContainerObject to validize the name in .GlobalEnv */
-	QString validizeName (const QString &child_name, bool unique=true) const;
-
 	KUrl getWorkspaceURL () const { return current_url; };
 
 	REnvironmentObject* findChildByNamespace (const QString &namespacename) const;

Modified: branches/KDE4_port/rkward/dataeditor/rkeditordataframe.cpp
===================================================================
--- branches/KDE4_port/rkward/dataeditor/rkeditordataframe.cpp	2007-11-26 12:15:54 UTC (rev 2273)
+++ branches/KDE4_port/rkward/dataeditor/rkeditordataframe.cpp	2007-11-26 13:37:42 UTC (rev 2274)
@@ -26,7 +26,7 @@
 #include "rkvareditmodel.h"
 #include "../core/robject.h"
 #include "../core/robjectlist.h"
-#include "../core/rkvariable.h"
+#include "../core/renvironmentobject.h"
 #include "../core/rcontainerobject.h"
 #include "rkeditordataframepart.h"
 #include "../windows/rkworkplace.h"
@@ -58,10 +58,10 @@
 
 	commonInit ();
 
-	QString valid = RObjectList::getObjectList ()->validizeName (new_object_name);
+	QString valid = RObjectList::getGlobalEnv ()->validizeName (new_object_name);
 	if (valid != new_object_name) KMessageBox::sorry (this, i18n ("The name you specified was already in use or not valid. Renamed to %1", valid), i18n ("Invalid Name"));
 
-	RKVarEditDataFrameModel* model = new RKVarEditDataFrameModel (valid, RObjectList::getObjectList (), open_chain, 5, this);
+	RKVarEditDataFrameModel* model = new RKVarEditDataFrameModel (valid, RObjectList::getGlobalEnv (), open_chain, 5, this);
 
 	RKEditor::object = model->getObject ();;
 	RK_ASSERT (object->isDataFrame ());

Modified: branches/KDE4_port/rkward/dialogs/rkloadlibsdialog.cpp
===================================================================
--- branches/KDE4_port/rkward/dialogs/rkloadlibsdialog.cpp	2007-11-26 12:15:54 UTC (rev 2273)
+++ branches/KDE4_port/rkward/dialogs/rkloadlibsdialog.cpp	2007-11-26 13:37:42 UTC (rev 2274)
@@ -241,7 +241,6 @@
 	RK_TRACE (DIALOGS);
 	RK_ASSERT (installation_process);
 
-//TODO Somehow we add too many newlines, here -> kdesu issue
 	emit (installationError (QString::fromLocal8Bit (installation_process->readAllStandardError ())));
 }
 

Modified: branches/KDE4_port/rkward/dialogs/startupdialog.cpp
===================================================================
--- branches/KDE4_port/rkward/dialogs/startupdialog.cpp	2007-11-26 12:15:54 UTC (rev 2273)
+++ branches/KDE4_port/rkward/dialogs/startupdialog.cpp	2007-11-26 13:37:42 UTC (rev 2274)
@@ -69,11 +69,7 @@
 	file_list->setSortingEnabled (false);
 	chose_file_item = new QListWidgetItem (i18n ("<<Open another file>>"), file_list);
 	if (recent_files) {
-		QStringList items = recent_files->items ();
-		for (QStringList::iterator it = items.begin (); it != items.end (); ++it) {
-#warning this is no longer correct, as the text is a label + url, not only the url
-			if (!(*it).isEmpty ()) new QListWidgetItem ((*it), file_list);
-		}
+		file_list->addItems (recent_files->urls ().toStringList ());
 	}
 	connect (file_list, SIGNAL (itemClicked (QListWidgetItem*)), this, SLOT (listClicked (QListWidgetItem*)));
 	connect (file_list, SIGNAL (itemDoubleClicked (QListWidgetItem*)), this, SLOT (listDoubleClicked (QListWidgetItem*)));

Modified: branches/KDE4_port/rkward/misc/rksaveobjectchooser.cpp
===================================================================
--- branches/KDE4_port/rkward/misc/rksaveobjectchooser.cpp	2007-11-26 12:15:54 UTC (rev 2273)
+++ branches/KDE4_port/rkward/misc/rksaveobjectchooser.cpp	2007-11-26 13:37:42 UTC (rev 2274)
@@ -24,7 +24,8 @@
 
 #include <klocale.h>
 
-#include <../core/robjectlist.h>
+#include "../core/robjectlist.h"
+#include "../core/renvironmentobject.h"
 
 #include "../debug.h"
 
@@ -66,7 +67,7 @@
 QString RKSaveObjectChooser::validizedSelectedObjectName () {
 	RK_TRACE (MISC);
 
-	return (RObjectList::getObjectList ()->validizeName (name_edit->text (), false));
+	return (RObjectList::getGlobalEnv ()->validizeName (name_edit->text (), false));
 }
 
 bool RKSaveObjectChooser::isOk () const {


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