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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Tue Oct 16 10:12:53 UTC 2007


Revision: 2079
          http://rkward.svn.sourceforge.net/rkward/?rev=2079&view=rev
Author:   tfry
Date:     2007-10-16 03:12:52 -0700 (Tue, 16 Oct 2007)

Log Message:
-----------
Properly relay commands back and forth

Modified Paths:
--------------
    branches/KDE4_port/rkward/rbackend/rembedinternal.cpp
    branches/KDE4_port/rkward/rbackend/rinterface.cpp
    branches/KDE4_port/rkward/rbackend/rinterface.h

Modified: branches/KDE4_port/rkward/rbackend/rembedinternal.cpp
===================================================================
--- branches/KDE4_port/rkward/rbackend/rembedinternal.cpp	2007-10-16 09:19:11 UTC (rev 2078)
+++ branches/KDE4_port/rkward/rbackend/rembedinternal.cpp	2007-10-16 10:12:52 UTC (rev 2079)
@@ -25,8 +25,6 @@
 #define FALSE (const bool)!0
 #include <qstring.h>
 #include <qtextcodec.h>
-//Added by qt3to4:
-#include <Q3CString>
 #include "../core/robject.h"
 #include "../debug.h"
 #undef TRUE
@@ -710,9 +708,8 @@
 	ParseStatus status = PARSE_NULL;
 	SEXP cv, pr;
 
-	int len = -1;
-	Q3CString localc = REmbedInternal::this_pointer->current_locale_codec->fromUnicode (command_qstring, len);		// needed so the string below does not go out of scope
-	const char *command = localc;
+	QByteArray localc = REmbedInternal::this_pointer->current_locale_codec->fromUnicode (command_qstring);		// needed so the string below does not go out of scope
+	const char *command = localc.data ();
 
 	PROTECT(cv=allocVector(STRSXP, 1));
 	SET_VECTOR_ELT(cv, 0, mkChar(command));  
@@ -885,9 +882,8 @@
 		R_ReplDLLinit ();		// resets the parse buffer (things might be left over from a previous incomplete parse)
 		bool prev_iteration_was_incomplete = false;
 
-		int len = -1;
-		Q3CString localc = current_locale_codec->fromUnicode (command_qstring, len);		// needed so the string below does not go out of scope
-		current_buffer = localc;
+		QByteArray localc = current_locale_codec->fromUnicode (command_qstring);		// needed so the string below does not go out of scope
+		current_buffer = localc.data ();
 
 		repldll_buffer_transfer_finished = false;
 		Rboolean ok = (Rboolean) 1;	// set to false, if there is a jump during the R_ToplevelExec (i.e.. some sort of error)

Modified: branches/KDE4_port/rkward/rbackend/rinterface.cpp
===================================================================
--- branches/KDE4_port/rkward/rbackend/rinterface.cpp	2007-10-16 09:19:11 UTC (rev 2078)
+++ branches/KDE4_port/rkward/rbackend/rinterface.cpp	2007-10-16 10:12:52 UTC (rev 2079)
@@ -134,10 +134,10 @@
 	 return r_thread->current_command;
 }
 
-void RInterface::customEvent (QCustomEvent *e) {
+void RInterface::customEvent (QEvent *e) {
 	RK_TRACE (RBACKEND);
 	if (e->type () == RCOMMAND_OUTPUT_EVENT) {
-		RThread::ROutputContainer *container = (static_cast <RThread::ROutputContainer *> (e->data ()));
+		RThread::ROutputContainer *container = (static_cast <RThread::ROutputContainer *> (static_cast<QCustomEvent*> (e)->data ()));
 		container->command->newOutput (container->output);
 		delete container;
 
@@ -149,10 +149,10 @@
 			r_thread->pauseOutput (false);
 		}
 	} else if (e->type () == RCOMMAND_IN_EVENT) {
-		RKCommandLog::getLog ()->addInput (static_cast <RCommand *> (e->data ()));
-		RControlWindow::getControl ()->setCommandRunning (static_cast <RCommand *> (e->data ()));
+		RKCommandLog::getLog ()->addInput (static_cast <RCommand *> (static_cast<QCustomEvent*> (e)->data ()));
+		RControlWindow::getControl ()->setCommandRunning (static_cast <RCommand *> (static_cast<QCustomEvent*> (e)->data ()));
 	} else if (e->type () == RCOMMAND_OUT_EVENT) {
-		RCommand *command = static_cast <RCommand *> (e->data ());
+		RCommand *command = static_cast <RCommand *> (static_cast<QCustomEvent*> (e)->data ());
 		if (command->status & RCommand::Canceled) {
 			command->status |= RCommand::HasError;
 			ROutput *out = new ROutput;
@@ -181,10 +181,10 @@
 		RKWardMainWindow::getMain ()->setRStatus (true);
 	} else if ((e->type () == R_EVAL_REQUEST_EVENT)) {
 		r_thread->pauseOutput (false); // we may be recursing downwards into event loops here. Hence we need to make sure, we don't create a deadlock
-		processREvalRequest (static_cast<REvalRequest *> (e->data ()));
+		processREvalRequest (static_cast<REvalRequest *> (static_cast<QCustomEvent*> (e)->data ()));
 	} else if ((e->type () == R_CALLBACK_REQUEST_EVENT)) {
 		r_thread->pauseOutput (false); // see above
-		processRCallbackRequest (static_cast<RCallbackArgs *> (e->data ()));
+		processRCallbackRequest (static_cast<RCallbackArgs *> (static_cast<QCustomEvent*> (e)->data ()));
 	} else if ((e->type () == RSTARTED_EVENT)) {
 		r_thread->unlock (RThread::Startup);
 	} else if ((e->type () > RSTARTUP_ERROR_EVENT)) {

Modified: branches/KDE4_port/rkward/rbackend/rinterface.h
===================================================================
--- branches/KDE4_port/rkward/rbackend/rinterface.h	2007-10-16 09:19:11 UTC (rev 2078)
+++ branches/KDE4_port/rkward/rbackend/rinterface.h	2007-10-16 10:12:52 UTC (rev 2079)
@@ -113,7 +113,7 @@
 	void startThread ();
 protected:
 /** needed to handle the QCustomEvent s, the RThread is sending (notifications on what's happening in the backend thread) */
-	void customEvent (QCustomEvent *e);
+	void customEvent (QEvent *e);
 };
 
 /**


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