Documentation: Use G_SOURCE_CONTINUE and G_SOURCE_REMOVE
[geeqie.git] / src / thumb-standard.cc
index 595aa9d..e18eb00 100644 (file)
@@ -666,7 +666,7 @@ static gboolean thumb_loader_std_next_source(ThumbLoaderStd *tl, gboolean remove
 
 static void thumb_loader_std_done_cb(ImageLoader *il, gpointer data)
 {
-       ThumbLoaderStd *tl = (ThumbLoaderStd *)data;
+       ThumbLoaderStd *tl = static_cast<ThumbLoaderStd *>(data);
        GdkPixbuf *pixbuf;
 
        DEBUG_1("thumb image done: %s", tl->fd ? tl->fd->path : "???");
@@ -701,7 +701,7 @@ static void thumb_loader_std_done_cb(ImageLoader *il, gpointer data)
 
 static void thumb_loader_std_error_cb(ImageLoader *il, gpointer data)
 {
-       ThumbLoaderStd *tl = (ThumbLoaderStd *)data;
+       ThumbLoaderStd *tl = static_cast<ThumbLoaderStd *>(data);
 
        /* if at least some of the image is available, go to done */
        if (image_loader_get_pixbuf(tl->il) != NULL)
@@ -722,7 +722,7 @@ static void thumb_loader_std_error_cb(ImageLoader *il, gpointer data)
 
 static void thumb_loader_std_progress_cb(ImageLoader *UNUSED(il), gdouble percent, gpointer data)
 {
-       ThumbLoaderStd *tl = (ThumbLoaderStd *)data;
+       ThumbLoaderStd *tl = static_cast<ThumbLoaderStd *>(data);
 
        tl->progress = (gdouble)percent;
 
@@ -900,7 +900,7 @@ void thumb_loader_std_thumb_file_validate_cancel(ThumbLoaderStd *tl)
 
        if (!tl) return;
 
-       tv = tl->data;
+       tv = static_cast<ThumbValidate *>(tl->data);
 
        if (tv->idle_id)
                {
@@ -920,7 +920,7 @@ static void thumb_loader_std_thumb_file_validate_finish(ThumbValidate *tv, gbool
 
 static void thumb_loader_std_thumb_file_validate_done_cb(ThumbLoaderStd *UNUSED(tl), gpointer data)
 {
-       ThumbValidate *tv = (ThumbValidate *)data;
+       ThumbValidate *tv = static_cast<ThumbValidate *>(data);
        GdkPixbuf *pixbuf;
        gboolean valid = FALSE;
 
@@ -978,19 +978,19 @@ static void thumb_loader_std_thumb_file_validate_done_cb(ThumbLoaderStd *UNUSED(
 
 static void thumb_loader_std_thumb_file_validate_error_cb(ThumbLoaderStd *UNUSED(tl), gpointer data)
 {
-       ThumbValidate *tv = (ThumbValidate *)data;
+       ThumbValidate *tv = static_cast<ThumbValidate *>(data);
 
        thumb_loader_std_thumb_file_validate_finish(tv, FALSE);
 }
 
 static gboolean thumb_loader_std_thumb_file_validate_idle_cb(gpointer data)
 {
-       ThumbValidate *tv = (ThumbValidate *)data;
+       ThumbValidate *tv = static_cast<ThumbValidate *>(data);
 
        tv->idle_id = 0;
        thumb_loader_std_thumb_file_validate_finish(tv, FALSE);
 
-       return FALSE;
+       return G_SOURCE_REMOVE;
 }
 
 ThumbLoaderStd *thumb_loader_std_thumb_file_validate(const gchar *thumb_path, gint allowed_days,
@@ -1088,7 +1088,7 @@ static gboolean thumb_std_maint_move_idle(gpointer data);
 
 static void thumb_std_maint_move_validate_cb(const gchar *UNUSED(path), gboolean UNUSED(valid), gpointer data)
 {
-       TMaintMove *tm = (TMaintMove *)data;
+       TMaintMove *tm = static_cast<TMaintMove *>(data);
        GdkPixbuf *pixbuf;
 
        /* get the original thumbnail pixbuf (unrotated, with original options)
@@ -1174,9 +1174,9 @@ static gboolean thumb_std_maint_move_idle(gpointer UNUSED(data))
        TMaintMove *tm;
        gchar *pathl;
 
-       if (!thumb_std_maint_move_list) return FALSE;
+       if (!thumb_std_maint_move_list) return G_SOURCE_REMOVE;
 
-       tm = thumb_std_maint_move_list->data;
+       tm = static_cast<TMaintMove *>(thumb_std_maint_move_list->data);
 
        thumb_std_maint_move_list = g_list_remove(thumb_std_maint_move_list, tm);
        if (!thumb_std_maint_move_list) thumb_std_maint_move_tail = NULL;
@@ -1189,7 +1189,7 @@ static gboolean thumb_std_maint_move_idle(gpointer UNUSED(data))
 
        thumb_std_maint_move_step(tm);
 
-       return FALSE;
+       return G_SOURCE_REMOVE;
 }
 
 /* This will schedule a move of the thumbnail for source image to dest when idle.