1 From f24d6e26f81e205769cecf0dae7e6cf90b23f9e9 Mon Sep 17 00:00:00 2001
2 Message-Id: <f24d6e26f81e205769cecf0dae7e6cf90b23f9e9.1334369310.git.paul.eggleton@linux.intel.com>
3 In-Reply-To: <cover.1334369310.git.paul.eggleton@linux.intel.com>
4 References: <cover.1334369310.git.paul.eggleton@linux.intel.com>
5 From: Paul Eggleton <paul.eggleton@linux.intel.com>
6 Date: Sat, 14 Apr 2012 02:37:55 +0100
7 Subject: [PATCH 5/6] Remove all handling of Passphrase property
9 Services no longer have a Passphrase property in ConnMan 0.79 -
10 credentials are handled entirely through the agent.
12 Upstream-Status: Submitted
14 Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
16 common/connman-client.c | 51 -----------------------------------------------
17 common/connman-client.h | 4 ---
18 common/connman-dbus.c | 11 +---------
19 properties/advanced.h | 1 -
20 properties/wifi.c | 48 --------------------------------------------
21 5 files changed, 1 insertions(+), 114 deletions(-)
23 diff --git a/common/connman-client.c b/common/connman-client.c
24 index e4441ad..dec9867 100644
25 --- a/common/connman-client.c
26 +++ b/common/connman-client.c
27 @@ -112,7 +112,6 @@ static void connman_client_init(ConnmanClient *client)
28 G_TYPE_BOOLEAN, /* favorite */
29 G_TYPE_UINT, /* strength */
30 G_TYPE_STRING, /* security */
31 - G_TYPE_STRING, /* passphrase */
32 G_TYPE_STRING, /* method */
33 G_TYPE_STRING, /* address */
34 G_TYPE_STRING, /* netmask */
35 @@ -501,56 +500,6 @@ gchar *connman_client_get_security(ConnmanClient *client, const gchar *network)
39 -gchar *connman_client_get_passphrase(ConnmanClient *client, const gchar *network)
41 - ConnmanClientPrivate *priv = CONNMAN_CLIENT_GET_PRIVATE(client);
45 - DBG("client %p", client);
47 - if (network == NULL)
50 - if (connman_dbus_get_iter(priv->store, network, &iter) == FALSE)
53 - gtk_tree_model_get(GTK_TREE_MODEL(priv->store), &iter,
54 - CONNMAN_COLUMN_PASSPHRASE, &passphrase, -1);
59 -gboolean connman_client_set_passphrase(ConnmanClient *client, const gchar *network,
60 - const gchar *passphrase)
62 - ConnmanClientPrivate *priv = CONNMAN_CLIENT_GET_PRIVATE(client);
64 - GValue value = { 0 };
65 - gboolean ret = FALSE;
67 - DBG("client %p", client);
69 - if (network == NULL)
72 - proxy = connman_dbus_get_proxy(priv->store, network);
76 - g_value_init(&value, G_TYPE_STRING);
77 - g_value_set_string(&value, passphrase);
79 - ret = connman_set_property(proxy, "Passphrase", &value, NULL);
81 - g_value_unset(&value);
83 - g_object_unref(proxy);
89 void connman_client_set_callback(ConnmanClient *client,
90 ConnmanClientCallback callback, gpointer user_data)
92 diff --git a/common/connman-client.h b/common/connman-client.h
93 index 6fe772c..bb36a2f 100644
94 --- a/common/connman-client.h
95 +++ b/common/connman-client.h
96 @@ -77,9 +77,6 @@ void connman_client_disconnect(ConnmanClient *client, const gchar *network);
97 gchar *connman_client_get_security(ConnmanClient *client, const gchar *network);
98 void connman_client_connect_async(ConnmanClient *client, const gchar *network,
99 connman_connect_reply callback, gpointer userdata);
100 -gchar *connman_client_get_passphrase(ConnmanClient *client, const gchar *network);
101 -gboolean connman_client_set_passphrase(ConnmanClient *client, const gchar *network,
102 - const gchar *passphrase);
103 void connman_client_set_remember(ConnmanClient *client, const gchar *network,
106 @@ -108,7 +105,6 @@ enum {
107 CONNMAN_COLUMN_FAVORITE, /* G_TYPE_BOOLEAN */
108 CONNMAN_COLUMN_STRENGTH, /* G_TYPE_UINT */
109 CONNMAN_COLUMN_SECURITY, /* G_TYPE_STRING */
110 - CONNMAN_COLUMN_PASSPHRASE, /* G_TYPE_STRING */
111 CONNMAN_COLUMN_METHOD, /* G_TYPE_STRING */
112 CONNMAN_COLUMN_ADDRESS, /* G_TYPE_STRING */
113 CONNMAN_COLUMN_NETMASK, /* G_TYPE_STRING */
114 diff --git a/common/connman-dbus.c b/common/connman-dbus.c
115 index 4eb77b6..f46a750 100644
116 --- a/common/connman-dbus.c
117 +++ b/common/connman-dbus.c
118 @@ -389,11 +389,6 @@ static void service_changed(DBusGProxy *proxy, const char *property,
119 gtk_tree_store_set(store, &iter,
120 CONNMAN_COLUMN_SECURITY, security,
122 - } else if (g_str_equal(property, "PassPhrase") == TRUE) {
123 - const char *passphrase = value ? g_value_get_string(value) : NULL;
124 - gtk_tree_store_set(store, &iter,
125 - CONNMAN_COLUMN_PASSPHRASE, passphrase,
127 } else if (g_str_equal(property, "Strength") == TRUE) {
128 guint strength = g_value_get_uchar(value);
129 gtk_tree_store_set(store, &iter,
130 @@ -406,7 +401,7 @@ static void service_properties(DBusGProxy *proxy, GHashTable *hash,
132 GtkTreeStore *store = user_data;
134 - const gchar *name, *icon, *passphrase, *security, *state;
135 + const gchar *name, *icon, *security, *state;
136 guint type, strength;
139 @@ -439,9 +434,6 @@ static void service_properties(DBusGProxy *proxy, GHashTable *hash,
140 value = g_hash_table_lookup(hash, "Security");
141 security = value ? g_strjoinv(" ", g_value_get_boxed(value)) : NULL;
143 - value = g_hash_table_lookup(hash, "PassPhrase");
144 - passphrase = value ? g_value_get_string(value) : NULL;
146 DBG("name %s type %d icon %s", name, type, icon);
148 value = g_hash_table_lookup(hash, "IPv4.Configuration");
149 @@ -499,7 +491,6 @@ static void service_properties(DBusGProxy *proxy, GHashTable *hash,
150 CONNMAN_COLUMN_STATE, state,
151 CONNMAN_COLUMN_FAVORITE, favorite,
152 CONNMAN_COLUMN_SECURITY, security,
153 - CONNMAN_COLUMN_PASSPHRASE, passphrase,
154 CONNMAN_COLUMN_STRENGTH, strength,
155 CONNMAN_COLUMN_METHOD, method,
156 CONNMAN_COLUMN_ADDRESS, addr,
157 diff --git a/properties/advanced.h b/properties/advanced.h
158 index d8f4117..553a15e 100644
159 --- a/properties/advanced.h
160 +++ b/properties/advanced.h
161 @@ -53,7 +53,6 @@ struct config_data {
165 - GtkWidget *passphrase;
166 GtkWidget *connect_info;
168 GtkWidget *disconnect;
169 diff --git a/properties/wifi.c b/properties/wifi.c
170 index 038d35a..bd325ef 100644
171 --- a/properties/wifi.c
172 +++ b/properties/wifi.c
173 @@ -57,17 +57,6 @@ static void connect_callback(GtkWidget *editable, gpointer user_data)
177 - if (data->wifi.passphrase) {
179 - passphrase = (gchar *)gtk_entry_get_text(GTK_ENTRY(data->wifi.passphrase));
180 - ret = connman_client_set_passphrase(data->client, data->device,
183 - if (ret == FALSE) {
188 active = gtk_combo_box_get_active(GTK_COMBO_BOX(data->policy.config));
189 data->ipv4_config.method = active ? "manual" : "dhcp";
190 data->ipv4_config.address = active ? gtk_entry_get_text(GTK_ENTRY(data->ipv4.entry[0])) : NULL;
191 @@ -250,22 +239,11 @@ static void wifi_ipconfig(GtkWidget *table, struct config_data *data, GtkTreeIte
192 G_CALLBACK(changed_callback), data);
195 -static void toggled_callback(GtkWidget *button, gpointer user_data)
197 - GtkWidget *entry = user_data;
200 - mode = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
202 - gtk_entry_set_visibility(GTK_ENTRY(entry), mode);
205 void add_wifi_service(GtkWidget *mainbox, GtkTreeIter *iter, struct config_data *data)
213 const char *name, *security, *icon, *state;
214 @@ -308,32 +286,6 @@ void add_wifi_service(GtkWidget *mainbox, GtkTreeIter *iter, struct config_data
215 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
216 data->wifi.security = label;
218 - label = gtk_label_new(_("Passphrase:"));
219 - gtk_table_attach_defaults(GTK_TABLE(table), label, 1, 2, 2, 3);
221 - if (g_str_equal(security, "none") != TRUE &&
222 - g_str_equal(security, "unknown") != TRUE) {
223 - entry = gtk_entry_new();
224 - gtk_entry_set_max_length (GTK_ENTRY (entry), 64);
225 - gtk_table_attach_defaults(GTK_TABLE(table), entry, 2, 4, 2, 3);
226 - gtk_entry_set_visibility(GTK_ENTRY(entry), 0);
227 - data->wifi.passphrase = entry;
229 - button = gtk_check_button_new_with_label(_("Show input"));
230 - gtk_table_attach_defaults(GTK_TABLE(table), button, 4, 5, 2, 3);
232 - g_signal_connect(G_OBJECT(button), "toggled",
233 - G_CALLBACK(toggled_callback), entry);
237 - label = gtk_label_new(_("none"));
238 - gtk_table_attach_defaults(GTK_TABLE(table), label, 2, 4, 2, 3);
239 - gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
240 - gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
241 - data->wifi.passphrase = NULL;
244 label = gtk_label_new(_(""));
245 gtk_table_attach_defaults(GTK_TABLE(table), label, 2, 3, 8, 9);
246 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);