aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-op-queue.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/camel-op-queue.c')
-rw-r--r--camel/camel-op-queue.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/camel/camel-op-queue.c b/camel/camel-op-queue.c
index 5549a40de1..c58ade9958 100644
--- a/camel/camel-op-queue.c
+++ b/camel/camel-op-queue.c
@@ -83,7 +83,28 @@ camel_op_queue_pop_op (CamelOpQueue *queue)
op = queue->ops_tail;
queue->ops_tail = queue->ops_tail->prev;
- return op;
+ return (CamelOp *)op->data;
}
+/**
+ * camel_op_queue_run_next_op: run the next pending operation
+ * @queue: queue object
+ *
+ * Run the next pending operation in the queue.
+ *
+ * Return value: TRUE if an operation was launched FALSE if there was no operation pending in the queue.
+ **/
+gboolean
+camel_op_queue_run_next_op (CamelOpQueue *queue)
+{
+ CamelOp *op;
+
+ op = camel_op_queue_pop_op (queue);
+ if (!op) return FALSE;
+
+ /* run the operation */
+ op->op_func (op->param);
+
+ return FALSE;
+}