After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 633683 - Nautilus silently not starting when ~/.gnome2/nautilus-scripts is broken symlilnk
Nautilus silently not starting when ~/.gnome2/nautilus-scripts is broken syml...
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Scripts facilities
2.31.x
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-11-01 10:03 UTC by Serhiy Zahoriya
Modified: 2011-02-21 14:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch for 2.91+ (2.81 KB, patch)
2011-01-26 14:48 UTC, Stefano Teso
none Details | Review
Cleaned up patch for 2. (1.01 KB, patch)
2011-02-07 08:35 UTC, Stefano Teso
needs-work Details | Review
revised patch (1.78 KB, patch)
2011-02-10 12:19 UTC, Stefano Teso
committed Details | Review

Description Serhiy Zahoriya 2010-11-01 10:03:09 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.
Comment 1 Stefano Teso 2011-01-26 14:48:12 UTC
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.
Comment 2 Stefano Teso 2011-02-07 08:35:11 UTC
Created attachment 180270 [details] [review]
Cleaned up patch for 2.

Removed some unrequired changes from the patch. Just tested, it works.
Comment 3 Cosimo Cecchi 2011-02-07 16:37:16 UTC
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.
Comment 4 Stefano Teso 2011-02-10 12:19:39 UTC
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.
Comment 5 Cosimo Cecchi 2011-02-12 16:28:56 UTC
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 ()) {
Comment 6 Cosimo Cecchi 2011-02-21 14:35:18 UTC
I see you pushed this, closing.