[gnome-photos] base-item: Cancel photos_base_item_refresh_icon during destruction
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] base-item: Cancel photos_base_item_refresh_icon during destruction
- Date: Tue, 12 Apr 2016 08:30:33 +0000 (UTC)
commit 36c25b34615377a506b20a738562e6ffbad7a201
Author: Umang Jain <mailumangjain gmail com>
Date: Fri Mar 25 14:02:29 2016 +0530
base-item: Cancel photos_base_item_refresh_icon during destruction
https://bugzilla.gnome.org/show_bug.cgi?id=763908
src/photos-base-item.c | 32 +++++++++++++++++++++++++-------
1 files changed, 25 insertions(+), 7 deletions(-)
---
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index ab64ae2..727d2e5 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -769,8 +769,8 @@ photos_base_item_create_thumbnail_cb (GObject *source_object, GAsyncResult *res,
static void
photos_base_item_file_query_info (GObject *source_object, GAsyncResult *res, gpointer user_data)
{
- PhotosBaseItem *self = PHOTOS_BASE_ITEM (user_data);
- PhotosBaseItemPrivate *priv = self->priv;
+ PhotosBaseItem *self;
+ PhotosBaseItemPrivate *priv;
GError *error = NULL;
GFile *file = G_FILE (source_object);
GFileInfo *info = NULL;
@@ -778,10 +778,29 @@ photos_base_item_file_query_info (GObject *source_object, GAsyncResult *res, gpo
info = g_file_query_info_finish (file, res, &error);
if (error != NULL)
{
- g_warning ("Unable to query info for file at %s: %s", priv->uri, error->message);
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ {
+ g_error_free (error);
+ goto out;
+ }
+ else
+ {
+ gchar *uri;
+
+ uri = g_file_get_uri (file);
+ g_warning ("Unable to query info for file at %s: %s", uri, error->message);
+ g_free (uri);
+ g_error_free (error);
+ }
+ }
+
+ self = PHOTOS_BASE_ITEM (user_data);
+ priv = self->priv;
+
+ if (info == NULL)
+ {
priv->failed_thumbnailing = TRUE;
photos_base_item_set_failed_icon (self);
- g_error_free (error);
goto out;
}
@@ -798,7 +817,6 @@ photos_base_item_file_query_info (GObject *source_object, GAsyncResult *res, gpo
out:
g_clear_object (&info);
- g_object_unref (self);
}
@@ -1380,9 +1398,9 @@ photos_base_item_refresh_icon (PhotosBaseItem *self)
G_FILE_ATTRIBUTE_THUMBNAIL_PATH,
G_FILE_QUERY_INFO_NONE,
G_PRIORITY_DEFAULT,
- NULL,
+ priv->cancellable,
photos_base_item_file_query_info,
- g_object_ref (self));
+ self);
g_object_unref (file);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]