]> git.0d.be Git - empathy.git/commitdiff
No need to init gtk, GMainLoop is enough and makes easier to run valgrind.
authorXavier Claessens <xclaesse@gmail.com>
Thu, 27 Sep 2007 08:13:51 +0000 (08:13 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Thu, 27 Sep 2007 08:13:51 +0000 (08:13 +0000)
2007-09-27  Xavier Claessens  <xclaesse@gmail.com>

* tests/contact-manager.c:
* tests/Makefile.am: No need to init gtk, GMainLoop is enough and makes
easier to run valgrind.

svn path=/trunk/; revision=324

ChangeLog
tests/Makefile.am
tests/contact-manager.c

index a6365bc2f85ea17f65a90323874c1eb519c8754c..c5df062a09e9247db1cbfcb00157a7cd87d51958 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-09-27  Xavier Claessens  <xclaesse@gmail.com>
+
+       * tests/contact-manager.c:
+       * tests/Makefile.am: No need to init gtk, GMainLoop is enough and makes
+       easier to run valgrind.
+
 2007-09-27  Xavier Claessens  <xclaesse@gmail.com>
 
        * libempathy/empathy-avatar.c: Fix leak when loading avatar from cache.
index 16358591d760b3f33e0740171d1f3d81871cc722..8c6094c959a1dead97463c573217dadc84bbe836 100644 (file)
@@ -8,7 +8,7 @@ LDADD =                                                         \
        $(top_builddir)/libempathy/libempathy.la                \
        $(EMPATHY_LIBS)
 
-noinst_PROGRAMS =                      \
+bin_PROGRAMS =                 \
        contact-manager
 
 contact_manager_SOURCES = 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;
 }
+