[gnome-photos/wip/rishi/issue-114: 11/11] device-item, local-item: Try to convert the path in the UI to UTF-8



commit 7b1c9161fa3bc2877c88787e1fe9be7816783df3
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Sep 11 07:49:03 2018 +0200

    device-item, local-item: Try to convert the path in the UI to UTF-8
    
    https://gitlab.gnome.org/GNOME/gnome-photos/issues/114

 src/photos-device-item.c | 6 +++---
 src/photos-local-item.c  | 8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/photos-device-item.c b/src/photos-device-item.c
index 64129c88..5bfbd770 100644
--- a/src/photos-device-item.c
+++ b/src/photos-device-item.c
@@ -318,7 +318,7 @@ photos_device_item_get_source_widget (PhotosBaseItem *item)
   GtkWidget *label;
   GtkWidget *source_widget;
   const gchar *uri;
-  g_autofree gchar *source_path = NULL;
+  g_autofree gchar *source_parse_name = NULL;
   g_autofree gchar *source_uri = NULL;
 
   g_return_val_if_fail (!photos_base_item_is_collection (item), NULL);
@@ -326,10 +326,10 @@ photos_device_item_get_source_widget (PhotosBaseItem *item)
   uri = photos_base_item_get_uri (item);
   file = g_file_new_for_uri (uri);
   source_link = g_file_get_parent (file);
-  source_path = g_file_get_path (source_link);
+  source_parse_name = g_file_get_parse_name (source_link);
   source_uri = g_file_get_uri (source_link);
 
-  source_widget = gtk_link_button_new_with_label (source_uri, source_path);
+  source_widget = gtk_link_button_new_with_label (source_uri, source_parse_name);
   gtk_widget_set_halign (source_widget, GTK_ALIGN_START);
   g_signal_connect_object (source_widget,
                            "activate-link",
diff --git a/src/photos-local-item.c b/src/photos-local-item.c
index 042e9349..7c8968ee 100644
--- a/src/photos-local-item.c
+++ b/src/photos-local-item.c
@@ -1,7 +1,7 @@
 /*
  * Photos - access, organize and share your photos on GNOME
  * Copyright © 2014 Pranav Kant
- * Copyright © 2012 – 2017 Red Hat, Inc.
+ * Copyright © 2012 – 2018 Red Hat, Inc.
  * Copyright © 2016 Umang Jain
  *
  * This program is free software: you can redistribute it and/or modify
@@ -245,16 +245,16 @@ photos_local_item_get_source_widget (PhotosBaseItem *item)
       g_autoptr (GFile) source_link = NULL;
       GtkWidget *label;
       const gchar *uri;
-      g_autofree gchar *source_path = NULL;
+      g_autofree gchar *source_parse_name = NULL;
       g_autofree gchar *source_uri = NULL;
 
       uri = photos_base_item_get_uri (item);
       file = g_file_new_for_uri (uri);
       source_link = g_file_get_parent (file);
-      source_path = g_file_get_path (source_link);
+      source_parse_name = g_file_get_parse_name (source_link);
       source_uri = g_file_get_uri (source_link);
 
-      source_widget = gtk_link_button_new_with_label (source_uri, source_path);
+      source_widget = gtk_link_button_new_with_label (source_uri, source_parse_name);
       gtk_widget_set_halign (source_widget, GTK_ALIGN_START);
       g_signal_connect_object (source_widget,
                                "activate-link",


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