[gnome-control-center] Revert "shell: Only load desktop files from our dirs"
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] Revert "shell: Only load desktop files from our dirs"
- Date: Fri, 2 Sep 2011 13:31:08 +0000 (UTC)
commit 22759b211610aeb627a055daac3d019c2fe2d5a2
Author: Bastien Nocera <hadess hadess net>
Date: Fri Sep 2 14:28:14 2011 +0100
Revert "shell: Only load desktop files from our dirs"
This reverts commit dde732b9a9f565969c2a3a1d51f17f072d19f0a1.
https://bugzilla.gnome.org/show_bug.cgi?id=657867
shell/Makefile.am | 1 -
shell/gnome-control-center.c | 35 +++--------------------------------
2 files changed, 3 insertions(+), 33 deletions(-)
---
diff --git a/shell/Makefile.am b/shell/Makefile.am
index 3a9600a..d6a4f71 100644
--- a/shell/Makefile.am
+++ b/shell/Makefile.am
@@ -40,7 +40,6 @@ AM_CPPFLAGS = \
-DGNOMELOCALEDIR="\"$(datadir)/locale\"" \
-DUIDIR="\"$(uidir)\"" \
-DMENUDIR="\"$(menudir)\"" \
- -DDESKTOP_FILES_DIR="\"$(datadir)/applications/\"" \
-DPANELS_DIR="\"$(PANELS_DIR)\""
menudir = $(sysconfdir)/xdg/menus
diff --git a/shell/gnome-control-center.c b/shell/gnome-control-center.c
index 721dae2..d589b07 100644
--- a/shell/gnome-control-center.c
+++ b/shell/gnome-control-center.c
@@ -63,7 +63,6 @@ struct _GnomeControlCenterPrivate
GtkWidget *lock_button;
GMenuTree *menu_tree;
- char *desktop_files_dir;
GtkListStore *store;
GHashTable *category_views;
@@ -658,19 +657,6 @@ maybe_add_category_view (GnomeControlCenter *shell,
g_hash_table_insert (shell->priv->category_views, g_strdup (name), categoryview);
}
-static gboolean
-item_is_in_dir (GnomeControlCenter *shell,
- GMenuTreeEntry *item)
-{
- const char *path;
-
- path = gmenu_tree_entry_get_desktop_file_path (item);
-
- if (g_str_has_prefix (path, shell->priv->desktop_files_dir))
- return TRUE;
- return FALSE;
-}
-
static void
reload_menu (GnomeControlCenter *shell)
{
@@ -712,12 +698,9 @@ reload_menu (GnomeControlCenter *shell)
if (sub_next_type == GMENU_TREE_ITEM_ENTRY)
{
GMenuTreeEntry *item = gmenu_tree_iter_get_entry (sub_iter);
- if (item_is_in_dir (shell, item))
- {
- cc_shell_model_add_item (CC_SHELL_MODEL (shell->priv->store),
- dir_name,
- item);
- }
+ cc_shell_model_add_item (CC_SHELL_MODEL (shell->priv->store),
+ dir_name,
+ item);
gmenu_tree_item_unref (item);
}
}
@@ -742,7 +725,6 @@ static void
setup_model (GnomeControlCenter *shell)
{
GnomeControlCenterPrivate *priv = shell->priv;
- GFile *file;
gtk_container_set_border_width (GTK_CONTAINER (shell->priv->main_vbox), 10);
gtk_container_set_focus_vadjustment (GTK_CONTAINER (shell->priv->main_vbox),
@@ -752,11 +734,6 @@ setup_model (GnomeControlCenter *shell)
priv->category_views = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
priv->menu_tree = gmenu_tree_new_for_path (MENUDIR "/gnomecc.menu", 0);
- /* Normalise the file path, to avoid repeat slashes */
- file = g_file_new_for_path (DESKTOP_FILES_DIR);
- priv->desktop_files_dir = g_file_get_path (file);
- g_object_unref (file);
-
reload_menu (shell);
g_signal_connect (priv->menu_tree, "changed", G_CALLBACK (on_menu_changed), shell);
@@ -987,12 +964,6 @@ gnome_control_center_finalize (GObject *object)
g_object_unref (priv->menu_tree);
}
- if (priv->desktop_files_dir)
- {
- g_free (priv->desktop_files_dir);
- priv->desktop_files_dir = NULL;
- }
-
if (priv->category_views)
{
g_hash_table_destroy (priv->category_views);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]