Skip to content

Commit

Permalink
[FreetuxTV] Glib log integration in GMMKeys.
Browse files Browse the repository at this point in the history
  • Loading branch information
eric.beuque committed Jul 17, 2010
1 parent edf636b commit 5b60655
Show file tree
Hide file tree
Showing 8 changed files with 468 additions and 414 deletions.
4 changes: 4 additions & 0 deletions src/freetuxtv-app.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ freetuxtv_action_deinterlace (FreetuxTVApp *app, const gchar* mode,
void
freetuxtv_quit (FreetuxTVApp *app);

void
freetuxtv_log (const gchar *log_domain, GLogLevelFlags log_level,
const gchar *message, gpointer user_data);

G_END_DECLS

#endif /* FREETUXTV_APP_H */
15 changes: 10 additions & 5 deletions src/freetuxtv-channels-list.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,16 @@ channels_list_refresh_channels_group (FreetuxTVApp *app, GtkTreePath *path_group
text = g_strdup_printf(_("Update \"%s\" channels list"), pChannelsGroupInfos->name);
windowmain_statusbar_push (app, "UpdateMsg", text);
g_free(text);
g_print("FreetuxTV : Start updating \"%s\" channels list\n", pChannelsGroupInfos->name);
g_log(FREETUXTV_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE,
"Start updating \"%s\" channels list\n", pChannelsGroupInfos->name);

if(pChannelsGroupInfos->type == FREETUXTV_CHANNELSGROUP_TYPEGROUP_PLAYLIST){
// Get the file of the playlist
text = g_strdup_printf (_("Getting the file : \"%s\""), pChannelsGroupInfos->uri);
windowmain_statusbar_push (app, "UpdateMsg", text);
g_free(text);
g_print("FreetuxTV : Getting the file \"%s\"\n", pChannelsGroupInfos->uri);
g_log(FREETUXTV_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE,
"Getting the file \"%s\"\n", pChannelsGroupInfos->uri);

gchar *filename = NULL;
channels_group_get_file (pChannelsGroupInfos, &filename, TRUE, error);
Expand All @@ -293,7 +295,8 @@ channels_list_refresh_channels_group (FreetuxTVApp *app, GtkTreePath *path_group
pdata.error = error;
int res = 0;

g_print("FreetuxTV : Parsing the file \"%s\"\n", filename);
g_log(FREETUXTV_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE,
"Parsing the file \"%s\"\n", filename);
res = libm3uparser_parse(filename, &on_parsem3u_add_channel, &pdata);
if (res != LIBM3UPARSER_OK){
if (res != LIBM3UPARSER_CALLBACK_RETURN_ERROR){
Expand Down Expand Up @@ -388,7 +391,8 @@ channels_list_delete_channels_group (FreetuxTVApp *app, GtkTreePath *path_group,
if(*error == NULL){
channels_group_get_file (pChannelsGroupInfos, &filename, TRUE, error);

g_print("FreetuxTV : Deleting the file \"%s\"\n", filename);
g_log(FREETUXTV_LOG_DOMAIN, G_LOG_LEVEL_INFO,
"Deleting the file \"%s\"\n", filename);
if(g_unlink(filename)){

}
Expand Down Expand Up @@ -1262,7 +1266,8 @@ on_popupmenu_activated_addfavourites (GtkMenuItem *menuitem, gpointer user_data)
gtk_tree_model_get (app->channelslist, &treeiter, CHANNEL_COLUMN, &pOriginalChannelInfos, -1);

if(pOriginalChannelInfos){
g_print("adding '%s' to group '%s'\n", pOriginalChannelInfos->name, pFavouritesChannelsGroupInfos->name);
g_log(FREETUXTV_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE,
"Adding '%s' to favourites group '%s'\n", pOriginalChannelInfos->name, pFavouritesChannelsGroupInfos->name);

// Copy the channel and add it in database
pChannelInfos = freetuxtv_channel_infos_new (pOriginalChannelInfos->name, pOriginalChannelInfos->url);
Expand Down
1 change: 0 additions & 1 deletion src/freetuxtv-db-sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,6 @@ dbsync_add_channel (DBSync *dbsync,
);

res = sqlite3_exec(dbsync->db_link, query, NULL, NULL, &db_err);
//g_print("%s\n", query);
sqlite3_free(query);

if(vlc_options){
Expand Down
3 changes: 2 additions & 1 deletion src/freetuxtv-tv-channels-list.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ tvchannels_list_synchronize (FreetuxTVApp *app, DBSync *dbsync,
text = g_strdup_printf(_("Synchronizing the tv channels list"));
windowmain_statusbar_push (app, "UpdateMsg", text);
g_free(text);
g_print("FreetuxTV : Synchronizing the tv channels list\n");
g_log(FREETUXTV_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE,
"Synchronizing the tv channels list\n");

// Delete the TV channel in the database
dbsync_delete_tvchannels (dbsync, error);
Expand Down
1 change: 0 additions & 1 deletion src/freetuxtv-window-add-channels-group.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,6 @@ on_buttonadd_clicked (GtkButton *button, gpointer user_data)
gtk_tree_path_free(priv->pLastAddedChannelsGroupPath);
}
priv->pLastAddedChannelsGroupPath = pTreePathTmp;
// g_print("added %s\n", gtk_tree_path_to_string (pTreePathTmp));

tmptext = g_strdup_printf(_("%d channels group(s) have been successfully added."), 1);
gtk_progress_dialog_set_text(pProgressDialog, tmptext);
Expand Down
Loading

0 comments on commit 5b60655

Please sign in to comment.