# HG changeset patch # User leo_sobral # Date 1161716707 -3600 # Node ID 6deb6330eaca0bd4f18c0f1ca03a767c29de47fb # Parent a30f59f76bdab275f3a990ac037d2ac22b6d53ee [svn r50] added debug printing funcs to gmyth diff -r a30f59f76bda -r 6deb6330eaca gmyth/src/gmyth_common.c --- a/gmyth/src/gmyth_common.c Tue Oct 24 15:34:48 2006 +0100 +++ b/gmyth/src/gmyth_common.c Tue Oct 24 20:05:07 2006 +0100 @@ -68,6 +68,24 @@ g_list_free (list); } +void +gmyth_channel_info_print(GMythChannelInfo *channel_info) +{ + g_print("ChannelInfo (Name, ID) = (%s, %d)\n", + channel_info->channel_name->str, channel_info->channel_ID); +} + +void +gmyth_program_info_print(GMythProgramInfo *program_info) +{ + g_print("ProgramInfo\n\tTitle = %s\n\t" + "Description = %s\n\t" + "Start time= %s\t" + "End time = %s\n", program_info->title->str, + program_info->description->str, + ctime(&program_info->startts), + ctime(&program_info->endts)); +} static void free_channel_data(gpointer data, gpointer user_data) diff -r a30f59f76bda -r 6deb6330eaca gmyth/src/gmyth_common.h --- a/gmyth/src/gmyth_common.h Tue Oct 24 15:34:48 2006 +0100 +++ b/gmyth/src/gmyth_common.h Tue Oct 24 20:05:07 2006 +0100 @@ -154,6 +154,9 @@ void gmyth_free_channel_list(GList *list); void gmyth_free_program_list(GList *list); +void gmyth_channel_info_print(GMythChannelInfo *channel_info); +void gmyth_program_info_print(GMythProgramInfo *program_info); + G_END_DECLS #endif /* GMYTH_COMMON_H_ */ diff -r a30f59f76bda -r 6deb6330eaca gmyth/src/gmyth_epg.c --- a/gmyth/src/gmyth_epg.c Tue Oct 24 15:34:48 2006 +0100 +++ b/gmyth/src/gmyth_epg.c Tue Oct 24 20:05:07 2006 +0100 @@ -160,7 +160,11 @@ channel_info = g_new0(GMythChannelInfo, 1); channel_info->channel_ID = atoi (row[0]); channel_info->channel_name = g_string_new (row[1]); - + +#if 0 + gmyth_channel_info_print(channel_info); +#endif + (*glist_ptr) = g_list_append ((*glist_ptr), channel_info); } } @@ -269,6 +273,10 @@ p->catType = g_string_new (row[18]); *proglist = g_list_append((*proglist), p); + +#if 0 + gmyth_program_info_print(p); +#endif } /* deallocate */ diff -r a30f59f76bda -r 6deb6330eaca gmyth/src/gmyth_query.c --- a/gmyth/src/gmyth_query.c Tue Oct 24 15:34:48 2006 +0100 +++ b/gmyth/src/gmyth_query.c Tue Oct 24 20:05:07 2006 +0100 @@ -211,10 +211,10 @@ if (res_set) { return res_set; } else if (mysql_field_count (gmyth_query->conn) == 0) { - g_debug ("%lu rows affected\n", - (unsigned long) mysql_affected_rows (gmyth_query->conn)); + g_debug ("%lu rows affected\n", + (unsigned long) mysql_affected_rows (gmyth_query->conn)); } else { - gmyth_query_print_error (gmyth_query->conn, "Could not retrieve result set"); + gmyth_query_print_error (gmyth_query->conn, "Could not retrieve result set"); } return NULL; diff -r a30f59f76bda -r 6deb6330eaca gmyth/src/gmyth_scheduler.c --- a/gmyth/src/gmyth_scheduler.c Tue Oct 24 15:34:48 2006 +0100 +++ b/gmyth/src/gmyth_scheduler.c Tue Oct 24 20:05:07 2006 +0100 @@ -34,14 +34,14 @@ #include "gmyth_util.h" #include "gmyth_query.h" -static void gmyth_scheduler_class_init (GMythSchedulerClass *klass); -static void gmyth_scheduler_init (GMythScheduler *object); +static void gmyth_scheduler_class_init (GMythSchedulerClass *klass); +static void gmyth_scheduler_init (GMythScheduler *object); static void gmyth_scheduler_dispose (GObject *object); static void gmyth_scheduler_finalize (GObject *object); static gint get_record_id_from_database (GMythScheduler *scheduler); -static void update_backend (gint record_id); +static void update_backend (gint record_id); G_DEFINE_TYPE(GMythScheduler, gmyth_scheduler, G_TYPE_OBJECT) diff -r a30f59f76bda -r 6deb6330eaca gmyth/src/gmyth_util.c --- a/gmyth/src/gmyth_util.c Tue Oct 24 15:34:48 2006 +0100 +++ b/gmyth/src/gmyth_util.c Tue Oct 24 20:05:07 2006 +0100 @@ -86,8 +86,10 @@ gmyth_util_string_to_time (GString* time_str) { int year, month, day, hour, min, sec; - + +#if 0 g_debug( "[%s] time_str = %s.\n", __FUNCTION__, time_str != NULL ? time_str->str : "[time string is NULL!]" ); +#endif if (sscanf (time_str->str, "%04d-%02d-%02d %02d:%02d:%02d", &year, &month, &day, &hour, &min, &sec) < 3) { /* At least date */