gthumb r2394 - in trunk: . libgthumb



Author: mjc
Date: Mon Aug 11 18:17:13 2008
New Revision: 2394
URL: http://svn.gnome.org/viewvc/gthumb?rev=2394&view=rev

Log:
2008-08-11  Michael J. Chudobiak  <mjc svn gnome org>

        * libgthumb/file-utils.c: (obtain_local_file):
        * libgthumb/file-utils.h:
        * libgthumb/gth-exif-utils.c: (update_and_save_metadata):
        More gfile migration by Christophe BisiÃre. Bug #525482.
        Replace gnome_vfs_xfer_uri with file_copy in the local cache code.



Modified:
   trunk/ChangeLog
   trunk/libgthumb/file-utils.c
   trunk/libgthumb/file-utils.h
   trunk/libgthumb/gth-exif-utils.c

Modified: trunk/libgthumb/file-utils.c
==============================================================================
--- trunk/libgthumb/file-utils.c	(original)
+++ trunk/libgthumb/file-utils.c	Mon Aug 11 18:17:13 2008
@@ -2940,25 +2940,12 @@
 		return NULL;
 
 	if (! path_exists (cache_file) || (get_file_mtime (cache_file) < get_file_mtime (remote_filename))) {
-		GnomeVFSURI    *source_uri = gnome_vfs_uri_new (remote_filename);
-		GnomeVFSURI    *target_uri = gnome_vfs_uri_new (cache_file);
-		GnomeVFSResult  result;
-	
-		/* delete some files if space is running out */
-		/*check_cache_space ();*/
-
-		/* Move a new file into the cache. */
-		result = gnome_vfs_xfer_uri (source_uri, target_uri,
-					     GNOME_VFS_XFER_DEFAULT | GNOME_VFS_XFER_FOLLOW_LINKS,
-					     GNOME_VFS_XFER_ERROR_MODE_ABORT,
-					     GNOME_VFS_XFER_OVERWRITE_MODE_REPLACE,
-					     NULL,
-					     NULL);
-
-		gnome_vfs_uri_unref (source_uri);
-		gnome_vfs_uri_unref (target_uri);
+		
+		gboolean result;
+		
+		result = file_copy (remote_filename, cache_file);
 
-		if (result != GNOME_VFS_OK) {
+		if (! result) {
 			g_free (cache_file);
        			return NULL;
 		}
@@ -2978,33 +2965,6 @@
 }
 
 
-gboolean
-copy_cache_file_to_remote_uri (const char *local_filename,
-			       const char *dest_uri)
-{
-	/* make a remote copy of a local cache file */
-
-	GnomeVFSURI    *source_uri;
-	GnomeVFSURI    *target_uri;
-	GnomeVFSResult  result;
-
-	source_uri = gnome_vfs_uri_new (local_filename);
-	target_uri = gnome_vfs_uri_new (dest_uri);
-
-	result = gnome_vfs_xfer_uri (source_uri, target_uri,
-				     GNOME_VFS_XFER_DEFAULT | GNOME_VFS_XFER_FOLLOW_LINKS,
-				     GNOME_VFS_XFER_ERROR_MODE_ABORT,
-				     GNOME_VFS_XFER_OVERWRITE_MODE_REPLACE,
-				     NULL,
-				     NULL);
-
-	gnome_vfs_uri_unref (target_uri);
-	gnome_vfs_uri_unref (source_uri);
-
-	return (result == GNOME_VFS_OK);
-}
-
-
 /* Pixbuf + VFS */
 
 

Modified: trunk/libgthumb/file-utils.h
==============================================================================
--- trunk/libgthumb/file-utils.h	(original)
+++ trunk/libgthumb/file-utils.h	Mon Aug 11 18:17:13 2008
@@ -268,8 +268,6 @@
 						   CopyDoneFunc      done_func,
 						   gpointer          done_data);
 char* 		    obtain_local_file             (const char       *remote_filename);
-gboolean	    copy_cache_file_to_remote_uri (const char       *local_filename,
-                                                   const char       *dest_uri);
 GHashTable *        read_dot_hidden_file          (const char       *uri);
 
 /* Pixbuf + VFS */

Modified: trunk/libgthumb/gth-exif-utils.c
==============================================================================
--- trunk/libgthumb/gth-exif-utils.c	(original)
+++ trunk/libgthumb/gth-exif-utils.c	Mon Aug 11 18:17:13 2008
@@ -436,7 +436,7 @@
 	write_metadata (from_local_file, to_local_file, metadata);
 
 	if (!to_is_local) {
-		remote_copy_ok = copy_cache_file_to_remote_uri (to_local_file, uri_dest);
+		remote_copy_ok = file_copy (to_local_file, uri_dest);
 
 		if (remote_copy_ok == TRUE) {
 			gnome_vfs_set_file_info (uri_dest,



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