[Xfce4-commits] <xfce4-settings:nick/mime-settings> Also crawl the "Added Associations" and mark as user config.

Nick Schermer noreply at xfce.org
Sat Jan 21 01:08:02 CET 2012


Updating branch refs/heads/nick/mime-settings
         to ae016a96bfa282f93504837ade857ea33ead806d (commit)
       from 5cd4448bdab51879e6bf45e5b2b38b5f8a138301 (commit)

commit ae016a96bfa282f93504837ade857ea33ead806d
Author: Nick Schermer <nick at xfce.org>
Date:   Sat Jan 21 01:05:50 2012 +0100

    Also crawl the "Added Associations" and mark as user config.

 dialogs/mime-settings/xfce-mime-window.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/dialogs/mime-settings/xfce-mime-window.c b/dialogs/mime-settings/xfce-mime-window.c
index 048de46..e2775df 100644
--- a/dialogs/mime-settings/xfce-mime-window.c
+++ b/dialogs/mime-settings/xfce-mime-window.c
@@ -289,6 +289,8 @@ xfce_mime_window_mime_user (void)
     XfceRc      *rc;
     guint        i;
     gchar      **mimes;
+    guint        n;
+    const gchar *groups[] = { "Added Associations", "Default Applications" };
 
     table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
 
@@ -301,12 +303,15 @@ xfce_mime_window_mime_user (void)
 
     if (G_LIKELY (rc != NULL))
     {
-        mimes = xfce_rc_get_entries (rc, "Default Applications");
-        if (G_LIKELY (mimes != NULL))
+        for (n = 0; n < G_N_ELEMENTS (groups); n++)
         {
-            for (i = 0; mimes[i] != NULL; i++)
-                g_hash_table_insert (table, mimes[i], mimes[i]);
-            g_free (mimes);
+            mimes = xfce_rc_get_entries (rc, groups[n]);
+            if (G_LIKELY (mimes != NULL))
+            {
+                for (i = 0; mimes[i] != NULL; i++)
+                    g_hash_table_insert (table, mimes[i], mimes[i]);
+                g_free (mimes);
+            }
         }
 
         xfce_rc_close (rc);


More information about the Xfce4-commits mailing list