[ghex] Use g_uri_list_extract_uris when a file is dragged and dropped



commit 979b117d418db9ffc12b4af3ec629520601d0951
Author: Alex Henrie <alexhenrie24 gmail com>
Date:   Tue Jul 10 16:54:18 2012 -0600

    Use g_uri_list_extract_uris when a file is dragged and dropped
    
    When files are dragged and dropped into GHex, the drag data comes
    through as text/uri-list. This media type is described by RFC 2483 and
    can actually be quite complex, with CRLF at the end of every line and
    optional comment lines interspersed with the data. Without using the
    right function to parse this data, GHex shows an error message when
    dropping files from PCManFM to GHex.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=679717

 src/ghex-window.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/ghex-window.c b/src/ghex-window.c
index 3354138..f69e634 100644
--- a/src/ghex-window.c
+++ b/src/ghex-window.c
@@ -60,7 +60,7 @@ ghex_window_drag_data_received(GtkWidget *widget,
     else
         newwin = NULL;
 
-    uri = uris_to_open = g_strsplit (gtk_selection_data_get_data (selection_data), "\r\n", 0);
+    uri = uris_to_open = g_uri_list_extract_uris (gtk_selection_data_get_data (selection_data));
     while (*uri) {
         GError *err = NULL;
         gchar *filename = g_filename_from_uri (*uri, NULL, &err);



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