# HG changeset patch # User renatofilho # Date 1165270240 0 # Node ID d2ca7625fef64495ab37f4544d3eb4b0eaa6f906 # Parent 944deaac3f015c157323ab97cd3e06b1a6924409 [svn r190] diff -r 944deaac3f01 -r d2ca7625fef6 gmyth/src/gmyth_backendinfo.c --- a/gmyth/src/gmyth_backendinfo.c Mon Dec 04 22:01:41 2006 +0000 +++ b/gmyth/src/gmyth_backendinfo.c Mon Dec 04 22:10:40 2006 +0000 @@ -177,7 +177,7 @@ backend_info->port = port; } -gchar* +const gchar* gmyth_backend_info_get_hostname (GMythBackendInfo *backend_info) { g_return_val_if_fail (backend_info != NULL, NULL); @@ -185,7 +185,7 @@ return backend_info->hostname; } -gchar* +const gchar* gmyth_backend_info_get_username (GMythBackendInfo *backend_info) { g_return_val_if_fail (backend_info != NULL, NULL); @@ -193,7 +193,7 @@ return backend_info->username; } -gchar* +const gchar* gmyth_backend_info_get_password (GMythBackendInfo *backend_info) { g_return_val_if_fail (backend_info != NULL, NULL); @@ -201,7 +201,7 @@ return backend_info->password; } -gchar* +const gchar* gmyth_backend_info_get_db_name (GMythBackendInfo *backend_info) { g_return_val_if_fail (backend_info != NULL, NULL); diff -r 944deaac3f01 -r d2ca7625fef6 gmyth/src/gmyth_backendinfo.h --- a/gmyth/src/gmyth_backendinfo.h Mon Dec 04 22:01:41 2006 +0000 +++ b/gmyth/src/gmyth_backendinfo.h Mon Dec 04 22:10:40 2006 +0000 @@ -63,27 +63,31 @@ }; -GType gmyth_backend_info_get_type (void); - -GMythBackendInfo* gmyth_backend_info_new (); -GMythBackendInfo* gmyth_backend_info_new_full ( - const gchar *hostname, const gchar *username, const gchar *password, - const gchar *db_name, gint port); -GMythBackendInfo* gmyth_backend_info_new_with_uri (const gchar *uri_str ); - -void gmyth_backend_info_set_hostname (GMythBackendInfo *backend_info, const gchar *hostname); -void gmyth_backend_info_set_username (GMythBackendInfo *backend_info, const gchar *username); -void gmyth_backend_info_set_password (GMythBackendInfo *backend_info, const gchar *password); -void gmyth_backend_info_set_db_name (GMythBackendInfo *backend_info, const gchar *db_name); -void gmyth_backend_info_set_port (GMythBackendInfo *backend_info, gint port); -void gmyth_backend_info_set_path (GMythBackendInfo *backend_info, const gchar *path); - -gchar* gmyth_backend_info_get_hostname (GMythBackendInfo *backend_info); -gchar* gmyth_backend_info_get_username (GMythBackendInfo *backend_info); -gchar* gmyth_backend_info_get_password (GMythBackendInfo *backend_info); -gchar* gmyth_backend_info_get_db_name (GMythBackendInfo *backend_info); -gint gmyth_backend_info_get_port (GMythBackendInfo *backend_info); -gchar* gmyth_backend_info_get_path (GMythBackendInfo *backend_info); +GType gmyth_backend_info_get_type (void); +GMythBackendInfo* gmyth_backend_info_new (void); +GMythBackendInfo* gmyth_backend_info_new_full (const gchar *hostname, + const gchar *username, + const gchar *password, + const gchar *db_name, + gint port); +GMythBackendInfo* gmyth_backend_info_new_with_uri (const gchar *uri_str); +void gmyth_backend_info_set_hostname (GMythBackendInfo *backend_info, + const gchar *hostname); +void gmyth_backend_info_set_username (GMythBackendInfo *backend_info, + const gchar *username); +void gmyth_backend_info_set_password (GMythBackendInfo *backend_info, + const gchar *password); +void gmyth_backend_info_set_db_name (GMythBackendInfo *backend_info, + const gchar *db_name); +void gmyth_backend_info_set_port (GMythBackendInfo *backend_info, + gint port); +void gmyth_backend_info_set_path (GMythBackendInfo *backend_info, + const gchar *path); +const gchar* gmyth_backend_info_get_hostname (GMythBackendInfo *backend_info); +const gchar* gmyth_backend_info_get_username (GMythBackendInfo *backend_info); +const gchar* gmyth_backend_info_get_password (GMythBackendInfo *backend_info); +const gchar* gmyth_backend_info_get_db_name (GMythBackendInfo *backend_info); +gint gmyth_backend_info_get_port (GMythBackendInfo *backend_info); G_END_DECLS diff -r 944deaac3f01 -r d2ca7625fef6 gmyth/src/gmyth_file_transfer.c --- a/gmyth/src/gmyth_file_transfer.c Mon Dec 04 22:01:41 2006 +0000 +++ b/gmyth/src/gmyth_file_transfer.c Mon Dec 04 22:10:40 2006 +0000 @@ -245,7 +245,6 @@ GString *base_str = NULL; GString *hostname = NULL; GMythStringList *strlist = NULL; - gchar *path_dir = NULL; gboolean ret = TRUE; g_return_val_if_fail (transfer != NULL, FALSE ); @@ -253,8 +252,6 @@ g_return_val_if_fail (transfer->port > 0, FALSE); base_str = g_string_new (""); - path_dir = ( transfer->filename != NULL ? transfer->filename : - gmyth_backend_info_get_path( transfer->backend_info ) ); /* Creates the control socket */ if (transfer->control_sock != NULL) { @@ -291,7 +288,6 @@ g_string_printf( base_str, "ANN FileTransfer %s", hostname->str); gmyth_string_list_append_string (strlist, base_str ); - gmyth_string_list_append_char_array (strlist, path_dir ); gmyth_socket_write_stringlist (transfer->sock, strlist ); gmyth_socket_read_stringlist (transfer->sock, strlist ); diff -r 944deaac3f01 -r d2ca7625fef6 gmyth/src/gmyth_tvchain.c --- a/gmyth/src/gmyth_tvchain.c Mon Dec 04 22:01:41 2006 +0000 +++ b/gmyth/src/gmyth_tvchain.c Mon Dec 04 22:10:40 2006 +0000 @@ -114,7 +114,7 @@ gboolean gmyth_tvchain_initialize (GMythTVChain *tvchain, GMythBackendInfo *backend_info) { - char *hostname; + const char *hostname; assert (tvchain); g_return_val_if_fail (backend_info != NULL, FALSE); @@ -125,21 +125,21 @@ hostname = gmyth_backend_info_get_hostname (backend_info); if (tvchain->tvchain_id == NULL) { - GString *isodate; - time_t cur_time; + GString *isodate; + time_t cur_time; - time(&cur_time); - isodate = gmyth_util_time_to_isoformat (cur_time); + time(&cur_time); + isodate = gmyth_util_time_to_isoformat (cur_time); - tvchain->tvchain_id = g_string_sized_new (7 + strlen (hostname) + isodate->len); - g_string_printf(tvchain->tvchain_id, - "live-%s-%s", hostname, isodate->str); + tvchain->tvchain_id = g_string_sized_new (7 + strlen (hostname) + isodate->len); + g_string_printf(tvchain->tvchain_id, + "live-%s-%s", hostname, isodate->str); - gmyth_debug ("[%s] tv_chain_id: %s", __FUNCTION__, tvchain->tvchain_id->str); + gmyth_debug ("[%s] tv_chain_id: %s", __FUNCTION__, tvchain->tvchain_id->str); - g_string_free(isodate, TRUE); + g_string_free(isodate, TRUE); } else { - g_warning ("[%s] TVchain already initialized", __FUNCTION__); + g_warning ("[%s] TVchain already initialized", __FUNCTION__); } return TRUE; @@ -167,11 +167,10 @@ gmyth_tvchain_reload_all (GMythTVChain *tvchain) { MYSQL_ROW msql_row; - MYSQL_RES *msql_res; - GMythQuery *gmyth_query; + MYSQL_RES *msql_res = NULL; + GMythQuery *gmyth_query = NULL; gboolean ret = TRUE; - - GString *stmt_str; + GString *stmt_str = NULL; g_static_mutex_lock( &mutex );