[gnome-packagekit] Do not show the menu path of installed software as this makes no sense with either GNOME Shell or Un



commit a07405bf0b7542d832979ec10e157ab8c510c2b3
Author: Richard Hughes <richard hughsie com>
Date:   Wed Apr 6 14:44:00 2011 +0100

    Do not show the menu path of installed software as this makes no sense with either GNOME Shell or Unity

 configure.ac                     |    2 -
 contrib/gnome-packagekit.spec.in |    1 -
 src/gpk-application.c            |   12 ----
 src/gpk-desktop.c                |  103 --------------------------------------
 src/gpk-desktop.h                |    1 -
 src/gpk-helper-run.c             |   14 -----
 6 files changed, 0 insertions(+), 133 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index b219212..d3c93bf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -115,8 +115,6 @@ PKG_CHECK_MODULES(DBUS, \
  gthread-2.0)
 PKG_CHECK_MODULES(GTK, \
  gtk+-3.0 >= 2.91.0 gdk-3.0 fontconfig)
-PKG_CHECK_MODULES(GNOME_MENUS, \
- libgnome-menu >= 2.24.1)
 PKG_CHECK_MODULES(UPOWER, [
  upower-glib >= 0.9.0])
 PKG_CHECK_MODULES(CANBERRA, libcanberra-gtk3 >= 0.10)
diff --git a/contrib/gnome-packagekit.spec.in b/contrib/gnome-packagekit.spec.in
index 061d7f3..798f398 100644
--- a/contrib/gnome-packagekit.spec.in
+++ b/contrib/gnome-packagekit.spec.in
@@ -43,7 +43,6 @@ BuildRequires: cairo-devel
 BuildRequires: startup-notification-devel
 BuildRequires: perl(XML::Parser)
 BuildRequires: gnome-doc-utils
-BuildRequires: gnome-menus-devel >= 2.24.1
 BuildRequires: PackageKit-devel >= 0.5.0
 BuildRequires: intltool
 BuildRequires: xorg-x11-proto-devel
diff --git a/src/gpk-application.c b/src/gpk-application.c
index 13ad5bb..dfc6076 100644
--- a/src/gpk-application.c
+++ b/src/gpk-application.c
@@ -2294,18 +2294,6 @@ gpk_application_get_details_cb (PkClient *client, GAsyncResult *res, gpointer us
 		gpk_application_add_detail_item (_("License"), license, NULL);
 	}
 
-	/* menu path */
-	value = gpk_desktop_guess_best_file (desktop, split[PK_PACKAGE_ID_NAME]);
-	if (value != NULL) {
-		text = gpk_desktop_get_menu_path (value);
-		if (text != NULL) {
-			/* TRANSLATORS: the path in the menu, e.g. Applications -> Games */
-			gpk_application_add_detail_item (_("Menu"), text, NULL);
-		}
-		g_free (text);
-	}
-	g_free (value);
-
 	/* set the description */
 	text = gpk_application_text_format_display (description);
 	widget = GTK_WIDGET (gtk_builder_get_object (builder, "textview_description"));
diff --git a/src/gpk-desktop.c b/src/gpk-desktop.c
index b070d6d..1e44106 100644
--- a/src/gpk-desktop.c
+++ b/src/gpk-desktop.c
@@ -28,113 +28,10 @@
 #include <locale.h>
 #include <string.h>
 
-#define GMENU_I_KNOW_THIS_IS_UNSTABLE
-#include <gnome-menus/gmenu-tree.h>
-
 #include "egg-string.h"
 
 #include "gpk-desktop.h"
 
