Merge lp:~kvalo/indicator-network/bug-687414 into lp:~indicator-applet-developers/indicator-network/indicator-network

Proposed by Kalle Valo on 2010-12-09
Status: Merged
Merged at revision: 116
Proposed branch: lp:~kvalo/indicator-network/bug-687414
Merge into: lp:~indicator-applet-developers/indicator-network/indicator-network
Diff against target: 88 lines (+35/-8)
2 files modified
src/agent/passphrase-dialog.c (+34/-6)
tests/connman-mock/connman-mock (+1/-2)
To merge this branch: bzr merge lp:~kvalo/indicator-network/bug-687414
Reviewer Review Type Date Requested Status
Conor Curran (community) 2010-12-09 Approve on 2010-12-09
Review via email: mp+43228@code.launchpad.net
To post a comment you must log in.
Conor Curran (cjcurran) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/agent/passphrase-dialog.c'
2--- src/agent/passphrase-dialog.c 2010-11-19 09:58:54 +0000
3+++ src/agent/passphrase-dialog.c 2010-12-09 15:16:40 +0000
4@@ -170,6 +170,30 @@
5 gtk_widget_show_all(GTK_WIDGET(self));
6 }
7
8+static void parse_passphrase_dict(PassphraseDialog *self, GVariant *dict)
9+{
10+ PassphraseDialogPrivate *priv = PASSPHRASE_DIALOG_GET_PRIVATE(self);
11+ GVariantIter iter;
12+ GVariant *value;
13+ gchar *key;
14+
15+ g_variant_iter_init(&iter, dict);
16+
17+ while (g_variant_iter_next(&iter, "{sv}", &key, &value)) {
18+ g_debug("key %s", key);
19+
20+ if (g_strcmp0(key, "Type") == 0 &&
21+ g_variant_type_equal(G_VARIANT_TYPE_STRING,
22+ g_variant_get_type(value))) {
23+ /* priv->security_type should be empty now */
24+ g_variant_get(value, "s", &priv->security_type);
25+ }
26+
27+ g_variant_unref(value);
28+ g_free(key);
29+ }
30+}
31+
32 static void method_request_input(PassphraseDialog *self,
33 GVariant *parameters,
34 GDBusMethodInvocation *invocation)
35@@ -203,11 +227,8 @@
36 while (g_variant_iter_next(&dict_iter, "{sv}", &key, &value)) {
37 g_debug("key %s", key);
38
39- if (g_strcmp0(key, "Type") == 0 &&
40- g_variant_type_equal(G_VARIANT_TYPE_STRING, g_variant_get_type(value))) {
41- /* priv->security_type should be empty now */
42- g_variant_get(value, "s", &priv->security_type);
43- }
44+ if (g_strcmp0(key, "Passphrase") == 0)
45+ parse_passphrase_dict(self, value);
46
47 g_variant_unref(value);
48 g_free(key);
49@@ -437,7 +458,9 @@
50
51 security = priv->security_type;
52 if (security == NULL) {
53- g_warning("%s(): security type not defined", __func__);
54+ g_warning("passphrase-dialog: security type not defined");
55+ gtk_dialog_set_response_sensitive(GTK_DIALOG(self), GTK_RESPONSE_ACCEPT,
56+ TRUE);
57 return;
58 }
59
60@@ -463,6 +486,11 @@
61 gtk_dialog_set_response_sensitive(GTK_DIALOG(self), GTK_RESPONSE_ACCEPT,
62 FALSE);
63 }
64+ } else {
65+ g_warning("passphrase-dialog: unknown security mode: %s",
66+ priv->security_type);
67+ gtk_dialog_set_response_sensitive(GTK_DIALOG(self), GTK_RESPONSE_ACCEPT,
68+ TRUE);
69 }
70 }
71
72
73=== modified file 'tests/connman-mock/connman-mock'
74--- tests/connman-mock/connman-mock 2010-11-30 07:33:12 +0000
75+++ tests/connman-mock/connman-mock 2010-12-09 15:16:40 +0000
76@@ -269,11 +269,10 @@
77
78 args = {}
79 args["Requirement"] = "Mandatory"
80- args["Type"] = "string"
81+ args["Type"] = "wpa"
82
83 fields = {}
84 fields["Passphrase"] = args
85- fields["Type"] = "wpa"
86
87 proxy.RequestInput(service.get_path(), fields,
88 reply_handler=self.request_passphrase_reply,

Subscribers

People subscribed via source and target branches