diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2013-10-09 21:02:17 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2013-10-09 21:02:17 -0500 |
commit | 70487ccce4dbcf04f9dfb02ba50f7e88e428f14a (patch) | |
tree | 42a9e1143fbabeed0feec68d00d3fe002098c38f /src/main.c | |
parent | 1282befc5d9629ba0daacc2099811ccf19e4ed1b (diff) | |
download | ayatana-indicator-datetime-70487ccce4dbcf04f9dfb02ba50f7e88e428f14a.tar.gz ayatana-indicator-datetime-70487ccce4dbcf04f9dfb02ba50f7e88e428f14a.tar.bz2 ayatana-indicator-datetime-70487ccce4dbcf04f9dfb02ba50f7e88e428f14a.zip |
move planner instantiation to main.c so that we can prepare to pass in a mock planner for testing
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -25,6 +25,7 @@ #include <glib/gi18n.h> #include <gio/gio.h> +#include "planner-eds.h" #include "service.h" /*** @@ -41,23 +42,28 @@ on_name_lost (gpointer instance G_GNUC_UNUSED, gpointer loop) int main (int argc G_GNUC_UNUSED, char ** argv G_GNUC_UNUSED) { - GMainLoop * loop; + IndicatorDatetimePlanner * planner; IndicatorDatetimeService * service; + GMainLoop * loop; /* boilerplate i18n */ setlocale (LC_ALL, ""); bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); textdomain (GETTEXT_PACKAGE); + /* get the planner */ + planner = indicator_datetime_planner_eds_new (); + /* run */ - service = indicator_datetime_service_new (); + service = indicator_datetime_service_new (planner); loop = g_main_loop_new (NULL, FALSE); g_signal_connect (service, INDICATOR_DATETIME_SERVICE_SIGNAL_NAME_LOST, G_CALLBACK(on_name_lost), loop); g_main_loop_run (loop); /* cleanup */ - g_clear_object (&service); g_main_loop_unref (loop); + g_object_unref (service); + g_object_unref (planner); return 0; } |