-/*
- * gpk_desktop_directory_get_menu_path:
- **/
-static gchar *
-gpk_desktop_directory_get_menu_path (GMenuTreeDirectory *directory, const gchar *path)
-{
-	gchar *menu_path;
-	GMenuTreeItem *item;
-	gchar *data;
-	const gchar *desktop_file_path;
-	GSList *list;
-
-	/* recurse */
-	list = gmenu_tree_directory_get_contents (directory);
-	while (list != NULL) {
-		item = list->data;
-		if (gmenu_tree_item_get_type (item) == GMENU_TREE_ITEM_DIRECTORY) {
-			menu_path = gpk_desktop_directory_get_menu_path (GMENU_TREE_DIRECTORY (item), path);
-			if (menu_path != NULL) {
-				data = g_strdup_printf("%s \342\236\231 %s", gmenu_tree_directory_get_name (GMENU_TREE_DIRECTORY (item)), menu_path);
-				g_free (menu_path);
-				return data;
-			}
-			list = list->next;
-			continue;
-		}
-
-		if (gmenu_tree_item_get_type (item) == GMENU_TREE_ITEM_ENTRY) {
-			desktop_file_path = gmenu_tree_entry_get_desktop_file_path (GMENU_TREE_ENTRY (item));
-			if (strcmp (path, desktop_file_path) == 0)
-				return g_strdup (gmenu_tree_entry_get_name (GMENU_TREE_ENTRY (item)));
-		}
-		list = list->next;
-	}
-	return NULL;
-}
-
-/**
- * gpk_desktop_get_menu_path_submenu
- **/
-static gchar *
-gpk_desktop_get_menu_path_submenu (const gchar *filename, const gchar *menu_file, const gchar *label)
-{
-	gchar *text;
-	gchar *path = NULL;
-	GMenuTree *tree;
-	GMenuTreeDirectory *directory;
-
-	tree = gmenu_tree_lookup (menu_file, GMENU_TREE_FLAGS_INCLUDE_EXCLUDED);
-	if (tree == NULL) {
-		g_warning ("no tree for %s", menu_file);
-		goto out;
-	}
-	directory = gmenu_tree_get_root_directory (tree);
-	if (directory == NULL) {
-		g_warning ("no directory for %s", menu_file);
-		goto out;
-	}
-	text = gpk_desktop_directory_get_menu_path (directory, filename);
-	if (text == NULL) {
-		g_debug ("no path for %s", filename);
-		goto out;
-	}
-	path = g_strdup_printf ("%s \342\236\231 %s", label, text);
-	g_free (text);
-out:
-	return path;
-}
-
-/**
- * gpk_desktop_get_menu_path
- **/
-gchar *
-gpk_desktop_get_menu_path (const gchar *filename)
-{
-	gchar *path = NULL;
-	gchar *text;
-
-	/* TRANSLATORS: the menu item, Applications, Places, System etc */
-	path = gpk_desktop_get_menu_path_submenu (filename, "applications.menu", _("Applications"));
-	if (path != NULL)
-		goto out;
-
-	/* TRANSLATORS: the path in the menu, e.g. Applications -> Games */
-	text = g_strdup_printf ("%s \342\236\231 %s",  C_("Main menu", "System"), _("Preferences"));
-	path = gpk_desktop_get_menu_path_submenu (filename, "preferences.menu", text);
-	g_free (text);
-	if (path != NULL)
-		goto out;
-
-	/* TRANSLATORS: the path in the menu, e.g. Applications -> Games */
-	text = g_strdup_printf ("%s \342\236\231 %s",  C_("Main menu", "System"), _("Administration"));
-	path = gpk_desktop_get_menu_path_submenu (filename, "system-settings.menu", text);
-	g_free (text);
-	if (path != NULL)
-		goto out;
-out:
-	return path;
-}
-
 /**
  * gpk_desktop_check_icon_valid:
  *
diff --git a/src/gpk-desktop.h b/src/gpk-desktop.h
index 3f3bd14..b9d5f6c 100644
--- a/src/gpk-desktop.h
+++ b/src/gpk-desktop.h
@@ -34,7 +34,6 @@ gchar		*gpk_desktop_guess_icon_name		(PkDesktop	*desktop,
 gchar		*gpk_desktop_guess_localised_name	(PkDesktop	*desktop,
 							 const gchar	*package);
 gint		 gpk_desktop_get_file_weight		(const gchar	*filename);
-gchar		*gpk_desktop_get_menu_path		(const gchar	*filename);
 gboolean	 gpk_desktop_check_icon_valid		(const gchar	*icon);
 
 G_END_DECLS
diff --git a/src/gpk-helper-run.c b/src/gpk-helper-run.c
index a52d53d..31e2d0e 100644
--- a/src/gpk-helper-run.c
+++ b/src/gpk-helper-run.c
@@ -228,7 +228,6 @@ gpk_helper_run_add_desktop_file (GpkHelperRun *helper, const gchar *package_id,
 	gchar *exec = NULL;
 	gchar *summary = NULL;
 	gchar *joint = NULL;
-	gchar *menu_path = NULL;
 	GtkTreeIter iter;
 	GKeyFile *file = NULL;
 	gint weight;
@@ -293,22 +292,10 @@ gpk_helper_run_add_desktop_file (GpkHelperRun *helper, const gchar *package_id,
 	if (summary == NULL)
 		summary = g_key_file_get_locale_string (file, G_KEY_FILE_DESKTOP_GROUP, "GenericName", NULL, NULL);
 
-	/* get application path */
-	text = gpk_desktop_get_menu_path (filename);
-	if (text != NULL)
-		menu_path = g_markup_escape_text (text, -1);
-	g_free (text);
-
 	/* put formatted text into treeview */
 	gtk_list_store_append (helper->priv->list_store, &iter);
 	joint = g_strdup_printf ("%s - %s", name, summary);
 	text = gpk_package_id_format_twoline (package_id, joint);
-	if (menu_path != NULL) {
-		/* TRANSLATORS: the path in the menu, e.g. Applications -> Games -> Dave */
-		fulltext = g_strdup_printf("%s\n\n<i>%s</i>", text, menu_path);
-		g_free (text);
-		text = fulltext;
-	}
 
 	gtk_list_store_set (helper->priv->list_store, &iter,
 			    GPK_CHOOSER_COLUMN_TEXT, fulltext,
@@ -321,7 +308,6 @@ out:
 	g_free (icon);
 	g_free (name);
 	g_free (text);
-	g_free (menu_path);
 	g_free (joint);
 	g_free (summary);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]