[gnome-bluetooth] lib: Make _dump() work on filtered models
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth] lib: Make _dump() work on filtered models
- Date: Tue, 22 Feb 2011 04:15:12 +0000 (UTC)
commit 3f0a12cc7fa4efbaea4a08ab6ca3c454a251f5d3
Author: Bastien Nocera <hadess hadess net>
Date: Tue Feb 22 04:13:44 2011 +0000
lib: Make _dump() work on filtered models
Like the model from the chooser, otherwise devices are thought of
as adapters.
lib/bluetooth-client.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c
index 702bdbc..e32ee38 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -2171,13 +2171,21 @@ bluetooth_client_dump_device (GtkTreeModel *model,
BLUETOOTH_COLUMN_UUIDS, &uuids,
BLUETOOTH_COLUMN_PROXY, &proxy,
-1);
- is_adapter = !gtk_tree_model_iter_parent (model, &parent, iter);
+ if (proxy) {
+ char *basename;
+ basename = g_path_get_basename(dbus_g_proxy_get_path(proxy));
+ is_adapter = !g_str_has_prefix (basename, "dev_");
+ g_free (basename);
+ } else {
+ is_adapter = !gtk_tree_model_iter_parent (model, &parent, iter);
+ }
if (is_adapter != FALSE) {
/* Adapter */
g_print ("Adapter: %s (%s)\n", name, address);
if (is_default)
g_print ("\tDefault adapter\n");
+ g_print ("\tD-Bus Path: %s\n", proxy ? dbus_g_proxy_get_path (proxy) : "(none)");
g_print ("\tDiscoverable: %s\n", BOOL_STR (discoverable));
if (discovering)
g_print ("\tDiscovery in progress\n");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]