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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Sun Oct 28 17:50:04 UTC 2007


Revision: 2135
          http://rkward.svn.sourceforge.net/rkward/?rev=2135&view=rev
Author:   tfry
Date:     2007-10-28 10:50:03 -0700 (Sun, 28 Oct 2007)

Log Message:
-----------
Reliably cancel running commands

Modified Paths:
--------------
    branches/KDE4_port/rkward/rbackend/rinterface.cpp
    branches/KDE4_port/rkward/rbackend/rthread.cpp
    branches/KDE4_port/rkward/windows/rcontrolwindow.cpp

Modified: branches/KDE4_port/rkward/rbackend/rinterface.cpp
===================================================================
--- branches/KDE4_port/rkward/rbackend/rinterface.cpp	2007-10-28 00:54:18 UTC (rev 2134)
+++ branches/KDE4_port/rkward/rbackend/rinterface.cpp	2007-10-28 17:50:03 UTC (rev 2135)
@@ -249,7 +249,7 @@
 	
 	if (!(command->type () & RCommand::Sync)) {
 		command->status |= RCommand::Canceled;
-		if (command == r_thread->current_command) {
+		if (command->type () && RCommand::Running) {
 			if (running_command_canceled != command) {
 				RK_ASSERT (!running_command_canceled);
 				r_thread->lock (RThread::Cancel);

Modified: branches/KDE4_port/rkward/rbackend/rthread.cpp
===================================================================
--- branches/KDE4_port/rkward/rbackend/rthread.cpp	2007-10-28 00:54:18 UTC (rev 2134)
+++ branches/KDE4_port/rkward/rbackend/rthread.cpp	2007-10-28 17:50:03 UTC (rev 2135)
@@ -173,7 +173,7 @@
 			runCommandInternal (".rk.cat.output (\"<hr>\\n\")", &error, false);
 			RK_ASSERT (!error);
 		}
-		command->status |= RCommand::Running;
+		command->status |= RCommand::Running;	// it is important that this happens before the Mutex is unlocked!
 		RCommandStackModel::getModel ()->itemChange (command);
 
 		MUTEX_UNLOCK;

Modified: branches/KDE4_port/rkward/windows/rcontrolwindow.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rcontrolwindow.cpp	2007-10-28 00:54:18 UTC (rev 2134)
+++ branches/KDE4_port/rkward/windows/rcontrolwindow.cpp	2007-10-28 17:50:03 UTC (rev 2135)
@@ -111,6 +111,7 @@
 
 	// find out all the RCommands selected (not the chains)
 	for (QModelIndexList::const_iterator it = list.constBegin (); it != list.constEnd (); ++it) {
+		if ((*it).column ()) continue;		// only react once per row
 		RCommandBase* coc = static_cast<RCommandBase*> ((*it).internalPointer ());
 		RK_ASSERT (coc);
 		RCommand* command = coc->commandPointer ();


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