[brasero] Removed unused function and fixed de-initialization by cancelling all current jobs.
- From: Philippe Rouquier <philippr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [brasero] Removed unused function and fixed de-initialization by cancelling all current jobs.
- Date: Fri, 21 May 2010 18:16:38 +0000 (UTC)
commit 553f34ad033c193e22ae3ffe9667b26de3bddf4f
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date: Fri May 21 22:17:08 2010 +0200
Removed unused function and fixed de-initialization by cancelling all current jobs.
libbrasero-utils/brasero-io.c | 77 ++++++++++++++++-------------------------
libbrasero-utils/brasero-io.h | 3 --
2 files changed, 30 insertions(+), 50 deletions(-)
---
diff --git a/libbrasero-utils/brasero-io.c b/libbrasero-utils/brasero-io.c
index 23f31e6..b121a25 100644
--- a/libbrasero-utils/brasero-io.c
+++ b/libbrasero-utils/brasero-io.c
@@ -2245,53 +2245,6 @@ brasero_io_cancel_by_base (BraseroIOJobBase *base)
g_object_unref (self);
}
-static gboolean
-brasero_io_cancel_tasks_by_data_cb (BraseroAsyncTaskManager *manager,
- gpointer callback_data,
- gpointer user_data)
-{
- BraseroIOJob *job = callback_data;
-
- if (job->callback_data && job->callback_data->callback_data != user_data)
- return FALSE;
-
- return TRUE;
-}
-
-void
-brasero_io_cancel_by_data (gpointer callback_data)
-{
- GSList *iter;
- GSList *next;
- BraseroIOPrivate *priv;
- BraseroIO *self = brasero_io_get_default ();
-
- priv = BRASERO_IO_PRIVATE (self);
-
- brasero_async_task_manager_foreach_unprocessed_remove (BRASERO_ASYNC_TASK_MANAGER (self),
- brasero_io_cancel_tasks_by_data_cb,
- callback_data);
-
- brasero_async_task_manager_foreach_active_remove (BRASERO_ASYNC_TASK_MANAGER (self),
- brasero_io_cancel_tasks_by_data_cb,
- callback_data);
-
- /* do it afterwards in case some results slipped through */
- for (iter = priv->results; iter; iter = next) {
- BraseroIOJobResult *result;
-
- result = iter->data;
- next = iter->next;
-
- if (result->callback_data != callback_data)
- continue;
-
- brasero_io_cancel_result (self, result);
- }
-
- g_object_unref (self);
-}
-
struct _BraseroIOJobCompareData {
BraseroIOCompareCallback func;
const BraseroIOJobBase *base;
@@ -2538,9 +2491,39 @@ brasero_io_class_init (BraseroIOClass *klass)
object_class->finalize = brasero_io_finalize;
}
+static gboolean
+brasero_io_cancel (BraseroAsyncTaskManager *manager,
+ gpointer callback_data,
+ gpointer user_data)
+{
+ return TRUE;
+}
+
void
brasero_io_shutdown (void)
{
+ GSList *iter, *next;
+ BraseroIOPrivate *priv;
+
+ priv = BRASERO_IO_PRIVATE (singleton);
+
+ brasero_async_task_manager_foreach_unprocessed_remove (BRASERO_ASYNC_TASK_MANAGER (singleton),
+ brasero_io_cancel,
+ NULL);
+
+ brasero_async_task_manager_foreach_active_remove (BRASERO_ASYNC_TASK_MANAGER (singleton),
+ brasero_io_cancel,
+ NULL);
+
+ /* do it afterwards in case some results slipped through */
+ for (iter = priv->results; iter; iter = next) {
+ BraseroIOJobResult *result;
+
+ result = iter->data;
+ next = iter->next;
+ brasero_io_cancel_result (singleton, result);
+ }
+
if (singleton) {
g_object_unref (singleton);
singleton = NULL;
diff --git a/libbrasero-utils/brasero-io.h b/libbrasero-utils/brasero-io.h
index ba32da8..7e5147a 100644
--- a/libbrasero-utils/brasero-io.h
+++ b/libbrasero-utils/brasero-io.h
@@ -204,9 +204,6 @@ void
brasero_io_job_base_free (BraseroIOJobBase *base);
void
-brasero_io_cancel_by_data (gpointer callback_data);
-
-void
brasero_io_cancel_by_base (BraseroIOJobBase *base);
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]