summaryrefslogtreecommitdiff
path: root/libslab
diff options
context:
space:
mode:
authoryetist <[email protected]>2018-04-27 16:39:27 +0800
committerraveit65 <[email protected]>2018-05-27 17:27:04 +0200
commitede274e3a0e2ae84b5e288ae00ee2377ec0c21f1 (patch)
treeb4a035c60f0eed967eaea9159b326124629b1fc1 /libslab
parentea9ec0faf67d15444befcde0b0273ad0fea93001 (diff)
downloadmate-control-center-ede274e3a0e2ae84b5e288ae00ee2377ec0c21f1.tar.bz2
mate-control-center-ede274e3a0e2ae84b5e288ae00ee2377ec0c21f1.tar.xz
use matemenu_tree_new
Diffstat (limited to 'libslab')
-rw-r--r--libslab/app-shell.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/libslab/app-shell.c b/libslab/app-shell.c
index c1765975..5572fcc9 100644
--- a/libslab/app-shell.c
+++ b/libslab/app-shell.c
@@ -876,8 +876,17 @@ generate_categories (AppShellData * app_data)
if (!app_data->tree)
{
- app_data->tree = matemenu_tree_lookup (app_data->menu_name, MATEMENU_TREE_FLAGS_NONE);
- matemenu_tree_add_monitor (app_data->tree, matemenu_tree_changed_callback, app_data);
+ GError *error = NULL;
+
+ app_data->tree = matemenu_tree_new (app_data->menu_name, MATEMENU_TREE_FLAGS_NONE);
+ g_signal_connect (app_data->tree, "changed", G_CALLBACK (matemenu_tree_changed_callback), app_data);
+ if (! matemenu_tree_load_sync (app_data->tree, &error)) {
+ g_warning("Menu tree loading got error:%s\n", error->message);
+ g_error_free(error);
+ g_object_unref(app_data->tree);
+ app_data->tree = NULL;
+ }
+
}
root_dir = matemenu_tree_get_root_directory (app_data->tree);
if (root_dir)