aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/cal-client
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@helixcode.com>2000-04-25 09:39:05 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2000-04-25 09:39:05 +0800
commit1b7d0bc8c2fba515fc9880c4bc56d0771e611617 (patch)
tree22e9b9193c1c4cc7073a371f455cc4f9e103a220 /calendar/cal-client
parentde46951fcff85cff53fec4bae4d04772f20ef854 (diff)
downloadgsoc2013-evolution-1b7d0bc8c2fba515fc9880c4bc56d0771e611617.tar
gsoc2013-evolution-1b7d0bc8c2fba515fc9880c4bc56d0771e611617.tar.gz
gsoc2013-evolution-1b7d0bc8c2fba515fc9880c4bc56d0771e611617.tar.bz2
gsoc2013-evolution-1b7d0bc8c2fba515fc9880c4bc56d0771e611617.tar.lz
gsoc2013-evolution-1b7d0bc8c2fba515fc9880c4bc56d0771e611617.tar.xz
gsoc2013-evolution-1b7d0bc8c2fba515fc9880c4bc56d0771e611617.tar.zst
gsoc2013-evolution-1b7d0bc8c2fba515fc9880c4bc56d0771e611617.zip
The path to the test calendar changed when we moved stuff around. Users
2000-04-24 Federico Mena Quintero <federico@helixcode.com> * cal-client/client-test.c (main): The path to the test calendar changed when we moved stuff around. Users will have to tweak this for their CVS setup, anyways. (create_client): Create or load the calendar as appropriate. (client_destroy_cb): Exit the main loop if both clients are gone. (main): Connect to the "destroy" signal of the clients so that we can terminate the test program. svn path=/trunk/; revision=2597
Diffstat (limited to 'calendar/cal-client')
-rw-r--r--calendar/cal-client/client-test.c33
1 files changed, 28 insertions, 5 deletions
diff --git a/calendar/cal-client/client-test.c b/calendar/cal-client/client-test.c
index 28acee4802..fa8316707d 100644
--- a/calendar/cal-client/client-test.c
+++ b/calendar/cal-client/client-test.c
@@ -65,7 +65,7 @@ list_uids (gpointer data)
cal_obj_uid_list_free (uids);
-/* gtk_object_unref (GTK_OBJECT (client)); */
+ gtk_object_unref (GTK_OBJECT (client));
return FALSE;
}
@@ -118,10 +118,11 @@ create_client (const char *uri, gboolean load)
if (load)
result = cal_client_load_calendar (client, uri);
else
- result = cal_client_load_calendar (client, uri);
+ result = cal_client_create_calendar (client, uri);
if (!result) {
- g_message ("create_client(): failure when issuing calendar load/create request `%s'",
+ g_message ("create_client(): failure when issuing calendar %s request `%s'",
+ load ? "load" : "create",
uri);
exit (1);
}
@@ -129,6 +130,21 @@ create_client (const char *uri, gboolean load)
return client;
}
+/* Callback used when a client is destroyed */
+static void
+client_destroy_cb (GtkObject *object, gpointer data)
+{
+ if (CAL_CLIENT (object) == client1)
+ client1 = NULL;
+ else if (CAL_CLIENT (object) == client2)
+ client2 = NULL;
+ else
+ g_assert_not_reached ();
+
+ if (!client1 && !client2)
+ gtk_main_quit ();
+}
+
int
main (int argc, char **argv)
{
@@ -151,8 +167,15 @@ main (int argc, char **argv)
exit (1);
}
- client1 = create_client ("/cvs/evolution/calendar/test2.vcf", TRUE);
- client2 = create_client ("/cvs/evolution/calendar/test2.vcf", FALSE);
+ client1 = create_client ("/cvs/evolution/calendar/gui/test2.vcf", TRUE);
+ gtk_signal_connect (GTK_OBJECT (client1), "destroy",
+ client_destroy_cb,
+ NULL);
+
+ client2 = create_client ("/cvs/evolution/calendar/gui/test2.vcf", FALSE);
+ gtk_signal_connect (GTK_OBJECT (client2), "destroy",
+ client_destroy_cb,
+ NULL);
bonobo_main ();