[gthumb] Normally use gfile_new instead of g_file_new_for_uri.



commit bc35ee832ac14df4e86a340d3e190f28dc94a0cc
Author: Michael J. Chudobiak <mjc avtechpulse com>
Date:   Fri May 29 14:34:55 2009 -0400

    Normally use gfile_new instead of g_file_new_for_uri.
    
    Also, more conversions from fd->path to fd->utf8_path.
---
 src/catalog-png-exporter.c |    3 ++-
 src/catalog-web-exporter.c |    6 +++---
 src/dlg-jpegtran.c         |    5 +++--
 src/gth-viewer.c           |   14 +++++++-------
 src/rotation-utils.c       |    5 +++--
 5 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/src/catalog-png-exporter.c b/src/catalog-png-exporter.c
index f86279d..7aface2 100644
--- a/src/catalog-png-exporter.c
+++ b/src/catalog-png-exporter.c
@@ -32,6 +32,7 @@
 #include "catalog-png-exporter.h"
 #include "comments.h"
 #include "file-utils.h"
+#include "gfile-utils.h"
 #include "gth-utils.h"
 #include "gthumb-init.h"
 #include "gthumb-marshal.h"
@@ -1617,7 +1618,7 @@ begin_page (CatalogPngExporter *ce,
 	 *   requires converting to GFile: 
 	 *   1) recipients of all_windows_notify_files_created  
 	 */
