gmyth-dbus/src/main.c
author renatofilho
Tue Oct 30 14:08:04 2007 +0000 (2007-10-30)
branchtrunk
changeset 879 16c33370755e
parent 870 735d9b563b02
child 881 c5a9d9583e64
permissions -rw-r--r--
[svn r885] fixed bug on connect function
     1 #include "gmyth-dbus-server.h"
     2 
     3 
     4 static void
     5 _disconnected_cb (GMythDbusServer *srv,
     6                   GMainLoop *loop)
     7 {
     8     g_main_loop_quit (loop);
     9 }
    10 
    11 int main (int argc, char* argv[])
    12 {
    13     GMainLoop *loop;
    14     GMythDbusServer *srv;
    15 
    16     g_type_init ();
    17     g_thread_init (NULL);
    18 
    19 
    20     loop = g_main_loop_new (NULL, FALSE);
    21     srv = gmyth_dbus_server_start_dbus_service ();
    22 
    23     if (srv)
    24     {
    25         g_signal_connect (G_OBJECT (srv),
    26                           "disconnected",
    27                           G_CALLBACK (_disconnected_cb),
    28                           loop);
    29         g_main_loop_run (loop);
    30 
    31         g_object_unref (srv);
    32     }
    33 
    34     return 0;
    35 }