dataprovider-service: Thread support and minor fixes
[maevies] / src / maevies-service.c
1 /*
2  * maevies-service.c
3  *
4  * This file is part of maevies
5  * Copyright (C) 2010 Simón Pena <spenap@gmail.com>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 3 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * General Public License for more details.
16  *
17  */
18
19 #include <dbus/dbus-glib.h>
20
21 #include "mvs-minfo-provider-service.h"
22
23 int
24 main (int argc, char **argv)
25 {
26         MvsMInfoProviderService *service;
27         DBusGConnection *connection;
28         GError *error = NULL;
29         GMainLoop *loop;
30
31         if (!g_thread_supported ())
32                 g_thread_init (NULL);
33         g_type_init ();
34
35         connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
36         if (connection == NULL) {
37                 g_warning ("Unable to connect to dbus: %sn", error->message);
38                 g_error_free (error);
39                 return -1;
40         }
41
42         loop = g_main_loop_new (NULL, FALSE);
43         service = mvs_minfo_provider_service_new (connection);
44
45         g_main_loop_run (loop);
46
47         g_object_unref (service);
48
49         return 0;
50 }
51