[Xfce4-commits] <ristretto:ristretto-0.0> Remove g_file_get_path stuff, work with URI's or not at all

Stephan Arts noreply at xfce.org
Sun Oct 23 19:27:06 CEST 2011


Updating branch refs/heads/ristretto-0.0
         to c5f540c66b5172560f9343d0e75da845241fffc9 (commit)
       from a7784687b4a1cf384405725ff618f5f038b6ae76 (commit)

commit c5f540c66b5172560f9343d0e75da845241fffc9
Author: Stephan Arts <stephan at xfce.org>
Date:   Sun Aug 1 23:42:21 2010 +0200

    Remove g_file_get_path stuff, work with URI's or not at all

 src/main_window.c |   20 ++++++++------------
 src/thumbnail.c   |   11 +++++------
 2 files changed, 13 insertions(+), 18 deletions(-)

diff --git a/src/main_window.c b/src/main_window.c
index 157028a..a96e94f 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -752,7 +752,7 @@ rstto_main_window_new (RsttoImageList *image_list, gboolean fullscreen)
 static void
 rstto_main_window_image_list_iter_changed (RsttoMainWindow *window)
 {
-    gchar *path, *path_basename, *title, *status;
+    gchar *file_basename, *title, *status;
     GFile *file = NULL;
     GFileInfo *file_info = NULL;
     RsttoImage *cur_image;
@@ -793,21 +793,19 @@ rstto_main_window_image_list_iter_changed (RsttoMainWindow *window)
             height = rstto_image_get_height(cur_image);
 
 
-            path = g_file_get_path (file);
-            path_basename = g_path_get_basename (path);
+            file_basename = g_file_get_basename (file);
 
-            title = g_strdup_printf ("%s - %s [%d/%d]", RISTRETTO_APP_TITLE,  path_basename, position+1, count);
+            title = g_strdup_printf ("%s - %s [%d/%d]", RISTRETTO_APP_TITLE,  file_basename, position+1, count);
             if (width > 0)
             {
                 status = g_strdup_printf ("%d x %d", width, height);
             }
             else
             {
-                status = g_strdup_printf ("Loading '%s'", path_basename);
+                status = g_strdup_printf ("Loading '%s'", file_basename);
             }
 
-            g_free (path_basename);
-            g_free (path);
+            g_free (file_basename);
         }
         else
         {
@@ -2263,8 +2261,7 @@ cb_rstto_main_window_delete (GtkWidget *widget, RsttoMainWindow *window)
 {
     RsttoImage *image = rstto_image_list_iter_get_image (window->priv->iter);
     GFile *file = rstto_image_get_file (image);
-    gchar *path = g_file_get_path (file);
-    gchar *path_basename = g_path_get_basename (path);
+    gchar *file_basename = g_file_get_basename (file);
     GtkWidget *dialog;
     g_return_if_fail (rstto_image_list_get_n_images (window->priv->props.image_list) > 0);
 
@@ -2273,7 +2270,7 @@ cb_rstto_main_window_delete (GtkWidget *widget, RsttoMainWindow *window)
                                                 GTK_MESSAGE_WARNING,
                                                 GTK_BUTTONS_OK_CANCEL,
                                                 N_("Are you sure you want to delete image '%s' from disk?"),
-                                                path_basename);
+                                                file_basename);
 
     g_object_ref (image);
     if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK)
@@ -2288,8 +2285,7 @@ cb_rstto_main_window_delete (GtkWidget *widget, RsttoMainWindow *window)
         }
     }
     gtk_widget_destroy (dialog);
-    g_free (path_basename);
-    g_free (path);
+    g_free (file_basename);
     g_object_unref (image);
 }
 
diff --git a/src/thumbnail.c b/src/thumbnail.c
index 2438985..7c0a362 100644
--- a/src/thumbnail.c
+++ b/src/thumbnail.c
@@ -288,7 +288,7 @@ rstto_thumbnail_paint(RsttoThumbnail *thumb)
 GtkWidget *
 rstto_thumbnail_new (RsttoImage *image)
 {
-    gchar *path, *path_basename;
+    gchar *file_basename;
     GFile *file = NULL;
     RsttoThumbnail *thumb;
 
@@ -301,13 +301,12 @@ rstto_thumbnail_new (RsttoImage *image)
 
     file = rstto_image_get_file (image);
 
-    path = g_file_get_path (file);
-    path_basename = g_path_get_basename (path);
+    file_basename = g_file_get_basename (file);
 
-    gtk_widget_set_tooltip_text(GTK_WIDGET(thumb), path_basename);
+    gtk_widget_set_tooltip_text(GTK_WIDGET(thumb), file_basename);
+
+    g_free (file_basename);
 
-    g_free (path_basename);
-    g_free (path);
     return GTK_WIDGET(thumb);
 }
 


More information about the Xfce4-commits mailing list