[gthumb] Use fdata->local_path instead of the local cache when preloading



commit a0a971111d62fb8254f5ee0412cd7bb64511ee39
Author: Michael J. Chudobiak <mjc avtechpulse com>
Date:   Thu May 7 11:43:43 2009 -0400

    Use fdata->local_path instead of the local cache when preloading
---
 src/gth-browser.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/gth-browser.c b/src/gth-browser.c
index 125837c..893e7c1 100644
--- a/src/gth-browser.c
+++ b/src/gth-browser.c
@@ -8196,7 +8196,6 @@ get_image_to_preload (GthBrowser *browser,
 {
 	FileData  *fdata;
 	int        max_size;
-	char      *local_file;
 	int        width = 0, height = 0;
 
 	if (pos < 0)
@@ -8205,7 +8204,10 @@ get_image_to_preload (GthBrowser *browser,
 		return NULL;
 
 	fdata = gth_file_view_get_image_data (browser->priv->file_list->view, pos);
-	if ((fdata == NULL) || ! is_local_file (fdata->path) || ! mime_type_is_image (fdata->mime_type)) {
+	if ((fdata == NULL) || 
+	    ! is_local_file (fdata->utf8_path) ||
+	    (fdata->local_path == NULL) ||
+	    ! mime_type_is_image (fdata->mime_type)) {
 		file_data_unref (fdata); 
 		return NULL;
 	}
@@ -8221,17 +8223,16 @@ get_image_to_preload (GthBrowser *browser,
 		return NULL;
 	}
 
-	local_file = get_cache_filename_from_uri (fdata->path);
-	gdk_pixbuf_get_file_info (local_file, &width, &height);
+	g_assert (fdata->local_path != NULL);
+	gdk_pixbuf_get_file_info (fdata->local_path, &width, &height);
 
-	debug (DEBUG_INFO, "%s dimensions: [%dx%d] <-> %d\n", local_file, width, height, max_size);
+	debug (DEBUG_INFO, "%s dimensions: [%dx%d] <-> %d\n", fdata->utf8_path, width, height, max_size);
 
 	if (width * height > max_size) {
-		debug (DEBUG_INFO, "image %s dimensions are too large for preloading\n", local_file);
+		debug (DEBUG_INFO, "image %s dimensions are too large for preloading\n", fdata->local_path);
 		file_data_unref (fdata);
 		fdata = NULL;
 	}
-	g_free (local_file);
 
 	return fdata;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]