Ejemplo n.º 1
0
void
evo_cal_source_print_all_objects(ECal *ecal)
{
	GList* ical_objects = NULL;
	GList* l = NULL;
    GError *error = NULL;
    char *str = NULL;

	if (e_cal_get_object_list (ecal, "#t", &ical_objects, &error))
    {
    	for (l = ical_objects; l; l = l->next) {
    		str = icalcomponent_as_ical_string (l->data);
            g_print("%s\n", str);
		}
    
    	e_cal_free_object_list (ical_objects);
	}
}
Ejemplo n.º 2
0
static const gchar *
test_query (ECal *client,
            const gchar *query,
            gint expected)
{
	/* This uses pre-loaded data. Hence its results are valid only
	 * when called before any write operation is performed.
	 */
	gint i = 0;
	GList *objects = NULL;

	if (!e_cal_get_object_list (client, query, &objects, NULL))
		return "Could not get the list of objects";
	i = g_list_length (objects);
	e_cal_free_object_list (objects);

	mu_assert ("Test get_object_list : Expected number of objects not found", i == expected);

	return NULL;
}
Ejemplo n.º 3
0
static gboolean
list_uids (ECal *client)
{
	GList *objects = NULL;
	GList *l;

	if (!e_cal_get_object_list (client, "(contains? \"any\" \"test\")", &objects, NULL))
		return FALSE;

	cl_printf (client, "UIDS: ");

	cl_printf (client, "\nGot %d objects\n", g_list_length (objects));
	if (!objects)
		printf ("none\n");
	else {
		for (l = objects; l; l = l->next) {
			const gchar *uid;

			uid = icalcomponent_get_uid (l->data);
			printf ("`%s' ", uid);
		}

		printf ("\n");

		for (l = objects; l; l = l->next) {
			gchar *obj = icalcomponent_as_ical_string_r (l->data);
			printf ("------------------------------\n");
			printf ("%s", obj);
			printf ("------------------------------\n");
			free (obj);
		}
	}

	e_cal_free_object_list (objects);

	return FALSE;
}