[Xfce4-commits] <midori:master> Only monitor actually existing user script/ style folders

Christian Dywan noreply at xfce.org
Tue Dec 22 00:20:04 CET 2009


Updating branch refs/heads/master
         to eddb3ef55773d20865cf6d5c67232ab9b499517d (commit)
       from dc288dd3c35136e9c301919f52b1249eb8629b8d (commit)

commit eddb3ef55773d20865cf6d5c67232ab9b499517d
Author: Alexander Butenko <a.butenka at gmail.com>
Date:   Mon Dec 21 23:36:22 2009 +0100

    Only monitor actually existing user script/ style folders

 panels/midori-addons.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/panels/midori-addons.c b/panels/midori-addons.c
index efeec63..091e590 100644
--- a/panels/midori-addons.c
+++ b/panels/midori-addons.c
@@ -22,9 +22,14 @@
 #include <webkit/webkit.h>
 #include <JavaScriptCore/JavaScript.h>
 #include <glib/gi18n.h>
+#include <glib/gstdio.h>
 #include <string.h>
 #include <gio/gio.h>
 
+#if HAVE_UNISTD_H
+    #include <unistd.h>
+#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++;
         }
     }



More information about the Xfce4-commits mailing list