static void cinnamon_app_system_init (CinnamonAppSystem *self) { CinnamonAppSystemPrivate *priv; self->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (self, CINNAMON_TYPE_APP_SYSTEM, CinnamonAppSystemPrivate); priv->running_apps = g_hash_table_new_full (NULL, NULL, (GDestroyNotify) g_object_unref, NULL); priv->id_to_app = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify)g_object_unref); /* According to desktop spec, since our menu file is called 'cinnamon-applications', our * merged menu folders need to be called 'cinnamon-applications-merged'. We'll setup the folder * 'applications-merged' if it doesn't exist yet, and a symlink pointing to it in the * ~/.config/menus directory */ setup_merge_dir_symlink(); /* For now, we want to pick up Evince, Nemo, etc. We'll * handle NODISPLAY semantics at a higher level or investigate them * case by case. */ priv->apps_tree = gmenu_tree_new ("cinnamon-applications.menu", GMENU_TREE_FLAGS_INCLUDE_NODISPLAY); g_signal_connect (priv->apps_tree, "changed", G_CALLBACK (on_apps_tree_changed_cb), self); on_apps_tree_changed_cb (priv->apps_tree, self); }
static void shell_app_system_init (ShellAppSystem *self) { ShellAppSystemPrivate *priv; self->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (self, SHELL_TYPE_APP_SYSTEM, ShellAppSystemPrivate); priv->running_apps = g_hash_table_new_full (NULL, NULL, (GDestroyNotify) g_object_unref, NULL); priv->id_to_app = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify)g_object_unref); /* All the objects in this hash table are owned by id_to_app */ priv->visible_id_to_app = g_hash_table_new (g_str_hash, g_str_equal); priv->setting_id_to_app = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify)g_object_unref); /* We want to track NoDisplay apps, so we add INCLUDE_NODISPLAY. We'll * filter NoDisplay apps out when showing them to the user. */ priv->apps_tree = gmenu_tree_new ("applications.menu", GMENU_TREE_FLAGS_INCLUDE_NODISPLAY); g_signal_connect (priv->apps_tree, "changed", G_CALLBACK (on_apps_tree_changed_cb), self); priv->settings_tree = gmenu_tree_new ("gnomecc.menu", 0); g_signal_connect (priv->settings_tree, "changed", G_CALLBACK (on_settings_tree_changed_cb), self); on_apps_tree_changed_cb (priv->apps_tree, self); on_settings_tree_changed_cb (priv->settings_tree, self); }
static void cinnamon_app_system_init (CinnamonAppSystem *self) { CinnamonAppSystemPrivate *priv; self->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (self, CINNAMON_TYPE_APP_SYSTEM, CinnamonAppSystemPrivate); priv->running_apps = g_hash_table_new_full (NULL, NULL, (GDestroyNotify) g_object_unref, NULL); priv->id_to_app = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify)g_object_unref); priv->setting_id_to_app = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify)g_object_unref); /* For now, we want to pick up Evince, Nautilus, etc. We'll * handle NODISPLAY semantics at a higher level or investigate them * case by case. */ priv->apps_tree = gmenu_tree_new ("cinnamon-applications.menu", GMENU_TREE_FLAGS_INCLUDE_NODISPLAY); g_signal_connect (priv->apps_tree, "changed", G_CALLBACK (on_apps_tree_changed_cb), self); priv->settings_tree = gmenu_tree_new ("cinnamon-settings.menu", 0); g_signal_connect (priv->settings_tree, "changed", G_CALLBACK (on_settings_tree_changed_cb), self); on_apps_tree_changed_cb (priv->apps_tree, self); on_settings_tree_changed_cb (priv->settings_tree, self); }