[nautilus] bookmarks-window: always get the bookmark name from the name field.



commit a1c3133427e40ccc7ff4082249eb0e20e23ff51a
Author: Emmanuel Vasilakis <mrzammler gmail com>
Date:   Fri Sep 27 16:21:47 2013 +0300

    bookmarks-window: always get the bookmark name from the name field.
    
    Always get the current value in the name field when editing a bookmark.
    This will prevent passing NULL to nautilus_bookmark_new when the user
    edits only the URI field. I suspect that passing NULL to
    nautilus_bookmark_new causes nautilus to create a new name from URI,
    thus overwriting the current bookmark name.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=576976

 src/nautilus-bookmarks-window.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/src/nautilus-bookmarks-window.c b/src/nautilus-bookmarks-window.c
index 8b15c6c..39bb97b 100644
--- a/src/nautilus-bookmarks-window.c
+++ b/src/nautilus-bookmarks-window.c
@@ -86,7 +86,6 @@ struct NautilusBookmarksWindowPrivate {
        gulong name_changed_id;
        gulong uri_changed_id;
        gboolean text_changed;
-       gboolean name_text_changed;
 
        GtkWidget *remove_button;
        GtkWidget *up_button;
@@ -231,7 +230,6 @@ on_selection_changed (GtkTreeSelection *treeselection,
        g_signal_handler_unblock (self->priv->uri_field, self->priv->uri_changed_id);
 
        self->priv->text_changed = FALSE;
-       self->priv->name_text_changed = FALSE;
 
        g_free (entry_text);
 }
@@ -375,7 +373,6 @@ on_name_field_changed (GtkEditable *editable,
                            -1);
 
        self->priv->text_changed = TRUE;
-       self->priv->name_text_changed = TRUE;
 }
 
 static void
@@ -518,8 +515,8 @@ update_bookmark_from_text (NautilusBookmarksWindow *self)
                (gtk_entry_get_text (GTK_ENTRY (self->priv->uri_field)));
 
        bookmark = nautilus_bookmark_new (location,
-                                         self->priv->name_text_changed ?
-                                         gtk_entry_get_text (GTK_ENTRY (self->priv->name_field)) : NULL);
+                                         gtk_entry_get_text (GTK_ENTRY (self->priv->name_field)));
+
        g_object_unref (location);
 
        selected_row = get_selected_row (self);


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