[nautilus] Bug 698892 - Replace slashes in dnd'd text



commit 35b76688d9842134ade30579dfa69f62981377d3
Author: William Kunkel <will wkunkel com>
Date:   Wed Jul 24 22:51:56 2013 -0400

    Bug 698892 - Replace slashes in dnd'd text
    
    https://bugzilla.gnome.org/show_bug.cgi?id=698892

 src/nautilus-view-dnd.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-view-dnd.c b/src/nautilus-view-dnd.c
index fbae954..05f4a85 100644
--- a/src/nautilus-view-dnd.c
+++ b/src/nautilus-view-dnd.c
@@ -352,6 +352,7 @@ get_drop_filename (const char *text)
        int last_nonspace = -1;
        int num_attrs;
        PangoLogAttr *attrs;
+       gchar *current_char;
 
        num_attrs = MIN (g_utf8_strlen (text, -1) + 1, MAX_LEN_FILENAME);
        attrs = g_new (PangoLogAttr, num_attrs);
@@ -383,6 +384,15 @@ get_drop_filename (const char *text)
                filename = g_strdup (_("Dropped Text.txt"));
        }
 
+       /* Remove any invalid characters */
+       for (current_char = filename;
+            *current_char;
+            current_char = g_utf8_next_char (current_char)) {
+               if ( G_IS_DIR_SEPARATOR ( g_utf8_get_char (current_char))) {
+                       *current_char = '-';
+               }
+       }
+
        return filename;
 }
 


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