diff options
Diffstat (limited to 'src/messages-service.c')
-rw-r--r-- | src/messages-service.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/messages-service.c b/src/messages-service.c index e3352e8..4ccd0f1 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -40,6 +40,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include "dirs.h" #include "messages-service-dbus.h" #include "seen-db.h" +#include "status-items.h" static IndicatorService * service = NULL; static IndicateListener * listener = NULL; @@ -1432,13 +1433,21 @@ service_shutdown (IndicatorService * service, gpointer user_data) return; } +static void +status_update_callback (void) +{ + return; +} + /* Oh, if you don't know what main() is for we really shouldn't be talking. */ int main (int argc, char ** argv) { + /* Glib init */ g_type_init(); + /* Create the Indicator Service interface */ service = indicator_service_new_version(INDICATOR_MESSAGES_DBUS_NAME, 1); g_signal_connect(service, INDICATOR_SERVICE_SIGNAL_SHUTDOWN, G_CALLBACK(service_shutdown), NULL); @@ -1448,31 +1457,42 @@ main (int argc, char ** argv) bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); textdomain (GETTEXT_PACKAGE); + /* Create the Seen DB */ seen_db_init(); + /* Bring up the service DBus interface */ dbus_interface = message_service_dbus_new(); - listener = indicate_listener_ref_default(); - serverList = NULL; - + /* Build the base menu */ root_menuitem = dbusmenu_menuitem_new(); DbusmenuServer * server = dbusmenu_server_new(INDICATOR_MESSAGES_DBUS_OBJECT); dbusmenu_server_set_root(server, root_menuitem); + status_items_build(&status_update_callback); + + /* Start up the libindicate listener */ + listener = indicate_listener_ref_default(); + serverList = NULL; + g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_INDICATOR_ADDED, G_CALLBACK(indicator_added), root_menuitem); g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_INDICATOR_REMOVED, G_CALLBACK(indicator_removed), root_menuitem); g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_SERVER_ADDED, G_CALLBACK(server_added), root_menuitem); g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_SERVER_REMOVED, G_CALLBACK(server_removed), root_menuitem); + /* Find launchers by looking through the config directories + in the idle loop */ g_idle_add(blacklist_init, NULL); g_idle_add(build_launchers, SYSTEM_APPS_DIR); g_idle_add(build_launchers, SYSTEM_APPS_DIR_OLD); gchar * userdir = g_build_filename(g_get_user_config_dir(), USER_APPS_DIR, NULL); g_idle_add(build_launchers, userdir); + /* Let's run a mainloop */ mainloop = g_main_loop_new(NULL, FALSE); g_main_loop_run(mainloop); + /* Clean up */ + status_items_cleanup(); g_free(userdir); return 0; |