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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Sun Mar 11 19:34:33 UTC 2007


Revision: 1562
          http://svn.sourceforge.net/rkward/?rev=1562&view=rev
Author:   tfry
Date:     2007-03-11 12:34:32 -0700 (Sun, 11 Mar 2007)

Log Message:
-----------
Prepare death of the cleanup section

Modified Paths:
--------------
    trunk/rkward/ChangeLog
    trunk/rkward/rkward/plugin/rkcomponentproperties.cpp
    trunk/rkward/rkward/plugin/rkcomponentproperties.h
    trunk/rkward/rkward/plugin/rkstandardcomponent.cpp
    trunk/rkward/rkward/scriptbackends/phpbackend.cpp
    trunk/rkward/rkward/scriptbackends/phpbackend.h
    trunk/rkward/rkward/scriptbackends/scriptbackend.h

Modified: trunk/rkward/ChangeLog
===================================================================
--- trunk/rkward/ChangeLog	2007-03-11 19:27:53 UTC (rev 1561)
+++ trunk/rkward/ChangeLog	2007-03-11 19:34:32 UTC (rev 1562)
@@ -1,3 +1,4 @@
+- plugin generated commands are run in a local() environment, allowing for more consise code		TODO: document, adjust examples, adjust plugins, etc.
 - also support filename completion in the console (mode of completion is determined by heuristic means)
 - initial support for R's Sys.setlocale(), and Encoding of CHARSXPs
 - in help files, a short title for sections (for the navigation bar) can be defined		TODO: document

Modified: trunk/rkward/rkward/plugin/rkcomponentproperties.cpp
===================================================================
--- trunk/rkward/rkward/plugin/rkcomponentproperties.cpp	2007-03-11 19:27:53 UTC (rev 1561)
+++ trunk/rkward/rkward/plugin/rkcomponentproperties.cpp	2007-03-11 19:34:32 UTC (rev 1562)
@@ -1003,7 +1003,7 @@
 RKComponentPropertyCode::RKComponentPropertyCode (QObject *parent, bool required) : RKComponentPropertyBase (parent, required) {
 	RK_TRACE (PLUGIN);
 
-	preprocess_code = calculate_code = printout_code = cleanup_code = QString ();
+	preprocess_code = calculate_code = printout_code = QString ();
 }
 
 RKComponentPropertyCode::~RKComponentPropertyCode () {
@@ -1016,10 +1016,9 @@
 	if (modifier == "preprocess") return preprocess ();
 	if (modifier == "calculate") return calculate ();
 	if (modifier == "printout") return printout ();
-	if (modifier == "cleanup") return cleanup ();
 	if (!modifier.isEmpty ()) warnModifierNotRecognized (modifier);
 
-	return (preprocess () + calculate () + printout () + cleanup ());
+	return (preprocess () + calculate () + printout ());
 }
 
 /////////////////////////////////////////// Convert ////////////////////////////////////////////////

Modified: trunk/rkward/rkward/plugin/rkcomponentproperties.h
===================================================================
--- trunk/rkward/rkward/plugin/rkcomponentproperties.h	2007-03-11 19:27:53 UTC (rev 1561)
+++ trunk/rkward/rkward/plugin/rkcomponentproperties.h	2007-03-11 19:34:32 UTC (rev 1562)
@@ -294,7 +294,7 @@
 
 ///////////////////////////////////////////////// Code ////////////////////////////////////////////////////////
 
-/** special type of RKComponentProperty used to contain R code. All stand-alone RKComponents have this. The great thing about this, is that code can be made available to embedding RKComponents by just fetching the component.code.preprocess (or .calculate, .printout, .cleanup) value */
+/** special type of RKComponentProperty used to contain R code. All stand-alone RKComponents have this. The great thing about this, is that code can be made available to embedding RKComponents by just fetching the component.code.preprocess (or .calculate, .printout) value */
 class RKComponentPropertyCode : public RKComponentPropertyBase {
 	Q_OBJECT
 public:
@@ -308,8 +308,6 @@
 	QString calculate () { return calculate_code; };
 /** the printout code */		// TODO, maybe we can abstract this away. A component should _either_ do calculation _or_ printout, hence it could all be calculate () only, as well.
 	QString printout () { return printout_code; };
-/** the cleanup code */
-	QString cleanup () { return cleanup_code; };
 /** the preview code */
 	QString preview () { return preview_code; };
 
@@ -322,12 +320,10 @@
 	void setCalculate (const QString &code) { calculate_code = code; emit (valueChanged (this)); };
 /** see setPreprocess () */
 	void setPrintout (const QString &code) { printout_code = code; emit (valueChanged (this)); };
-/** see setPreprocess () */
-	void setCleanup (const QString &code) { cleanup_code = code; emit (valueChanged (this)); };
 /** see setPreview () */
 	void setPreview (const QString &code) { preview_code = code; emit (valueChanged (this)); };
 
-	bool isValid () { return (!(preprocess_code.isNull () || calculate_code.isNull () || printout_code.isNull () || cleanup_code.isNull ())); };
+	bool isValid () { return (!(preprocess_code.isNull () || calculate_code.isNull () || printout_code.isNull ())); };
 
 /** RTTI */
 	int type () { return PropertyCode; };
@@ -335,7 +331,6 @@
 	QString preprocess_code;
 	QString calculate_code;
 	QString printout_code;
-	QString cleanup_code;
 	QString preview_code;
 };
 

