[gnome-bluetooth] Bug 584141 – Add delete function
- From: Bastien Nocera <hadess src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-bluetooth] Bug 584141 – Add delete function
- Date: Mon, 8 Jun 2009 09:22:14 -0400 (EDT)
commit 869e2d72be4a900b098e604348470facc7c28fb1
Author: Bastien Nocera <hadess hadess net>
Date: Mon Jun 8 14:21:18 2009 +0100
Bug 584141 â?? Add delete function
Added a device_removed function to plugins, so they can unregister
any setups they used to have with that particular device.
---
common/bluetooth-plugin-manager.c | 13 +++++++++++++
common/bluetooth-plugin-manager.h | 1 +
common/bluetooth-plugin.h | 1 +
common/plugins/test.c | 9 ++++++++-
4 files changed, 23 insertions(+), 1 deletions(-)
diff --git a/common/bluetooth-plugin-manager.c b/common/bluetooth-plugin-manager.c
index 9b07933..2d1554c 100644
--- a/common/bluetooth-plugin-manager.c
+++ b/common/bluetooth-plugin-manager.c
@@ -124,3 +124,16 @@ bluetooth_plugin_manager_get_widgets (const char *bdaddr,
return ret;
}
+void
+bluetooth_plugin_manager_device_deleted (const char *bdaddr)
+{
+ GList *l;
+
+ for (l = plugin_list; l != NULL; l = l->next) {
+ GbtPlugin *p = l->data;
+
+ if (p->info->device_removed != NULL)
+ p->info->device_removed (bdaddr);
+ }
+}
+
diff --git a/common/bluetooth-plugin-manager.h b/common/bluetooth-plugin-manager.h
index c44cfa7..1e8dacd 100644
--- a/common/bluetooth-plugin-manager.h
+++ b/common/bluetooth-plugin-manager.h
@@ -31,6 +31,7 @@ void bluetooth_plugin_manager_cleanup (void);
GList *bluetooth_plugin_manager_get_widgets (const char *bdaddr,
const char **uuids);
+void bluetooth_plugin_manager_device_deleted (const char *bdaddr);
G_END_DECLS
diff --git a/common/bluetooth-plugin.h b/common/bluetooth-plugin.h
index 6028ccf..9f6069c 100644
--- a/common/bluetooth-plugin.h
+++ b/common/bluetooth-plugin.h
@@ -12,6 +12,7 @@ struct _GbtPluginInfo
const char *id;
gboolean (* has_config_widget) (const char *bdaddr, const char **uuids);
GtkWidget * (* get_config_widgets) (const char *bdaddr, const char **uuids);
+ void (* device_removed) (const char *bdaddr);
};
struct _GbtPlugin
diff --git a/common/plugins/test.c b/common/plugins/test.c
index 7a9cb9f..c3ee1ec 100644
--- a/common/plugins/test.c
+++ b/common/plugins/test.c
@@ -53,10 +53,17 @@ get_config_widgets (const char *bdaddr, const char **uuids)
return gtk_check_button_new_with_label (_("Access the Internet using your mobile phone (test)"));
}
+static void
+device_removed (const char *bdaddr)
+{
+ g_message ("Device '%s' got removed");
+}
+
static GbtPluginInfo plugin_info = {
"test-plugin",
has_config_widget,
- get_config_widgets
+ get_config_widgets,
+ device_removed
};
GBT_INIT_PLUGIN(plugin_info)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]