1.1 --- a/gmyth/src/gmyth_backendinfo.c Tue Aug 21 20:04:23 2007 +0100
1.2 +++ b/gmyth/src/gmyth_backendinfo.c Wed Aug 22 14:06:43 2007 +0100
1.3 @@ -57,10 +57,11 @@
1.4 gmyth_backend_info_init(GMythBackendInfo * backend_info)
1.5 {
1.6 backend_info->hostname = NULL;
1.7 + backend_info->port = -1;
1.8 backend_info->username = NULL;
1.9 backend_info->password = NULL;
1.10 backend_info->db_name = NULL;
1.11 - backend_info->port = -1;
1.12 + backend_info->db_port = 0;
1.13 backend_info->status_port = -1;
1.14 }
1.15
1.16 @@ -78,10 +79,11 @@
1.17 g_object_unref (backend_info->sock);
1.18
1.19 backend_info->hostname = NULL;
1.20 + backend_info->port = -1;
1.21 backend_info->username = NULL;
1.22 backend_info->password = NULL;
1.23 backend_info->db_name = NULL;
1.24 - backend_info->port = -1;
1.25 + backend_info->db_port = 0;
1.26 backend_info->status_port = -1;
1.27 backend_info->sock = NULL;
1.28
1.29 @@ -223,6 +225,18 @@
1.30 }
1.31
1.32 void
1.33 +gmyth_backend_info_set_db_port(GMythBackendInfo * backend_info, gint db_port)
1.34 +{
1.35 + g_return_if_fail(backend_info != NULL);
1.36 +
1.37 + if (db_port <= 0) {
1.38 + gmyth_debug("Error trying to set a port less than 0.");
1.39 + } else {
1.40 + backend_info->db_port = db_port;
1.41 + }
1.42 +}
1.43 +
1.44 +void
1.45 gmyth_backend_info_set_port(GMythBackendInfo * backend_info, gint port)
1.46 {
1.47 g_return_if_fail(backend_info != NULL);
1.48 @@ -281,6 +295,15 @@
1.49 }
1.50
1.51 gint
1.52 +gmyth_backend_info_get_idb_port(GMythBackendInfo * backend_info)
1.53 +{
1.54 + g_return_val_if_fail(backend_info != NULL, -1);
1.55 +
1.56 + return backend_info->db_port;
1.57 +}
1.58 +
1.59 +
1.60 +gint
1.61 gmyth_backend_info_get_port(GMythBackendInfo * backend_info)
1.62 {
1.63 g_return_val_if_fail(backend_info != NULL, -1);
2.1 --- a/gmyth/src/gmyth_backendinfo.h Tue Aug 21 20:04:23 2007 +0100
2.2 +++ b/gmyth/src/gmyth_backendinfo.h Wed Aug 22 14:06:43 2007 +0100
2.3 @@ -63,19 +63,21 @@
2.4 };
2.5
2.6 struct _GMythBackendInfo {
2.7 - GObject parent;
2.8 + GObject parent;
2.9 /** The backend hostname or ip address. */
2.10 - gchar *hostname;
2.11 + gchar *hostname;
2.12 + /** The backend port. */
2.13 + gint port;
2.14 /** The username to connect to the mysql server. */
2.15 - gchar *username;
2.16 + gchar *username;
2.17 /** The password to connect to the mysql server. */
2.18 - gchar *password;
2.19 + gchar *password;
2.20 /** The mythtv's mysql database name. */
2.21 - gchar *db_name;
2.22 - /** The backend port. */
2.23 - gint port;
2.24 + gchar *db_name;
2.25 + /** The mysql database port */
2.26 + gint db_port;
2.27 /** The backend status port for http connection */
2.28 - gint status_port;
2.29 + gint status_port;
2.30
2.31 /* Private */
2.32 GMythSocket *sock;
2.33 @@ -98,6 +100,8 @@
2.34 const gchar *password);
2.35 void gmyth_backend_info_set_db_name (GMythBackendInfo *backend_info,
2.36 const gchar *db_name);
2.37 +void gmyth_backend_info_set_db_port (GMythBackendInfo *backend_info,
2.38 + gint db_port);
2.39 void gmyth_backend_info_set_port (GMythBackendInfo *backend_info,
2.40 gint port);
2.41 void gmyth_backend_info_set_status_port (GMythBackendInfo *backend_info,
2.42 @@ -106,6 +110,7 @@
2.43 const gchar* gmyth_backend_info_get_username (GMythBackendInfo *backend_info);
2.44 const gchar* gmyth_backend_info_get_password (GMythBackendInfo *backend_info);
2.45 const gchar* gmyth_backend_info_get_db_name (GMythBackendInfo *backend_info);
2.46 +gint gmyth_backend_info_get_db_port (GMythBackendInfo *backend_info);
2.47 gint gmyth_backend_info_get_port (GMythBackendInfo *backend_info);
2.48 GMythURI* gmyth_backend_info_get_uri (GMythBackendInfo *backend_info);
2.49 gboolean gmyth_backend_info_is_local_file (GMythBackendInfo *backend_info);