[gthumb] Removed local cache code from the file-save dialog



commit c8177b8ec9cf3eb34f4ecabb24c7ae0d778c449d
Author: Michael J. Chudobiak <mjc avtechpulse com>
Date:   Fri May 8 14:46:49 2009 -0400

    Removed local cache code from the file-save dialog
---
 libgthumb/dlg-save-image.c |   36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/libgthumb/dlg-save-image.c b/libgthumb/dlg-save-image.c
index b5624c0..52b00d9 100644
--- a/libgthumb/dlg-save-image.c
+++ b/libgthumb/dlg-save-image.c
@@ -111,24 +111,24 @@ save_image (GtkWindow     *parent,
 		image_type = g_strdup (file->mime_type + strlen("image/"));
 
 		if (dlg_save_options (parent, image_type, &keys, &values)) {
-			char *local_file;
-			char *original_local_file;
-	
-			local_file = get_cache_filename_from_uri (file->path);
-			original_local_file = get_cache_filename_from_uri (original_file);
-
-			if (_gdk_pixbuf_savev (pixbuf,
-					       local_file,
-					       original_local_file,
-					       image_type,
-					       keys, values,
-					       &error))
-				image_saved = TRUE;
-			else
-				_gtk_error_dialog_from_gerror_run (parent, &error);
-				
-			g_free (local_file);
-			g_free (original_local_file);
+			FileData *fd_orig;
+			fd_orig = file_data_new (original_file);
+
+			if (file_data_has_local_path (file, parent) &&
+			    file_data_has_local_path (fd_orig, parent)) {
+		
+				if (_gdk_pixbuf_savev (pixbuf,
+						       file->local_path,
+						       fd_orig->local_path,
+						       image_type,
+						       keys, values,
+						       &error))
+					image_saved = TRUE;
+				else
+					_gtk_error_dialog_from_gerror_run (parent, &error);
+			}
+			
+			file_data_unref (fd_orig);
 		}
 
 		g_free (image_type);



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