GNOME Bugzilla – Bug 633683
Nautilus silently not starting when ~/.gnome2/nautilus-scripts is broken symlilnk
Last modified: 2011-02-21 14:35:32 UTC
Steps to reproduce: 1. Remove ~/.gnome2/nautilus-scripts 2. Create symlink to any other location, named "nautilus-scripts" in ~/.gnome2/ (in my case it was ~/sh/nautilus-scripts/) 3. Move target of link. 4. execute $ nautilus -q Then nautilus won't start and will not indicate source of problem.
Created attachment 179373 [details] [review] proposed patch for 2.91+ Confirming. Nautilus doesn't work Now if the scripts dir is detected to be a broken symlink -- or if for any reason it cannot be created succesfully --, nautilus ignores it and prints a warning. Given that the event of a broken symlink is quite unlikely for an ordinary user, a warning -- instead of an error dialog -- should be sufficient. Please review.
Created attachment 180270 [details] [review] Cleaned up patch for 2. Removed some unrequired changes from the patch. Just tested, it works.
Review of attachment 180270 [details] [review]: Thanks for the update, still not completely right though. ::: src/nautilus-view.c @@ +2537,3 @@ set_up_scripts_directory_global (); scripts_directory = nautilus_directory_get_by_uri (scripts_directory_uri); + if (scripts_directory != NULL) { There is no need to go through nautilus_directory_get_by_uri() for this to fail, you should just check for (scripts_directory_uri != NULL) after the setup function has been called instead, or make that return a boolean.
Created attachment 180571 [details] [review] revised patch Okay, revised patch as per Cosimo's comments. Sorry about the previous patch, I didn't pay enough attention to the code while writing it. My bad.
Review of attachment 180571 [details] [review]: Looks good, just a minor code-style thing. Please push to master with that fixed. ::: src/nautilus-view.c @@ +2537,3 @@ gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (view), GTK_SHADOW_ETCHED_IN); + if (set_up_scripts_directory_global () == TRUE) { Nautilus' code-style doesn't usually explicitly use boolean values for comparisons in if() blocks, so this should just be if (set_up_scripts_directory_global ()) {
I see you pushed this, closing.