|
From: <ren...@us...> - 2007-10-30 14:08:04
|
Revision: 885
http://gmyth.svn.sourceforge.net/gmyth/?rev=885&view=rev
Author: renatofilho
Date: 2007-10-30 07:08:04 -0700 (Tue, 30 Oct 2007)
Log Message:
-----------
fixed bug on connect function
Modified Paths:
--------------
trunk/gmyth-dbus/src/gmyth-dbus-server.c
Modified: trunk/gmyth-dbus/src/gmyth-dbus-server.c
===================================================================
--- trunk/gmyth-dbus/src/gmyth-dbus-server.c 2007-10-29 20:13:33 UTC (rev 884)
+++ trunk/gmyth-dbus/src/gmyth-dbus-server.c 2007-10-30 14:08:04 UTC (rev 885)
@@ -81,7 +81,6 @@
guint port,
const gchar *user,
const gchar *password,
- gboolean *result,
GError **error);
static gboolean gmyth_dbus_server_get_channel_list (GObject *obj,
GPtrArray **channels,
@@ -234,6 +233,7 @@
_("Fail to connect with EPG"));
return FALSE;
+
}
}
@@ -284,7 +284,6 @@
guint port,
const gchar *user,
const gchar *password,
- gboolean *result,
GError **error)
{
GMythSocket *s;
@@ -296,7 +295,7 @@
if (priv->connected)
{
- gmyth_dbus_server_internal_disconnect (obj, error);
+ gmyth_dbus_server_internal_disconnect (obj, NULL);
}
priv->myth_backend = gmyth_backend_info_new_full (host,
@@ -308,14 +307,14 @@
s = gmyth_backend_info_get_connected_socket (priv->myth_backend);
if (s)
{
+ priv->connected = TRUE;
g_object_unref (s);
- *result = TRUE;
}
else
{
+ priv->connected = FALSE;
g_object_unref (priv->myth_backend);
priv->myth_backend = NULL;
- *result = FALSE;
g_set_error (error,
GMYTH_DBUS_ERROR,
@@ -323,8 +322,7 @@
_("Fail to connect with backend"));
}
- priv->connected = *result;
- return *result;
+ return priv->connected;
}
static gboolean
@@ -349,9 +347,14 @@
gmyth_dbus_server_disconnect (GObject *obj,
GError **error)
{
+ GMythDbusServerPrivate *priv;
- gmyth_dbus_server_internal_disconnect (obj, error);
- g_signal_emit (obj, signals[DISCONNECTED], 0);
+ priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
+ if (priv->connected)
+ {
+ gmyth_dbus_server_internal_disconnect (obj, error);
+ g_signal_emit (obj, signals[DISCONNECTED], 0);
+ }
return TRUE;
}
@@ -384,6 +387,8 @@
g_object_unref (priv->myth_scheduler);
priv->myth_scheduler = NULL;
}
+
+ priv->connected = FALSE;
}
static gboolean
@@ -433,7 +438,7 @@
GMYTH_DBUS_ERROR,
GMYTH_DBUS_ERROR_MYTHTV,
_("Fail to get MythTv details"));
- }
+}
g_object_unref (socket);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|