summaryrefslogtreecommitdiff
path: root/mission-control
diff options
context:
space:
mode:
authorStef Walter <stefw@collabora.co.uk>2011-03-20 10:40:19 +0100
committerStef Walter <stefw@collabora.co.uk>2011-03-20 10:40:19 +0100
commitdf566cfa13fca23209ef38986ebc9bd9af6da88e (patch)
tree5bb97dcf09a26b0b950ce27a89b2e450cf7a1d22 /mission-control
parentae724ddef287b8730cb3eca120273f0bc9d77a3b (diff)
Fix timeout to use seconds, and add more debug messages.
Diffstat (limited to 'mission-control')
-rw-r--r--mission-control/mcp-account-manager-ytstenut.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/mission-control/mcp-account-manager-ytstenut.c b/mission-control/mcp-account-manager-ytstenut.c
index 272452a..1e70957 100644
--- a/mission-control/mcp-account-manager-ytstenut.c
+++ b/mission-control/mcp-account-manager-ytstenut.c
@@ -38,7 +38,7 @@
#undef DEBUG
#define DEBUG(format, ...) \
- g_debug ("%s (%d): " format, G_STRFUNC, __LINE__, ##__VA_ARGS__)
+ g_debug ("%s (line:%d): " format, G_STRFUNC, __LINE__, ##__VA_ARGS__)
#define PLUGIN_NAME "ytstenut"
#define PLUGIN_PRIORITY (MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_KEYRING + 20)
@@ -49,8 +49,8 @@
TP_ACCOUNT_OBJECT_PATH_BASE YTSTENUT_ACCOUNT_NAME
#define ACCOUNT_MANAGER_PATH "/com/meego/xpmn/ytstenut/AccountManager"
-/* Timeout after last release before going offline, in ms */
-#define RELEASE_TIMEOUT 5000
+/* Timeout after last release before going offline, in seconds */
+#define RELEASE_TIMEOUT 5
/* properties */
enum
@@ -219,6 +219,8 @@ on_release_timeout (gpointer user_data)
priv->timeout_id = 0;
+ DEBUG ("Release timeout called");
+
if (g_hash_table_size (priv->hold_requests) == 0)
account_manager_set_presence (self, TP_CONNECTION_PRESENCE_TYPE_OFFLINE);
@@ -259,7 +261,7 @@ account_manager_hold (McpAccountManagerYtstenut *self, const gchar *client)
account_manager_set_presence (self, TP_CONNECTION_PRESENCE_TYPE_AVAILABLE);
if (priv->timeout_id != 0)
{
- DEBUG ("Cancelling offline timeout: %d", RELEASE_TIMEOUT);
+ DEBUG ("Cancelling offline timeout");
g_source_remove (priv->timeout_id);
priv->timeout_id = 0;
}
@@ -355,7 +357,10 @@ mcp_account_manager_ytstenut_dispose (GObject *object)
McpAccountManagerYtstenutPrivate *priv = self->priv;
if (priv->timeout_id != 0)
- g_source_remove (priv->timeout_id);
+ {
+ DEBUG ("Cancelling offline timeout");
+ g_source_remove (priv->timeout_id);
+ }
priv->timeout_id = 0;
g_hash_table_remove_all (priv->hold_requests);