]> git.0d.be Git - empathy.git/blobdiff - tests/contact-manager.c
No need to init gtk, GMainLoop is enough and makes easier to run valgrind.
[empathy.git] / tests / contact-manager.c
index c9450105a27d24d3c6615a1aa470e5c21c03ecfe..2d10642e1a6ceb18631fa421b1e3249842c05973 100644 (file)
@@ -1,12 +1,12 @@
 #include <stdlib.h>
 
-#include <gtk/gtk.h>
+#include <glib.h>
 #include <libempathy/empathy-contact-manager.h>
 
 static gboolean
-time_out (gpointer data)
+time_out (gpointer main_loop)
 {
-       gtk_main_quit ();
+       g_main_loop_quit (main_loop);
 
        return FALSE;
 }
@@ -15,16 +15,20 @@ int
 main (int argc, char **argv)
 {
        EmpathyContactManager *manager;
+       GMainLoop             *main_loop;
 
-       gtk_init (&argc, &argv);
+       g_type_init ();
 
+       main_loop = g_main_loop_new (NULL, FALSE);
        manager = empathy_contact_manager_new ();
        
-       g_timeout_add (5000, time_out, NULL);
+       g_timeout_add (5000, time_out, main_loop);
 
-       gtk_main ();
+       g_main_loop_run (main_loop);
        
        g_object_unref (manager);
+       g_main_loop_unref (main_loop);
 
        return EXIT_SUCCESS;
 }
+