summaryrefslogtreecommitdiff
path: root/control-center
diff options
context:
space:
mode:
authorSebastien Bacher <seb128@debian.org>2005-03-26 23:34:36 +0000
committerSebastien Bacher <sbacher@src.gnome.org>2005-03-26 23:34:36 +0000
commite1d9efe6443e96382b4c4b0bee8ae6ae813d390e (patch)
tree58cadc5491ce8a47d619e211e13a65506ed155ae /control-center
parent208728d0c49b31a0076d760de766c9c876d77d64 (diff)
downloadgnome-control-center-e1d9efe6443e96382b4c4b0bee8ae6ae813d390e.tar.gz
update to the new libgnome-menu API, patch from Mark McLoughlin
2005-03-27 Sebastien Bacher <seb128@debian.org> * control-center-categories.c: (populate_category), (read_categories_from_menu_directory), (control_center_get_information): update to the new libgnome-menu API, patch from Mark McLoughlin <markmc@redhat.com>.
Diffstat (limited to 'control-center')
-rw-r--r--control-center/ChangeLog7
-rw-r--r--control-center/control-center-categories.c44
2 files changed, 33 insertions, 18 deletions
diff --git a/control-center/ChangeLog b/control-center/ChangeLog
index 6d1b23be1..0aa7d2a3c 100644
--- a/control-center/ChangeLog
+++ b/control-center/ChangeLog
@@ -1,3 +1,10 @@
+2005-03-27 Sebastien Bacher <seb128@debian.org>
+
+ * control-center-categories.c: (populate_category),
+ (read_categories_from_menu_directory),
+ (control_center_get_information): update to the new libgnome-menu API,
+ patch from Mark McLoughlin <markmc@redhat.com>.
+
2005-02-18 Kjartan Maraas <kmaraas@gnome.org>
* control-center.c: (create_control_center): Fix a
diff --git a/control-center/control-center-categories.c b/control-center/control-center-categories.c
index 0aebd2334..c295a167b 100644
--- a/control-center/control-center-categories.c
+++ b/control-center/control-center-categories.c
@@ -127,23 +127,25 @@ static void
populate_category (ControlCenterCategory *category,
MenuTreeDirectory *menu_directory)
{
- GSList *menu_entries;
+ GSList *items;
GSList *entries;
GSList *l;
entries = NULL;
- menu_entries = menu_tree_directory_get_entries (menu_directory);
- for (l = menu_entries; l; l = l->next) {
- MenuTreeEntry *menu_entry = l->data;
+ items = menu_tree_directory_get_contents (menu_directory);
+ for (l = items; l; l = l->next) {
+ MenuTreeItem *item = l->data;
- entries = g_slist_prepend (entries,
- control_center_entry_new (category, menu_entry));
+ if (menu_tree_item_get_type (item) == MENU_TREE_ITEM_ENTRY)
+ entries = g_slist_prepend (entries,
+ control_center_entry_new (category,
+ MENU_TREE_ENTRY (item)));
- menu_tree_entry_unref (menu_entry);
+ menu_tree_item_unref (item);
}
- g_slist_free (menu_entries);
+ g_slist_free (items);
if (entries != NULL) {
GSList *l;
@@ -196,22 +198,28 @@ static GSList *
read_categories_from_menu_directory (MenuTreeDirectory *directory,
GSList *categories)
{
- GSList *subdirs;
+ GSList *items;
GSList *l;
- subdirs = menu_tree_directory_get_subdirs (directory);
- for (l = subdirs; l; l = l->next) {
- MenuTreeDirectory *subdir = l->data;
+ items = menu_tree_directory_get_contents (directory);
+ for (l = items; l; l = l->next) {
+ MenuTreeItem *item = l->data;
- categories = g_slist_prepend (categories,
- control_center_category_new (subdir, NULL, TRUE));
+ if (menu_tree_item_get_type (item) == MENU_TREE_ITEM_DIRECTORY) {
+ MenuTreeDirectory *subdir;
- categories = read_categories_from_menu_directory (subdir, categories);
+ subdir = MENU_TREE_DIRECTORY (item);
- menu_tree_directory_unref (subdir);
+ categories = g_slist_prepend (categories,
+ control_center_category_new (subdir, NULL, TRUE));
+
+ categories = read_categories_from_menu_directory (subdir, categories);
+ }
+
+ menu_tree_item_unref (item);
}
- g_slist_free (subdirs);
+ g_slist_free (items);
return categories;
}
@@ -257,7 +265,7 @@ control_center_get_information (void)
}
}
- menu_tree_directory_unref (menu_root);
+ menu_tree_item_unref (menu_root);
if (categories != NULL) {
GSList *l;