2 * mvs-info-provider-test.c
4 * This file is part of maevies
5 * Copyright (C) 2010 Simón Pena <spenap@gmail.com>
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 3 of the
10 * License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
22 #include "mvs-minfo-provider.h"
23 #include "mvs-tmdb-movie.h"
25 static GMainLoop *loop = NULL;
28 response_received_callback (MvsMInfoProvider *minfo_provider, GList *list,
33 for (tmp = list; tmp; tmp = tmp->next) {
35 g_return_if_fail (MVS_IS_TMDB_MOVIE (tmp->data));
37 MvsTmdbMovie *movie_info = MVS_TMDB_MOVIE (tmp->data);
39 mvs_tmdb_movie_print (movie_info);
41 g_object_unref (movie_info);
45 g_main_loop_quit (loop);
49 main (int argc, char **argv)
51 MvsMInfoProvider *minfo_provider = NULL;
52 MvsTmdbMovie *movie_info = NULL;
58 minfo_provider = mvs_minfo_provider_new ();
59 g_signal_connect (minfo_provider, "response-received",
60 G_CALLBACK (response_received_callback), NULL);
62 movie_info = mvs_tmdb_movie_new ();
63 loop = g_main_loop_new (NULL, FALSE);
65 mvs_minfo_provider_query (minfo_provider, "Zombieland");
67 g_main_loop_run (loop);
69 g_object_unref (minfo_provider);
70 g_object_unref (movie_info);
71 g_main_loop_unref (loop);