[gtk+] filechooserentry: Only append / to directory names once
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] filechooserentry: Only append / to directory names once
- Date: Fri, 16 Dec 2011 19:12:09 +0000 (UTC)
commit 2b9ecd97060f4ffa1ff1963719d5b266469f020b
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 c90872c..d745b51 100644
--- a/gtk/gtkfilechooserentry.c
+++ b/gtk/gtkfilechooserentry.c
@@ -321,7 +321,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,
@@ -337,8 +336,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
@@ -617,29 +614,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 */
@@ -694,18 +668,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]