[packagekit] packagekit: Branch 'master'

Richard Hughes hughsient at kemper.freedesktop.org
Wed Sep 26 11:56:04 PDT 2007


 src/pk-engine.c |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
diff-tree dbc3485ac113b46241db5f86042c4ad2886e0d98 (from 00229dd1868eea15321198bc96f77d7b154ff389)
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Sep 26 19:55:41 2007 +0100

    allow cancelling of a queued task

diff --git a/src/pk-engine.c b/src/pk-engine.c
index 965721c..383f71c 100644
--- a/src/pk-engine.c
+++ b/src/pk-engine.c
@@ -1665,6 +1665,13 @@ pk_engine_cancel (PkEngine *engine, cons
 		return FALSE;
 	}
 
+	/* check to see if we are trying to cancel a non-running task */
+	if (item->running == FALSE) {
+		pk_debug ("cancelling the non-running item %p", item);
+		pk_engine_item_delete (engine, item);
+		return TRUE;
+	}
+
 	ret = pk_backend_cancel (item->backend);
 	if (ret == FALSE) {
 		g_set_error (error, PK_ENGINE_ERROR, PK_ENGINE_ERROR_NOT_SUPPORTED,



More information about the PackageKit mailing list