xfdesktop: nodisplay

Danny Milosavljevic danny.milo at gmx.net
Sat Aug 14 14:08:31 CEST 2004


Hi Brian,

attached you find a patch to make the dentry code search for "NoDisplay"
property which really signals if an entry should be shown in the menu or
not (actually, if it is a standalone program or just some action for a
program).

We already handled "Hidden" which strangely enough only means if the
entry has been *Deleted* (completely) :)

I hope that makes those weird "Add file to xxx" vanish from the desktop
menu :)

cheers,
   Danny


-------------- next part --------------
--- desktop-menu-dentry.c.orig	2004-08-14 14:03:27.970348776 +0200
+++ desktop-menu-dentry.c	2004-08-14 14:04:21.487212976 +0200
@@ -67,6 +67,7 @@
 static const char *dentry_keywords [] = {
    "Name", "Comment", "Icon", "Hidden", "StartupNotify",
    "Categories", "OnlyShowIn", "Exec", "Terminal",
+   "NoDisplay"
 };
 
 #if 0
@@ -280,7 +281,7 @@
 menu_dentry_parse_dentry(XfceDesktopMenu *desktop_menu, XfceDesktopEntry *de,
 		MenuPathType pathtype, gboolean is_legacy, const gchar *extra_cat)
 {
-	gchar *categories = NULL, *hidden = NULL, *onlyshowin = NULL;
+	gchar *categories = NULL, *hidden = NULL, *onlyshowin = NULL, *nodisplay = NULL;
 	gchar *path = NULL, *exec = NULL, *p;
 	GtkWidget *mi = NULL, *menu;
 	gint i, menu_pos;
@@ -299,6 +300,10 @@
 	xfce_desktop_entry_get_string(de, "Hidden", FALSE, &hidden);
 	if(hidden && !g_ascii_strcasecmp(hidden, "true"))
 		goto cleanup;
+
+	xfce_desktop_entry_get_string(de, "NoDisplay", FALSE, &nodisplay);
+	if(nodisplay && !g_ascii_strcasecmp(nodisplay, "true"))
+		goto cleanup;
 	
 	/* check for blacklisted item */
 	xfce_desktop_entry_get_string(de, "Exec", FALSE, &exec);
@@ -440,6 +445,8 @@
 		desktop_menuspec_path_free(newpaths);
 	if(onlyshowin)
 		g_free(onlyshowin);
+	if(nodisplay)
+		g_free(nodisplay);
 	if(hidden)
 		g_free(hidden);
 	if(categories)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
URL: <http://mail.xfce.org/pipermail/xfce4-dev/attachments/20040814/7f69deeb/attachment.pgp>


More information about the Xfce4-dev mailing list