Documentation: Use G_SOURCE_CONTINUE and G_SOURCE_REMOVE
[geeqie.git] / src / thumb-standard.cc
index 2c18ed1..e18eb00 100644 (file)
@@ -410,7 +410,16 @@ void thumb_loader_std_calibrate_pixbuf(FileData *fd, GdkPixbuf *pixbuf) {
 
        if (exif)
                {
-               profile = exif_get_color_profile(exif, &profile_len);
+               if (g_strcmp0(fd->format_name, "heif") == 0)
+                       {
+                       profile = heif_color_profile(fd, &profile_len);
+                       }
+
+               if (!profile)
+                       {
+                       profile = exif_get_color_profile(exif, &profile_len);
+                       }
+
                if (profile)
                        {
                        DEBUG_1("Found embedded color profile");
@@ -657,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 = data;
+       ThumbLoaderStd *tl = static_cast<ThumbLoaderStd *>(data);
        GdkPixbuf *pixbuf;
 
        DEBUG_1("thumb image done: %s", tl->fd ? tl->fd->path : "???");
@@ -692,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 = 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)
@@ -713,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 = data;
+       ThumbLoaderStd *tl = static_cast<ThumbLoaderStd *>(data);
 
        tl->progress = (gdouble)percent;
 
@@ -891,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)
                {
@@ -911,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 = data;
+       ThumbValidate *tv = static_cast<ThumbValidate *>(data);
        GdkPixbuf *pixbuf;
        gboolean valid = FALSE;
 
@@ -969,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 = 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 = 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,
@@ -1079,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 = data;
+       TMaintMove *tm = static_cast<TMaintMove *>(data);
        GdkPixbuf *pixbuf;
 
        /* get the original thumbnail pixbuf (unrotated, with original options)
@@ -1165,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;
@@ -1180,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.