From eddb3ef55773d20865cf6d5c67232ab9b499517d Mon Sep 17 00:00:00 2001 From: Alexander Butenko Date: Mon, 21 Dec 2009 23:36:22 +0100 Subject: [PATCH] Only monitor actually existing user script/ style folders --- panels/midori-addons.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/panels/midori-addons.c b/panels/midori-addons.c index efeec635..091e5904 100644 --- a/panels/midori-addons.c +++ b/panels/midori-addons.c @@ -22,9 +22,14 @@ #include #include #include +#include #include #include +#if HAVE_UNISTD_H + #include +#endif + struct _MidoriAddons { GtkVBox parent_instance; @@ -212,14 +217,20 @@ _addons_get_directories (MidoriAddons* addons) { path = g_build_path (G_DIR_SEPARATOR_S, g_get_user_data_dir (), PACKAGE_NAME, folders[i], NULL); - directories = g_slist_prepend (directories, path); + if (g_access (path, X_OK) == 0) + directories = g_slist_prepend (directories, path); + else + g_free (path); datadirs = g_get_system_data_dirs (); while (*datadirs) { path = g_build_path (G_DIR_SEPARATOR_S, *datadirs, PACKAGE_NAME, folders[i], NULL); - directories = g_slist_prepend (directories, path); + if (g_access (path, X_OK) == 0) + directories = g_slist_prepend (directories, path); + else + g_free (path); datadirs++; } } -- 2.39.5