aboutsummaryrefslogtreecommitdiff
path: root/src/messages-service.c
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2012-06-25 23:20:46 +0200
committerLars Uebernickel <lars.uebernickel@canonical.com>2012-06-25 23:20:46 +0200
commitf4c01bf86c886d8b534e14f05f813222d825f37c (patch)
tree40497b29be5f001329bbae48a4be392ce4d9b1ed /src/messages-service.c
parentcf241b32dd111b6b57ddd95bb06f3ad558c00a88 (diff)
downloadayatana-indicator-messages-f4c01bf86c886d8b534e14f05f813222d825f37c.tar.gz
ayatana-indicator-messages-f4c01bf86c886d8b534e14f05f813222d825f37c.tar.bz2
ayatana-indicator-messages-f4c01bf86c886d8b534e14f05f813222d825f37c.zip
messages-service.c: get rid of some global variables
Diffstat (limited to 'src/messages-service.c')
-rw-r--r--src/messages-service.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/messages-service.c b/src/messages-service.c
index 7be2274..f7f76c2 100644
--- a/src/messages-service.c
+++ b/src/messages-service.c
@@ -32,16 +32,12 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include "messages-service-dbus.h"
#include "gactionmuxer.h"
-static IndicatorService * service = NULL;
static GHashTable *applications;
static GSimpleActionGroup *actions;
static GActionMuxer *action_muxer;
static GMenu *menu;
static GSettings *settings;
-static GMainLoop * mainloop = NULL;
-
-static MessageServiceDbus * dbus_interface = NULL;
static gchar *
@@ -201,9 +197,10 @@ build_launchers (gpointer data)
static void
service_shutdown (IndicatorService * service, gpointer user_data)
{
+ GMainLoop *mainloop = user_data;
+
g_warning("Shutting down service!");
g_main_loop_quit(mainloop);
- return;
}
static void
@@ -381,6 +378,9 @@ got_bus (GObject *object,
int
main (int argc, char ** argv)
{
+ GMainLoop * mainloop = NULL;
+ IndicatorService * service = NULL;
+ MessageServiceDbus * dbus_interface = NULL;
GActionEntry entries[] = {
{ "status", radio_item_activate, "s", "'offline'", change_status },
{ "clear", clear_action_activate }
@@ -390,9 +390,11 @@ main (int argc, char ** argv)
/* Glib init */
g_type_init();
+ mainloop = g_main_loop_new (NULL, FALSE);
+
/* 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);
+ g_signal_connect(service, INDICATOR_SERVICE_SIGNAL_SHUTDOWN, G_CALLBACK(service_shutdown), mainloop);
/* Setting up i18n and gettext. Apparently, we need
all of these. */
@@ -431,8 +433,6 @@ main (int argc, char ** argv)
g_idle_add(build_launchers, NULL);
- /* Let's run a mainloop */
- mainloop = g_main_loop_new(NULL, FALSE);
g_main_loop_run(mainloop);
/* Clean up */