=?utf-8?q?=5Bnetwork-manager-openconnect=5D_cancel_the_find_request_in_ca?= =?utf-8?q?se_it=E2=80=99s_still_running?=
- From: David Woodhouse <dwmw2 src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-openconnect] cancel the find request in case itâs still running
- Date: Fri, 15 Jun 2012 21:15:49 +0000 (UTC)
commit 0c8d4ff34e0f93e24958cdfda40bb1dd150e06a5
Author: Michael Stapelberg <michael stapelberg de>
Date: Fri Jun 15 21:59:06 2012 +0200
cancel the find request in case itâs still running
auth-dialog/main.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index 14575ae..b7c7264 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -240,6 +240,7 @@ static void ssl_box_clear(auth_ui_data *ui_data)
typedef struct ui_fragment_data {
GtkWidget *widget;
GtkWidget *entry;
+ gpointer find_request;
auth_ui_data *ui_data;
#ifdef OPENCONNECT_OPENSSL
UI_STRING *uis;
@@ -528,6 +529,9 @@ static int ui_flush(UI* ui)
if (data->entry_text) {
UI_set_result(ui, data->uis, data->entry_text);
}
+ if (data->find_request) {
+ gnome_keyring_cancel_request(data->find_request);
+ }
g_slice_free (ui_fragment_data, data);
}
ui_data->form_grabbed = 0;
@@ -581,6 +585,10 @@ static void got_keyring_pw(GnomeKeyringResult result, const char *string, gpoint
gtk_entry_set_text(GTK_ENTRY(data->entry), string);
} else
data->entry_text = g_strdup (string);
+
+ /* zero the find request so that we donât attempt to cancel it when
+ * closing the dialog */
+ data->find_request = NULL;
}
/* This part for processing forms from openconnect directly, rather than
@@ -627,7 +635,7 @@ static gboolean ui_form (struct oc_auth_form *form)
else {
char *hostname;
hostname = openconnect_get_hostname(ui_data->vpninfo);
- gnome_keyring_find_password(
+ data->find_request = gnome_keyring_find_password(
OPENCONNECT_SCHEMA,
got_keyring_pw,
data,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]