[gnome-bluetooth] lib: Add helper to dump the selected device



commit 16b30c509397fc13cd49be1a8cb4021011704d92
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Oct 13 17:41:20 2011 +0100

    lib: Add helper to dump the selected device
    
    To BluetoothChooser, which makes it easier to add debug
    to applications.

 lib/bluetooth-chooser.c     |   19 +++++++++++++++++++
 lib/bluetooth-chooser.h     |    1 +
 lib/gnome-bluetooth.symbols |    1 +
 3 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/lib/bluetooth-chooser.c b/lib/bluetooth-chooser.c
index f9ee5f4..bb8cd28 100644
--- a/lib/bluetooth-chooser.c
+++ b/lib/bluetooth-chooser.c
@@ -363,6 +363,25 @@ bluetooth_chooser_get_selected_device_info (BluetoothChooser *self,
 }
 
 /**
+ * bluetooth_chooser_dump_selected_device:
+ * @self: A #BluetoothChooser widget.
+ *
+ * Prints all the known attributes for the currently selected device
+ * on the standard output. Useful for debugging.
+ **/
+void
+bluetooth_chooser_dump_selected_device (BluetoothChooser *self)
+{
+	BluetoothChooserPrivate *priv = BLUETOOTH_CHOOSER_GET_PRIVATE(self);
+	GtkTreeIter iter;
+	GtkTreeModel *model;
+
+	gtk_tree_selection_get_selected (priv->selection, &model, &iter);
+
+	bluetooth_client_dump_device (model, &iter);
+}
+
+/**
  * bluetooth_chooser_get_model:
  * @self: A #BluetoothChooser widget.
  *
diff --git a/lib/bluetooth-chooser.h b/lib/bluetooth-chooser.h
index f657cfe..82bf9df 100644
--- a/lib/bluetooth-chooser.h
+++ b/lib/bluetooth-chooser.h
@@ -70,6 +70,7 @@ char *bluetooth_chooser_get_selected_device_name (BluetoothChooser *self);
 char * bluetooth_chooser_get_selected_device_icon (BluetoothChooser *self);
 BluetoothType bluetooth_chooser_get_selected_device_type (BluetoothChooser *self);
 gboolean bluetooth_chooser_get_selected_device_is_connected (BluetoothChooser *self);
+void bluetooth_chooser_dump_selected_device (BluetoothChooser *self);
 
 void bluetooth_chooser_start_discovery (BluetoothChooser *self);
 void bluetooth_chooser_stop_discovery (BluetoothChooser *self);
diff --git a/lib/gnome-bluetooth.symbols b/lib/gnome-bluetooth.symbols
index 1e7c0b1..2b6065e 100644
--- a/lib/gnome-bluetooth.symbols
+++ b/lib/gnome-bluetooth.symbols
@@ -1,3 +1,4 @@
+bluetooth_chooser_dump_selected_device
 bluetooth_chooser_get_type
 bluetooth_chooser_new
 bluetooth_chooser_set_title



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]