[gthumb/gthumb-3-4] async task: faster execution
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb/gthumb-3-4] async task: faster execution
- Date: Tue, 11 Apr 2017 19:31:29 +0000 (UTC)
commit 8a4f0a3829bc3859157e75b5795972761c758889
Author: Paolo Bacchilega <paobac src gnome org>
Date: Mon Apr 3 19:27:09 2017 +0200
async task: faster execution
use an idle callback instead of a timeout
gthumb/gth-async-task.c | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/gthumb/gth-async-task.c b/gthumb/gth-async-task.c
index 171be22..b48ebec 100644
--- a/gthumb/gth-async-task.c
+++ b/gthumb/gth-async-task.c
@@ -25,9 +25,6 @@
#include "typedefs.h"
-#define PROGRESS_DELAY 100 /* delay between progress notifications */
-
-
/* Properties */
enum {
PROP_0,
@@ -123,7 +120,7 @@ update_progress (gpointer data)
ready_with_error (task_completed, self, error);
- return FALSE;
+ return G_SOURCE_REMOVE;
}
gth_task_progress (GTH_TASK (self),
@@ -132,7 +129,7 @@ update_progress (gpointer data)
FALSE,
progress);
- return TRUE;
+ return G_SOURCE_CONTINUE;
}
@@ -169,7 +166,7 @@ gth_async_task_exec (GthTask *task)
self->priv->thread = g_thread_new ("asynctask", exec_task, self);
if (self->priv->progress_event == 0)
- self->priv->progress_event = g_timeout_add (PROGRESS_DELAY, update_progress, self);
+ self->priv->progress_event = g_idle_add (update_progress, self);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]