[maemo-commits] [maemo-commits] r13850 - in projects/haf/trunk/hildon-desktop: . libhildondesktop

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Mon Sep 17 16:14:41 EEST 2007
Author: jobi
Date: 2007-09-17 16:14:39 +0300 (Mon, 17 Sep 2007)
New Revision: 13850

Modified:
   projects/haf/trunk/hildon-desktop/ChangeLog
   projects/haf/trunk/hildon-desktop/libhildondesktop/libhildonmenu.c
   projects/haf/trunk/hildon-desktop/libhildondesktop/libhildonmenu.h
Log:

2007-09-17 Johan Bilien  <johan.bilien at nokia.com>

	* libhildondesktop/libhildonmenu.[ch]: added support for
	the NoDisplay field



Modified: projects/haf/trunk/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-desktop/ChangeLog	2007-09-17 12:46:59 UTC (rev 13849)
+++ projects/haf/trunk/hildon-desktop/ChangeLog	2007-09-17 13:14:39 UTC (rev 13850)
@@ -1,3 +1,8 @@
+2007-09-17 Johan Bilien  <johan.bilien at nokia.com>
+
+	* libhildondesktop/libhildonmenu.[ch]: added support for
+	the NoDisplay field
+
 2007-09-17  Lucas Rocha  <lucas.rocha at nokia.com>
 
 	* src/hd-switcher-menu.c (hd_switcher_menu_refresh_application_items):

Modified: projects/haf/trunk/hildon-desktop/libhildondesktop/libhildonmenu.c
===================================================================
--- projects/haf/trunk/hildon-desktop/libhildondesktop/libhildonmenu.c	2007-09-17 12:46:59 UTC (rev 13849)
+++ projects/haf/trunk/hildon-desktop/libhildondesktop/libhildonmenu.c	2007-09-17 13:14:39 UTC (rev 13850)
@@ -279,7 +279,8 @@
 				g_str_has_suffix(current_path,
 					DESKTOP_FILE_SUFFIX)) {
 
-            gchar *type = NULL;
+                        gchar *type = NULL;
+                        gboolean no_display;
 
 			key_file = g_key_file_new();
 
@@ -299,6 +300,22 @@
 			}
 						
 
+                        /* Check for the optional NoDisplay key.
+                         * If found and true, continue, we won't
+                         * have it in the menu */
+                        no_display = g_key_file_get_boolean(key_file,
+                                                            DESKTOP_ENTRY_GROUP,
+                                                            DESKTOP_ENTRY_NO_DISPLAY_FIELD,
+                                                            &error);
+
+                        if (error)
+                          g_clear_error (&error);
+                        else if (no_display)
+                        {
+                          g_free (current_path);
+                          continue;
+                        }
+
 			type = g_key_file_get_string(
                                          key_file,
                                          DESKTOP_ENTRY_GROUP,

Modified: projects/haf/trunk/hildon-desktop/libhildondesktop/libhildonmenu.h
===================================================================
--- projects/haf/trunk/hildon-desktop/libhildondesktop/libhildonmenu.h	2007-09-17 12:46:59 UTC (rev 13849)
+++ projects/haf/trunk/hildon-desktop/libhildondesktop/libhildonmenu.h	2007-09-17 13:14:39 UTC (rev 13850)
@@ -38,6 +38,7 @@
 #define DESKTOP_ENTRY_EXEC_FIELD        "Exec"
 #define DESKTOP_ENTRY_SERVICE_FIELD     "X-Osso-Service"
 #define DESKTOP_ENTRY_TEXT_DOMAIN_FIELD "X-Text-Domain"
+#define DESKTOP_ENTRY_NO_DISPLAY_FIELD  "NoDisplay"
 
 #define SEPARATOR_STRING   "SEPARATOR"
 #define EXTRAS_MENU_STRING "tana_fi_extras"


More information about the maemo-commits mailing list