[Xfce4-commits] <midori:master> Double check that we're not adding addons twice

Christian Dywan noreply at xfce.org
Thu May 26 21:10:01 CEST 2011


Updating branch refs/heads/master
         to dfb7225af528bd7cf5afdab1ce120e62f8391cef (commit)
       from 8353a1552410b39b31dac54c77621892c088bc85 (commit)

commit dfb7225af528bd7cf5afdab1ce120e62f8391cef
Author: Paweł Forysiuk <tuxator at o2.pl>
Date:   Thu May 26 21:05:07 2011 +0200

    Double check that we're not adding addons twice

 extensions/addons.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/extensions/addons.c b/extensions/addons.c
index aeb948b..08eb2ab 100644
--- a/extensions/addons.c
+++ b/extensions/addons.c
@@ -843,7 +843,7 @@ addons_get_directories (AddonsKind kind)
     {
         path = g_build_path (G_DIR_SEPARATOR_S, *datadirs,
                              PACKAGE_NAME, folder_name, NULL);
-        if (g_access (path, X_OK) == 0)
+        if (g_slist_find (directories, path) == NULL && g_access (path, X_OK) == 0)
             directories = g_slist_prepend (directories, path);
         else
             g_free (path);
@@ -888,7 +888,8 @@ addons_get_files (AddonsKind kind)
                 if (g_str_has_suffix (filename, file_extension))
                 {
                     fullname = g_build_filename (dirname, filename, NULL);
-                    files = g_slist_prepend (files, fullname);
+                    if (g_slist_find (files, fullname) == NULL)
+                        files = g_slist_prepend (files, fullname);
                 }
             }
             g_dir_close (addon_dir);



More information about the Xfce4-commits mailing list