Merge lp:~cyphermox/unity-control-center/lp1354987 into lp:unity-control-center

Proposed by Mathieu Trudel-Lapierre
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 12787
Merged at revision: 12788
Proposed branch: lp:~cyphermox/unity-control-center/lp1354987
Merge into: lp:unity-control-center
Diff against target: 43 lines (+6/-15)
1 file modified
panels/network/net-device-wired.c (+6/-15)
To merge this branch: bzr merge lp:~cyphermox/unity-control-center/lp1354987
Reviewer Review Type Date Requested Status
Sebastien Bacher Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+233416@code.launchpad.net

Commit message

Deactivate the wired device when wired is switched off.

Description of the change

Deactivate the wired device when wired is switched off.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks, but that fails to build. Could you also give details on the change, does it come from upstream g-c-c?

review: Needs Fixing
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Seems like the same fix is in gnome-control-center upstream, indeed; but it's just the obvious and right way to deactivate the device if you don't want it to connect automatically.

12787. By Mathieu Trudel-Lapierre

Fix typo in nm_device_disconnect() call.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote :

is it upstream?
reading https://git.gnome.org/browse/gnome-control-center/tree/panels/network/net-device-simple.c it seems to still have the code you are changing there
would it make sense to send the fix to GNOME as well in this case?

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

On Mon, Sep 8, 2014 at 3:00 PM, Sebastien Bacher <email address hidden> wrote:
> is it upstream?

Yes, but only for the ethernet device:
https://git.gnome.org/browse/gnome-control-center/tree/panels/network/net-device-ethernet.c

> reading https://git.gnome.org/browse/gnome-control-center/tree/panels/network/net-device-simple.c it seems to still have the code you are changing there
> would it make sense to send the fix to GNOME as well in this case?

Agreed, it should also be changed in net-device-simple; though nothing
seems to use that right now. I'll push the changes upstream.

/ Matt

Revision history for this message
Sebastien Bacher (seb128) wrote :

thanks, can you update the bug with the upstream ticket reference when you do that?

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'panels/network/net-device-wired.c'
--- panels/network/net-device-wired.c 2012-08-22 14:32:59 +0000
+++ panels/network/net-device-wired.c 2014-09-08 18:18:39 +0000
@@ -157,34 +157,25 @@
157 NMActiveConnection *a;157 NMActiveConnection *a;
158 NMConnection *connection;158 NMConnection *connection;
159 NMClient *client;159 NMClient *client;
160 NMDevice *nm_device;
160161
161 if (device_wired->priv->updating_device)162 if (device_wired->priv->updating_device)
162 return;163 return;
163164
165 client = net_object_get_client (NET_OBJECT (device_wired));
166 nm_device = net_device_get_nm_device (NET_DEVICE (device_wired));
167
164 active = gtk_switch_get_active (sw);168 active = gtk_switch_get_active (sw);
165 if (active) {169 if (active) {
166 client = net_object_get_client (NET_OBJECT (device_wired));
167 connection = net_device_get_find_connection (NET_DEVICE (device_wired));170 connection = net_device_get_find_connection (NET_DEVICE (device_wired));
168 if (connection == NULL)171 if (connection == NULL)
169 return;172 return;
170 nm_client_activate_connection (client,173 nm_client_activate_connection (client,
171 connection,174 connection,
172 net_device_get_nm_device (NET_DEVICE (device_wired)),175 nm_device,
173 NULL, NULL, NULL);176 NULL, NULL, NULL);
174 } else {177 } else {
175 connection = net_device_get_find_connection (NET_DEVICE (device_wired));178 nm_device_disconnect (nm_device, NULL, NULL);
176 if (connection == NULL)
177 return;
178 path = nm_connection_get_path (connection);
179 client = net_object_get_client (NET_OBJECT (device_wired));
180 acs = nm_client_get_active_connections (client);
181 for (i = 0; i < acs->len; i++) {
182 a = (NMActiveConnection*)acs->pdata[i];
183 if (strcmp (nm_active_connection_get_connection (a), path) == 0) {
184 nm_client_deactivate_connection (client, a);
185 break;
186 }
187 }
188 }179 }
189}180}
190181

Subscribers

People subscribed via source and target branches