GNOME Bugzilla – Bug 522446
nautilus-connect-server crash
Last modified: 2008-03-18 00:09:31 UTC
I opened the "Connect to server..." window, selected "Public ftp", entered the ftp server name, checked "Add Bookmark" and left the Bookmark name field free. Then I clicked connect. The result is a bug-buddy window: The application nautilus-connect-server has crashed. Side note: should the "Add Bookmark" checkbox control the sensitivity of the "Bookmark name" field ?
Hi Matthias, as I can't reproduce the crash, could you please attach a stacktrace of it?
+ Trace 192438
The problem is at nautilus-connect-server-dialog.c:316ish: name = gtk_editable_get_chars (GTK_EDITABLE (dialog->details->name_entry), 0, -1); bookmark = nautilus_bookmark_new (location, strlen (name) ? name : NULL); list = nautilus_bookmark_list_new (); if (!nautilus_bookmark_list_contains (list, bookmark)) { nautilus_bookmark_list_append (list, bookmark); } I think this is wrong; we should pass something in as the bookmark name, as nautilus_bookmark_compare_with() is (IMO correctly) assuming we have a non-NULL bookmark name. This gets us to two possible fixes: the simple one is to change that NULL to g_strdup(_("New Server")); or something similar so we're not passing an empty value in. This is bad, however, as it adds a string, and one that should probably be translated. The more ugly fix would be to change nautilus_bookmark_compare_with() to use EEL's null-tolerant eel_strcmp(); simpler but this is a bit hackish and we really should be setting a name if we're making bookmarks. Thoughts?
gtk+ handles the "no name" case just fine. the title was a later addition to the .gtk-bookmarks format. Other uses of this private file better understand the title-less format, too. So I think allowing an empty name would be ok.
2008-03-14 A. Walton <awalton@svn.gnome.org> * libnautilus-private/nautilus-bookmark.c (nautilus_bookmark_compare_with): Fixes crash if the user doesn't set a name for the bookmark (#520270). Still looks pretty ugly having a bookmark with no name set, but at least it doesn't crash if the user doesn't put in a name.
(And of course, I put the wrong bug number into SVN. What a great day!) Does this look good to close to you Matthias?
Sure, if it doesn't crash anymore, close it. I still think it would be nice to toggle the sensitivity of the name field depending on the bookmark checkbox...
2008-03-14 A. Walton <awalton@svn.gnome.org> * src/nautilus-connect-server-dialog.c (bookmark_checkmark_toggled), (nautilus_connect_server_dialog_init): Set the bookmark name widget in the connect server dialog insensitive if the user doesn't check the add bookmark check button. All fixed.
*** Bug 522320 has been marked as a duplicate of this bug. ***
*** Bug 523077 has been marked as a duplicate of this bug. ***