Modified: trunk/rkward/rkward/plugin/rkstandardcomponent.cpp
===================================================================
--- trunk/rkward/rkward/plugin/rkstandardcomponent.cpp	2007-03-11 19:27:53 UTC (rev 1561)
+++ trunk/rkward/rkward/plugin/rkstandardcomponent.cpp	2007-03-11 19:34:32 UTC (rev 1562)
@@ -317,7 +317,6 @@
 	backend->preprocess (0);
 	backend->calculate (0);
 	backend->printout (0);
-	backend->cleanup (0);
 	backend->preview (0);
 
 	if (gui) {

Modified: trunk/rkward/rkward/scriptbackends/phpbackend.cpp
===================================================================
--- trunk/rkward/rkward/scriptbackends/phpbackend.cpp	2007-03-11 19:27:53 UTC (rev 1561)
+++ trunk/rkward/rkward/scriptbackends/phpbackend.cpp	2007-03-11 19:34:32 UTC (rev 1562)
@@ -128,8 +128,6 @@
 			code_property->setCalculate (QString::null);
 		} else if (type == Printout) {
 			code_property->setPrintout (QString::null);
-		} else if (type == Cleanup) {
-			code_property->setCleanup (QString::null);
 		} else if (type == Preview) {
 			code_property->setPreview (QString::null);
 		}
@@ -276,10 +274,6 @@
 						if (add_headings) code_property->setPrintout (i18n ("## Print result\n") + retrieveOutput ());
 						else code_property->setPrintout (retrieveOutput ());
 						resetOutput ();
-					} else if (current_type == Cleanup) {
-						if (add_headings) code_property->setCleanup (i18n ("## Clean up\n") + retrieveOutput ());
-						else code_property->setCleanup (retrieveOutput ());
-						resetOutput ();
 					} else if (current_type == Preview) {
 						// no heading for the preview code (not shown in the code box)
 						code_property->setPreview (retrieveOutput ());

Modified: trunk/rkward/rkward/scriptbackends/phpbackend.h
===================================================================
--- trunk/rkward/rkward/scriptbackends/phpbackend.h	2007-03-11 19:27:53 UTC (rev 1561)
+++ trunk/rkward/rkward/scriptbackends/phpbackend.h	2007-03-11 19:34:32 UTC (rev 1562)
@@ -46,7 +46,6 @@
 	void preprocess (int flags) { callFunction ("preprocess ();", flags, Preprocess); };
 	void calculate (int flags) { callFunction ("calculate ();", flags, Calculate); };
 	void printout (int flags) { callFunction ("printout ();", flags, Printout); };
-	void cleanup (int flags) { callFunction ("cleanup ();", flags, Cleanup); };
 	void preview (int flags) { callFunction ("getPreview ();", flags, Preview); };
 	void writeData (const QString &data);
 public slots:

Modified: trunk/rkward/rkward/scriptbackends/scriptbackend.h
===================================================================
--- trunk/rkward/rkward/scriptbackends/scriptbackend.h	2007-03-11 19:27:53 UTC (rev 1561)
+++ trunk/rkward/rkward/scriptbackends/scriptbackend.h	2007-03-11 19:34:32 UTC (rev 1562)
@@ -39,7 +39,6 @@
 		Preprocess = 0,
 		Calculate = 1,
 		Printout = 2,
-		Cleanup = 3,
 		Preview = 4,
 		Ignore = 5,
 		User = 6
@@ -56,7 +55,6 @@
 	virtual void preprocess (int flags) = 0;
 	virtual void calculate (int flags) = 0;
 	virtual void printout (int flags) = 0;
-	virtual void cleanup (int flags) = 0;
 	virtual void preview (int flags) = 0;
 	
 	virtual bool isBusy () { return busy; };


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