-	ce->imap_gfile = g_file_new_for_uri (ce->imap_uri);
+	ce->imap_gfile = gfile_new (ce->imap_uri);
 	
 	ce->ostream = g_file_replace (ce->imap_gfile, 
 				      NULL,
diff --git a/src/catalog-web-exporter.c b/src/catalog-web-exporter.c
index ee0f262..81045e6 100644
--- a/src/catalog-web-exporter.c
+++ b/src/catalog-web-exporter.c
@@ -2261,7 +2261,7 @@ save_thumbnail_cb (gpointer data)
 		
 	if (idata->thumb != NULL) {
 		GFile *file;
-		GFile *src_local_gfile = g_file_new_for_uri (idata->src_file->path);
+		GFile *src_local_gfile = gfile_new (idata->src_file->path);
 		char  *local_file;
 		char  *src_local_file;
 
@@ -2525,7 +2525,7 @@ save_image_preview_cb (gpointer data)
 
 		if ((! idata->no_preview) && (idata->preview != NULL)) {
 			GFile *file;
-			GFile *src_local_gfile = g_file_new_for_uri (idata->src_file->path);
+			GFile *src_local_gfile = gfile_new (idata->src_file->path);
 			char  *local_file;
 			char  *src_local_file;
 
@@ -2571,7 +2571,7 @@ save_resized_image_cb (gpointer data)
 
 		if (ce->copy_images && (idata->image != NULL)) {
 			GFile *file;
-			GFile *src_local_gfile = g_file_new_for_uri (idata->src_file->path);
+			GFile *src_local_gfile = gfile_new (idata->src_file->path);
 			char  *image_uri;
 			char  *local_file; 
 			char  *src_local_file;
diff --git a/src/dlg-jpegtran.c b/src/dlg-jpegtran.c
index 55d3f68..20fda5d 100644
--- a/src/dlg-jpegtran.c
+++ b/src/dlg-jpegtran.c
@@ -35,6 +35,7 @@
 #include "jpegutils/jpeg-data.h"
 
 #include "file-utils.h"
+#include "gfile-utils.h"
 #include "gconf-utils.h"
 #include "gth-utils.h"
 #include "gth-window.h"
@@ -241,7 +242,7 @@ apply_transformation_done (gpointer callback_data)
 {
 	ApplyTransformData *at_data = callback_data;
 	FileData           *file = at_data->current_image->data;
-	GFile              *gfile = g_file_new_for_uri (file->path);
+	GFile              *gfile = gfile_new (file->utf8_path);
 		
 	if (at_data->info != NULL)
 		g_file_set_attributes_from_info (gfile, at_data->info, G_FILE_QUERY_INFO_NONE, NULL, NULL);
@@ -339,7 +340,7 @@ apply_transformation (GtkWidget    *parent_window,
 	at_data->done_func = done_func;
 	at_data->done_data = done_data;
 
-	gfile = g_file_new_for_uri (file->path);
+	gfile = gfile_new (file->utf8_path);
 	at_data->info = g_file_query_info (gfile, "owner::*,access::*", G_FILE_QUERY_INFO_NONE, NULL, &error);
 	g_object_unref (gfile);
 	if (error) {
diff --git a/src/gth-viewer.c b/src/gth-viewer.c
index ea135a8..d2ff3c6 100644
--- a/src/gth-viewer.c
+++ b/src/gth-viewer.c
@@ -709,7 +709,7 @@ open_with_menu_item_activate_cb (GtkMenuItem *menuitem,
 		return;
 
 	app = g_object_get_data (G_OBJECT (menuitem), "app");
-	uris = g_list_prepend (NULL, viewer->priv->image->path);
+	uris = g_list_prepend (NULL, viewer->priv->image->utf8_path);
 	g_app_info_launch_uris (app, uris, NULL, NULL);
 	g_list_free (uris);
 }
@@ -800,7 +800,7 @@ save_pixbuf__image_saved_cb (FileData *file,
 	
 		if ((viewer->priv->image != NULL) && ! file_data_same (viewer->priv->image, file)) {
 			/*FIXME: gtk_widget_show (gth_viewer_new (uri));*/
-			file_data_set_path (viewer->priv->image, file->path);
+			file_data_set_path (viewer->priv->image, file->utf8_path);
 			gth_viewer_load (viewer, viewer->priv->image);
 		}
 		else {
@@ -834,7 +834,7 @@ ask_whether_to_save__response_cb (GtkWidget *dialog,
 
         if (response_id == GTK_RESPONSE_YES) {
 		dlg_save_image_as (GTK_WINDOW (viewer),
-				   priv->image->path,
+				   priv->image->utf8_path,
 				   priv->image->metadata,
 				   image_viewer_get_current_pixbuf (IMAGE_VIEWER (priv->viewer)),
 				   ask_whether_to_save__image_saved_cb,
@@ -1208,7 +1208,7 @@ monitor_update_files_cb (GthMonitor      *monitor,
 		return;
 
 	if (g_list_find_custom (list,
-				viewer->priv->image->path,
+				viewer->priv->image->utf8_path,
 				(GCompareFunc) uricmp) == NULL)
 		return;
 
@@ -1861,7 +1861,7 @@ gth_viewer_save_pixbuf (GthWindow *window,
 	char                 *current_folder = NULL;
 
 	if (priv->image != NULL) {
-		current_folder = g_strdup (priv->image->path);
+		current_folder = g_strdup (priv->image->utf8_path);
 		update_metadata (priv->image);
 	}
 
@@ -1981,7 +1981,7 @@ reload_current_image__step2 (FileData *file,
 	GthViewer *viewer = data;
 	
 	if (viewer->priv->image != NULL)
-		gth_viewer_load_from_uri (viewer, viewer->priv->image->path);
+		gth_viewer_load_from_uri (viewer, viewer->priv->image->utf8_path);
 	else
 		gth_viewer_load (viewer, NULL);
 }
@@ -2021,7 +2021,7 @@ gth_viewer_get_file_list_selection (GthWindow *window)
 
 	if (viewer->priv->image == NULL)
 		return NULL;
-	return g_list_prepend (NULL, g_strdup (viewer->priv->image->path));
+	return g_list_prepend (NULL, g_strdup (viewer->priv->image->utf8_path));
 }
 
 
diff --git a/src/rotation-utils.c b/src/rotation-utils.c
index 489e309..9041d21 100644
--- a/src/rotation-utils.c
+++ b/src/rotation-utils.c
@@ -27,6 +27,7 @@
 #include <glib/gi18n.h>
 #include <gio/gio.h>
 #include "file-utils.h"
+#include "gfile-utils.h"
 #include "gconf-utils.h"
 #include "gtk-utils.h"
 #include "pixbuf-utils.h"
@@ -163,7 +164,7 @@ apply_transformation_jpeg (FileData       *file,
 		goto apply_transformation_jpeg__free_and_close;
 	}
 
-	gfile = g_file_new_for_uri (file->path);
+	gfile = gfile_new (file->utf8_path);
 	info = g_file_query_info (gfile, "owner::*,access::*", G_FILE_QUERY_INFO_NONE, NULL, NULL);
 	g_object_unref (gfile);
 
@@ -214,7 +215,7 @@ apply_transformation_jpeg (FileData       *file,
 		char *local_uri;
 		
 		local_uri = get_uri_from_local_path (file->local_path);
-		gfile = g_file_new_for_uri (file->path);
+		gfile = gfile_new (file->utf8_path);
 		g_file_set_attributes_from_info (gfile, info, G_FILE_QUERY_INFO_NONE, NULL, NULL);
 		g_object_unref (info);
 		g_object_unref (gfile);



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