Back to index

libindicator  12.10.0
Functions | Variables
service-shutdown-timeout.c File Reference
#include <glib.h>
#include "libindicator/indicator-service.h"

Go to the source code of this file.

Functions

gboolean timeout (gpointer data)
void shutdown (void)
int main (int argc, char **argv)

Variables

static GMainLoop * mainloop = NULL
static gboolean passed = FALSE

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 49 of file service-shutdown-timeout.c.

{
       g_type_init();

       IndicatorService * is = indicator_service_new("my.test.name");
       g_signal_connect(G_OBJECT(is), INDICATOR_SERVICE_SIGNAL_SHUTDOWN, shutdown, NULL);

       g_timeout_add_seconds(2, timeout, NULL);

       mainloop = g_main_loop_new(NULL, FALSE);
       g_main_loop_run(mainloop);

       g_debug("Quiting");
       if (passed) {
              g_debug("Passed");
              return 0;
       }
       g_debug("Failed");
       return 1;
}

Here is the call graph for this function:

void shutdown ( void  )

Definition at line 40 of file service-shutdown-timeout.c.

{
       g_debug("Shutdown");
       passed = TRUE;
       g_main_loop_quit(mainloop);
       return;
}
gboolean timeout ( gpointer  data)

Definition at line 31 of file service-shutdown-timeout.c.

{
       passed = FALSE;
       g_error("Timeout with no shutdown.");
       g_main_loop_quit(mainloop);
       return FALSE;
}

Variable Documentation

GMainLoop* mainloop = NULL [static]

Definition at line 27 of file service-shutdown-timeout.c.

gboolean passed = FALSE [static]

Definition at line 28 of file service-shutdown-timeout.c.