diff options
author | Bastien Nocera <hadess@hadess.net> | 2021-02-18 12:05:19 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2021-02-18 12:17:24 +0100 |
commit | b987b560633b941b2ad4062fc7369071363d3eb7 (patch) | |
tree | 370bd6c03dc0886f644cd6b1a11adbbedde33a4f | |
parent | 7ad3ca128811905a2480c6228a8998de05e68427 (diff) | |
download | gnome-bluetooth-b987b560633b941b2ad4062fc7369071363d3eb7.tar.gz |
settings-widget: Really fix "don't show devices without a name"
The fix in commit 274b856f11bcbb2be67ebc25151c0ae796baab9a was overly
aggressive and did not create any rows for devices that appeared and
didn't have a name. The problem is that the rows were also not created
when that name appeared.
Always create rows for devices which we might end up showing but mark
them as invisible until a name is present.
-rw-r--r-- | lib/bluetooth-settings-widget.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/bluetooth-settings-widget.c b/lib/bluetooth-settings-widget.c index 80433ec5..dd4015cb 100644 --- a/lib/bluetooth-settings-widget.c +++ b/lib/bluetooth-settings-widget.c @@ -1635,23 +1635,22 @@ row_inserted_cb (GtkTreeModel *tree_model, gboolean paired, trusted, connected, legacy_pairing; GtkWidget *row; - gtk_tree_model_get (tree_model, iter, - BLUETOOTH_COLUMN_NAME, &name, - BLUETOOTH_COLUMN_ADDRESS, &bdaddr, - -1); - - if (name == NULL || - is_interesting_device (tree_model, iter) == FALSE) { - g_debug ("Not adding device '%s'", name ? name : bdaddr); + if (is_interesting_device (tree_model, iter) == FALSE) { + gtk_tree_model_get (tree_model, iter, + BLUETOOTH_COLUMN_NAME, &name, + -1); + g_debug ("Not adding device '%s'", name); return; } gtk_tree_model_get (tree_model, iter, BLUETOOTH_COLUMN_PROXY, &proxy, + BLUETOOTH_COLUMN_NAME, &name, BLUETOOTH_COLUMN_ALIAS, &alias, BLUETOOTH_COLUMN_PAIRED, &paired, BLUETOOTH_COLUMN_TRUSTED, &trusted, BLUETOOTH_COLUMN_CONNECTED, &connected, + BLUETOOTH_COLUMN_ADDRESS, &bdaddr, BLUETOOTH_COLUMN_TYPE, &type, BLUETOOTH_COLUMN_LEGACYPAIRING, &legacy_pairing, -1); @@ -1670,6 +1669,7 @@ row_inserted_cb (GtkTreeModel *tree_model, "alias", alias, "address", bdaddr, "legacy-pairing", legacy_pairing, + "visible", name != NULL, NULL); g_object_set_data_full (G_OBJECT (row), "object-path", g_strdup (g_dbus_proxy_get_object_path (proxy)), g_free); @@ -1744,6 +1744,7 @@ row_changed_cb (GtkTreeModel *tree_model, "name", name, "alias", alias, "legacy-pairing", legacy_pairing, + "visible", name != NULL, NULL); /* Update the properties if necessary */ |