Author: kelnos
Date: 2008-10-19 21:45:39 +0000 (Sun, 19 Oct 2008)
New Revision: 28312

Modified:
   xfce4-settings/trunk/xfce4-settings-editor/xfce4-settings-editor.desktop.in
   xfce4-settings/trunk/xfce4-settings-manager/xfce-settings-manager-dialog.c
   xfce4-settings/trunk/xfce4-settings-manager/xfce-settings-manager.desktop.in
Log:
ditch X-XfceSettingsDialog category and key off X-XFCE and
DesktopSettings.  add X-XfceSettingsManagerHidden key in order to
blacklist apps like xfce4-settings-manager itself, and
xfce4-settings-edditor

Modified: 
xfce4-settings/trunk/xfce4-settings-editor/xfce4-settings-editor.desktop.in
===================================================================
--- xfce4-settings/trunk/xfce4-settings-editor/xfce4-settings-editor.desktop.in 
2008-10-19 21:14:10 UTC (rev 28311)
+++ xfce4-settings/trunk/xfce4-settings-editor/xfce4-settings-editor.desktop.in 
2008-10-19 21:45:39 UTC (rev 28312)
@@ -9,3 +9,4 @@
 Categories=X-XFCE;Settings;DesktopSettings;
 OnlyShowIn=XFCE;
 _GenericName=Settings Editor
+X-XfceSettingsManagerHidden=true

Modified: 
xfce4-settings/trunk/xfce4-settings-manager/xfce-settings-manager-dialog.c
===================================================================
--- xfce4-settings/trunk/xfce4-settings-manager/xfce-settings-manager-dialog.c  
2008-10-19 21:14:10 UTC (rev 28311)
+++ xfce4-settings/trunk/xfce4-settings-manager/xfce-settings-manager-dialog.c  
2008-10-19 21:45:39 UTC (rev 28312)
@@ -40,8 +40,6 @@
 
 #include "xfce-settings-manager-dialog.h"
 
-#define SETTINGS_CATEGORY  "X-XfceSettingsDialog"
-
 struct _XfceSettingsManagerDialog
 {
     XfceTitledDialog parent;
@@ -363,6 +361,9 @@
         while((file = g_dir_read_name(d))) {
             XfceRc *rcfile;
             const gchar *name, *exec, *value;
+            gchar **categories;
+            gboolean have_x_xfce = FALSE, have_desktop_settings = FALSE;
+            gint j;
             GtkTreeIter iter;
 
             if(!g_str_has_suffix(file, ".desktop"))
@@ -379,21 +380,29 @@
             }
             xfce_rc_set_group(rcfile, "Desktop Entry");
 
-            value = xfce_rc_read_entry(rcfile, "Categories", NULL);
-            if(!value) {
+            categories = xfce_rc_read_list_entry(rcfile, "Categories", ";");
+            if(!categories) {
                 xfce_rc_close(rcfile);
                 continue;
             }
 
-            if(strncmp(value, SETTINGS_CATEGORY ";",
-                       strlen(SETTINGS_CATEGORY ";"))
-               && !strstr(value, ";" SETTINGS_CATEGORY ";"))
-            {
+            for(j = 0; categories[j]; ++j) {
+                if(!strcmp(categories[j], "X-XFCE"))
+                    have_x_xfce = TRUE;
+                else if(!strcmp(categories[j], "DesktopSettings"))
+                    have_desktop_settings = TRUE;
+            }
+            g_strfreev(categories);
+            if(!have_x_xfce || !have_desktop_settings) {
                 xfce_rc_close(rcfile);
                 continue;
             }
 
-            if(xfce_rc_read_bool_entry(rcfile, "Hidden", FALSE)) {
+            if(xfce_rc_read_bool_entry(rcfile, "Hidden", FALSE)
+               || xfce_rc_read_bool_entry(rcfile,
+                                          "X-XfceSettingsManagerHidden",
+                                          FALSE))
+            {
                 xfce_rc_close(rcfile);
                 continue;
             }

Modified: 
xfce4-settings/trunk/xfce4-settings-manager/xfce-settings-manager.desktop.in
===================================================================
--- 
xfce4-settings/trunk/xfce4-settings-manager/xfce-settings-manager.desktop.in    
    2008-10-19 21:14:10 UTC (rev 28311)
+++ 
xfce4-settings/trunk/xfce4-settings-manager/xfce-settings-manager.desktop.in    
    2008-10-19 21:45:39 UTC (rev 28312)
@@ -9,3 +9,4 @@
 Categories=X-XFCE;Settings;DesktopSettings;
 OnlyShowIn=XFCE;
 _GenericName=Settings Manager
+X-XfceSettingsManagerHidden=true

_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to