[gnome-photos/wip/rishi/edit-mode: 9/29] base-item: Take advantage of better caching during download
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/edit-mode: 9/29] base-item: Take advantage of better caching during download
- Date: Tue, 10 Nov 2015 19:24:02 +0000 (UTC)
commit 33c8b27b3b3b983741a69f0b59ba0ba7ba22c4e3
Author: Debarshi Ray <debarshir gnome org>
Date: Tue May 26 10:40:16 2015 +0200
base-item: Take advantage of better caching during download
We only hit the network if the cache is empty. If it isn't, then we
return the local path to the cached file. Therefore, there is no need
to guard it with a 'once' variable.
src/photos-base-item.c | 14 ++++----------
1 files changed, 4 insertions(+), 10 deletions(-)
---
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index ab7c310..4743eaf 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -68,7 +68,6 @@ struct _PhotosBaseItemPrivate
gboolean collection;
gboolean failed_thumbnailing;
gboolean favorite;
- gboolean loaded_once;
const gchar *thumb_path;
gchar *author;
gchar *default_app_name;
@@ -740,16 +739,11 @@ photos_base_item_load (PhotosBaseItem *self, GCancellable *cancellable, GError *
GeglNode *ret_val = NULL;
gchar *path = NULL;
- if (!priv->loaded_once)
- {
- path = photos_base_item_download (self, cancellable, error);
- if (path == NULL)
- goto out;
-
- gegl_node_set (priv->node, "path", path, NULL);
- priv->loaded_once = TRUE;
- }
+ path = photos_base_item_download (self, cancellable, error);
+ if (path == NULL)
+ goto out;
+ gegl_node_set (priv->node, "path", path, NULL);
gegl_node_process (priv->node);
priv->bbox = gegl_node_get_bounding_box (priv->node);
ret_val = g_object_ref (priv->node);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]