GNOME Bugzilla – Bug 561957
Load new scripts without restarting Nautilus
Last modified: 2021-06-18 15:14:14 UTC
Nautilus should either watch the script directories and automatically load new scripts and unload deleted ones, or offer some option (command/DBus call/whatever) to do this manually without needing to restart Nautilus. Other information: This has originally been reported in Ubuntu's BTS, at https://launchpad.net/bugs/269213, and A. Walton has submitted an initial patch proposal there (to watch the scripts directory).
Created attachment 168485 [details] [review] Patch by Walton A Walton A submited a patch sometime back in the Ubuntu bug tracker. Attaching the patch here for upstream review. The patch still seems to apply and would be interesting to have.
Review of attachment 168485 [details] [review]: I can see why this might be useful, though AFAICS this patch doesn't do anything for scripts, but only for extensions. ::: libnautilus-private/nautilus-module.c @@ +226,3 @@ +load_module_callback (gpointer data) +{ + gchar *filename = (gchar *)data; No need to cast a gpointer to gchar *. @@ +228,3 @@ + gchar *filename = (gchar *)data; + nautilus_module_load_file (filename); + g_free (filename); This should return FALSE. @@ +247,3 @@ + && g_str_has_suffix (filename, "." G_MODULE_SUFFIX)) + { + g_timeout_add_seconds (10, load_module_callback, g_strdup (filename)); Why the timeout here? @@ +249,3 @@ + g_timeout_add_seconds (10, load_module_callback, g_strdup (filename)); + } + g_free (filename); If you use the timeout, you could just pass |filename| as user_data and avoid one useless strdup/free. @@ +294,1 @@ eel_debug_call_at_shutdown (free_module_objects); At this point, you probably need another eel_debug_call_at_shutdown() to clear the GFileMonitor.
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version of Files (nautilus), then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/nautilus/-/issues/ Thank you for your understanding and your help.