diff src/bluetooth/agent.c @ 2916:223822ba79f2

writing bonded device to the config file so it can be unbounded at start-up when the player doesn't stop normaly
author Paula Stanciu <paula.stanciu@gmail.com>
date Sat, 16 Aug 2008 21:46:08 +0300
parents 35773e919dba
children
line wrap: on
line diff
--- a/src/bluetooth/agent.c	Sat Aug 16 01:37:42 2008 +0200
+++ b/src/bluetooth/agent.c	Sat Aug 16 21:46:08 2008 +0300
@@ -711,6 +711,9 @@
 	dbus_g_proxy_call(object, "GetRemoteName", NULL,
 				G_TYPE_STRING, address, G_TYPE_INVALID,
 				G_TYPE_STRING, &name, G_TYPE_INVALID);
+     mcs_handle_t *cfgfile = aud_cfg_db_open();
+    aud_cfg_db_set_string(cfgfile,"BLUETOOTH_PLUGIN","bonded", address);
+    aud_cfg_db_close(cfgfile);
 
 	if (name) {
 		if (g_strrstr(name, address))
@@ -735,8 +738,7 @@
 {
 	const char *adapter = NULL, *name = NULL;
 	gchar *device, *text;
-
-	dbus_g_proxy_call(object, "GetName", NULL, G_TYPE_INVALID,
+ 	dbus_g_proxy_call(object, "GetName", NULL, G_TYPE_INVALID,
 				G_TYPE_STRING, &adapter, G_TYPE_INVALID);
 
 	dbus_g_proxy_call(object, "GetRemoteName", NULL,
@@ -752,6 +754,9 @@
 		device = g_strdup(address);
 
 	text = g_strdup_printf(_("Removed bonding with %s"), device);
+    mcs_handle_t *cfgfile = aud_cfg_db_open();
+    aud_cfg_db_set_string(cfgfile,"BLUETOOTH_PLUGIN","bonded","no");
+    aud_cfg_db_close(cfgfile);
 
 	g_free(device);
     printf("bonding removed\n");