[gtk+/gtk-2-24] filechooserentry: Only append / to directory names once



commit 5280da05eec0937e6d203818c156d45f7336e6ce
Author: Benjamin Otte <otte redhat com>
Date:   Thu Nov 3 17:32:44 2011 +0100

    filechooserentry: Only append / to directory names once
    
    Since 069d78ed31fc1c0a9cb7621d27fe10d7b974315b the / is appended to
    directories upon constructing the display name, so there is no need to
    do it later.

 gtk/gtkfilechooserentry.c |   38 --------------------------------------
 1 files changed, 0 insertions(+), 38 deletions(-)
---
diff --git a/gtk/gtkfilechooserentry.c b/gtk/gtkfilechooserentry.c
index 93692b5..d1f6a3a 100644
--- a/gtk/gtkfilechooserentry.c
+++ b/gtk/gtkfilechooserentry.c
@@ -329,7 +329,6 @@ match_selected_callback (GtkEntryCompletion  *completion,
   char *display_name;
   GFile *file;
   gint pos;
-  gboolean dummy;
   
   gtk_tree_model_get (model, iter,
                      DISPLAY_NAME_COLUMN, &display_name,
@@ -344,8 +343,6 @@ match_selected_callback (GtkEntryCompletion  *completion,
       return FALSE;
     }
 
-  display_name = maybe_append_separator_to_file (chooser_entry, file, display_name, &dummy);
-
   pos = chooser_entry->file_part_pos;
 
   /* We don't set in_change here as we want to update the current_folder
@@ -624,29 +621,6 @@ find_common_prefix (GtkFileChooserEntry *chooser_entry,
   return TRUE;
 }
 
-static gboolean
-char_after_cursor_is_directory_separator (GtkFileChooserEntry *chooser_entry)
-{
-  int cursor_pos;
-  gboolean result;
-
-  result = FALSE;
-
-  cursor_pos = gtk_editable_get_position (GTK_EDITABLE (chooser_entry));
-  if (cursor_pos < gtk_entry_get_text_length (GTK_ENTRY (chooser_entry)))
-    {
-      char *next_char_str;
-
-      next_char_str = gtk_editable_get_chars (GTK_EDITABLE (chooser_entry), cursor_pos, cursor_pos + 1);
-      if (G_IS_DIR_SEPARATOR (*next_char_str))
-       result = TRUE;
-
-      g_free (next_char_str);
-    }
-
-  return result;
-}
-
 typedef enum {
   INVALID_INPUT,               /* what the user typed is bogus */
   NO_MATCH,                    /* no matches based on what the user typed */
@@ -701,18 +675,6 @@ append_common_prefix (GtkFileChooserEntry *chooser_entry,
 
   if (unique_file)
     {
-      if (!char_after_cursor_is_directory_separator (chooser_entry))
-        {
-          gboolean appended;
-
-          common_prefix = maybe_append_separator_to_file (chooser_entry,
-                                                          unique_file,
-                                                          common_prefix,
-                                                          &appended);
-          if (appended)
-            prefix_expands_the_file_part = TRUE;
-        }
-
       g_object_unref (unique_file);
 
       if (prefix_expands_the_file_part)


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