From: Bastien Nocera <hadess@hadess.net>
To: BlueZ development <linux-bluetooth@vger.kernel.org>
Subject: [PATCH] Fix incorrect device name in the wizard
Date: Thu, 23 Oct 2008 22:40:58 +0100 [thread overview]
Message-ID: <1224798058.2895.209.camel@cookie.hadess.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 187 bytes --]
When the device is selected in the list before its name is resolved,
the device name in the checks as well as the final page of the wizard
will be wrong.
Attached patch should fix that.
[-- Attachment #2: 0001-Fix-incorrect-device-name-in-the-wizard.patch --]
[-- Type: text/x-patch, Size: 2338 bytes --]
>From 3ee1953501e1a64aba62405d63fde893a6a609ba Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Thu, 23 Oct 2008 22:30:11 +0100
Subject: [PATCH] Fix incorrect device name in the wizard
When the device is selected in the list before its name is resolved,
the device name in the checks as well as the final page of the wizard
will be wrong.
---
wizard/main.c | 40 ++++++++++++++++++++++++----------------
1 files changed, 24 insertions(+), 16 deletions(-)
diff --git a/wizard/main.c b/wizard/main.c
index b1b944b..6f0b035 100644
--- a/wizard/main.c
+++ b/wizard/main.c
@@ -193,7 +193,28 @@ static void prepare_callback(GtkWidget *assistant,
bluetooth_client_stop_discovery(client);
if (page == page_setup) {
- gchar *text, *markup;
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ gchar *text, *markup, *address, *name;
+ guint type;
+
+ /* Get the info about the device now,
+ * we can't get here without a valid selection */
+ if (gtk_tree_selection_get_selected(search_selection, &model, &iter) == FALSE)
+ g_assert_not_reached();
+
+ gtk_tree_model_get(model, &iter,
+ BLUETOOTH_COLUMN_ADDRESS, &address,
+ BLUETOOTH_COLUMN_ALIAS, &name,
+ BLUETOOTH_COLUMN_TYPE, &type, -1);
+
+ g_free(target_address);
+ target_address = address;
+
+ g_free(target_name);
+ target_name = name;
+
+ target_type = type;
text = g_strdup_printf(_("Connecting to %s now ..."),
target_name);
@@ -353,30 +374,17 @@ static void select_callback(GtkTreeSelection *selection, gpointer user_data)
GtkAssistant *assistant = user_data;
GtkTreeModel *model;
GtkTreeIter iter;
- gboolean selected;
gboolean paired = FALSE;
- gchar *address, *name;
- guint type;
+ gboolean selected;
selected = gtk_tree_selection_get_selected(selection, &model, &iter);
if (selected == TRUE) {
gtk_tree_model_get(model, &iter,
- BLUETOOTH_COLUMN_PAIRED, &paired,
- BLUETOOTH_COLUMN_ADDRESS, &address,
- BLUETOOTH_COLUMN_ALIAS, &name,
- BLUETOOTH_COLUMN_TYPE, &type, -1);
+ BLUETOOTH_COLUMN_PAIRED, &paired, -1);
if (paired == TRUE)
selected = FALSE;
-
- g_free(target_address);
- target_address = address;
-
- g_free(target_name);
- target_name = name;
-
- target_type = type;
}
gtk_assistant_set_page_complete(assistant, page_search, selected);
--
1.6.0.3
next reply other threads:[~2008-10-23 21:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-23 21:40 Bastien Nocera [this message]
2008-10-27 19:57 ` [PATCH] Fix incorrect device name in the wizard Marcel Holtmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1224798058.2895.209.camel@cookie.hadess.net \
--to=hadess@hadess.net \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox