[rkward-cvs] SF.net SVN: rkward-code:[4751] trunk/rkward/rkward/rbackend

tfry at users.sf.net tfry at users.sf.net
Thu May 16 07:35:02 UTC 2013


Revision: 4751
          http://sourceforge.net/p/rkward/code/4751
Author:   tfry
Date:     2013-05-16 07:34:59 +0000 (Thu, 16 May 2013)
Log Message:
-----------
Add option for less disruptive cancellation.

Modified Paths:
--------------
    trunk/rkward/rkward/rbackend/rinterface.cpp
    trunk/rkward/rkward/rbackend/rinterface.h

Modified: trunk/rkward/rkward/rbackend/rinterface.cpp
===================================================================
--- trunk/rkward/rkward/rbackend/rinterface.cpp	2013-05-13 12:02:45 UTC (rev 4750)
+++ trunk/rkward/rkward/rbackend/rinterface.cpp	2013-05-16 07:34:59 UTC (rev 4751)
@@ -509,6 +509,15 @@
 	foreach (RCommand* command, all_commands) cancelCommand (command);
 }
 
+bool RInterface::softCancelCommand (RCommand* command) {
+	RK_TRACE (RBACKEND);
+
+	if (!(command->type () && RCommand::Running)) {
+		cancelCommand (command);
+	}
+	return command->status && RCommand::Canceled;
+}
+
 void RInterface::cancelCommand (RCommand *command) {
 	RK_TRACE (RBACKEND);
 

Modified: trunk/rkward/rkward/rbackend/rinterface.h
===================================================================
--- trunk/rkward/rkward/rbackend/rinterface.h	2013-05-13 12:02:45 UTC (rev 4750)
+++ trunk/rkward/rkward/rbackend/rinterface.h	2013-05-16 07:34:59 UTC (rev 4751)
@@ -2,7 +2,7 @@
                           rinterface.h  -  description
                              -------------------
     begin                : Fri Nov 1 2002
-    copyright            : (C) 2002, 2004, 2005, 2006, 2007, 2009, 2010, 2011 by Thomas Friedrichsmeier
+    copyright            : (C) 2002 - 2013 by Thomas Friedrichsmeier
     email                : tfry at users.sourceforge.net
  ***************************************************************************/
 
@@ -62,6 +62,8 @@
 /** Ensures that the given command will not be executed, or, if it is already running, interrupts it. Note that commands marked RCommand::Sync can
 not be interrupted. */
 	void cancelCommand (RCommand *command);
+/** Cancels the given command, unless it has already been submitted to the backend. Returns true, if command was cancelled, false otherwise. */
+	bool softCancelCommand (RCommand *command);
 /** Cancels all running or outstanding commands. @See cancelCommand() */
 	void cancelAll ();
 





More information about the rkward-tracker mailing list