[gnome-photos/wip/rishi/collection: 46/46] base-item: refresh_icon
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/collection: 46/46] base-item: refresh_icon
- Date: Thu, 25 Jan 2018 14:58:41 +0000 (UTC)
commit 88a39dd5def33389bbd896b3108d73d1dc01a5bb
Author: Debarshi Ray <debarshir gnome org>
Date: Thu Jan 25 15:53:50 2018 +0100
base-item: refresh_icon
src/photos-base-item.c | 71 +++++++++++++++++++++++++-------------------------
1 file changed, 36 insertions(+), 35 deletions(-)
---
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index c7fbe21f..b9d4c14d 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -990,6 +990,40 @@ photos_base_item_default_open (PhotosBaseItem *self, GtkWindow *parent, guint32
}
+static void
+photos_base_item_default_refresh_icon (PhotosBaseItem *self)
+{
+ PhotosBaseItemPrivate *priv;
+
+ priv = photos_base_item_get_instance_private (self);
+
+ if (priv->thumb_path != NULL)
+ {
+ photos_base_item_refresh_thumb_path (self);
+ return;
+ }
+
+ photos_base_item_set_thumbnailing_icon (self);
+
+ if (priv->failed_thumbnailing)
+ return;
+
+ if (priv->collection)
+ {
+ photos_base_item_refresh_collection_icon (self);
+ return;
+ }
+
+ photos_base_item_query_info_async (self,
+ G_FILE_ATTRIBUTE_THUMBNAIL_PATH,
+ G_FILE_QUERY_INFO_NONE,
+ G_PRIORITY_DEFAULT,
+ priv->cancellable,
+ photos_base_item_file_query_info,
+ NULL);
+}
+
+
static void
photos_base_item_default_update_type_description (PhotosBaseItem *self)
{
@@ -2618,40 +2652,6 @@ photos_base_item_save_to_stream_load (GObject *source_object, GAsyncResult *res,
}
-static void
-photos_base_item_refresh_icon (PhotosBaseItem *self)
-{
- PhotosBaseItemPrivate *priv;
-
- priv = photos_base_item_get_instance_private (self);
-
- if (priv->thumb_path != NULL)
- {
- photos_base_item_refresh_thumb_path (self);
- return;
- }
-
- photos_base_item_set_thumbnailing_icon (self);
-
- if (priv->failed_thumbnailing)
- return;
-
- if (priv->collection)
- {
- photos_base_item_refresh_collection_icon (self);
- return;
- }
-
- photos_base_item_query_info_async (self,
- G_FILE_ATTRIBUTE_THUMBNAIL_PATH,
- G_FILE_QUERY_INFO_NONE,
- G_PRIORITY_DEFAULT,
- priv->cancellable,
- photos_base_item_file_query_info,
- NULL);
-}
-
-
static void
photos_base_item_update_info_from_type (PhotosBaseItem *self)
{
@@ -2807,7 +2807,7 @@ photos_base_item_populate_from_cursor (PhotosBaseItem *self, TrackerSparqlCursor
name_fallback = PHOTOS_BASE_ITEM_GET_CLASS (self)->create_name_fallback (self);
photos_utils_take_string (&priv->name_fallback, name_fallback);
- photos_base_item_refresh_icon (self);
+ PHOTOS_BASE_ITEM_GET_CLASS (self)->refresh_icon (self);
}
@@ -3039,6 +3039,7 @@ photos_base_item_class_init (PhotosBaseItemClass *class)
class->create_thumbnail_path = photos_base_item_default_create_thumbnail_path;
class->metadata_add_shared = photos_base_item_default_metadata_add_shared;
class->open = photos_base_item_default_open;
+ class->refresh_icon = photos_base_item_default_refresh_icon;
class->set_favorite = photos_base_item_default_set_favorite;
class->update_type_description = photos_base_item_default_update_type_description;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]