Do

Merge lp:~cszikszoy/do/nm-connectivity-fix into lp:do

Proposed by Chris S.
Status: Merged
Approved by: Alex Launi
Approved revision: 1306
Merged at revision: not available
Proposed branch: lp:~cszikszoy/do/nm-connectivity-fix
Merge into: lp:do
Diff against target: 21 lines
1 file modified
Do.Platform.Linux/src/Do.Platform/Do.Platform.Linux/NetworkService.cs (+4/-3)
To merge this branch: bzr merge lp:~cszikszoy/do/nm-connectivity-fix
Reviewer Review Type Date Requested Status
Alex Launi (community) Approve
Review via email: mp+12851@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Chris S. (cszikszoy) wrote :

This should fix the cases where people don't have network manaager. What's changed is that we set the connection state if we can find the network manager dbus. If there was an error (the nm dbus wasn't found), we log the error and just assume that we are connected. This way any plugins that query IsConnected won't fail when NM couldn't be found.

Revision history for this message
Alex Launi (alexlauni) wrote :

git r done

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Do.Platform.Linux/src/Do.Platform/Do.Platform.Linux/NetworkService.cs'
2--- Do.Platform.Linux/src/Do.Platform/Do.Platform.Linux/NetworkService.cs 2009-08-14 00:13:39 +0000
3+++ Do.Platform.Linux/src/Do.Platform/Do.Platform.Linux/NetworkService.cs 2009-10-04 20:10:19 +0000
4@@ -53,13 +53,14 @@
5 if (Bus.System.NameHasOwner (NetworkManagerName)) {
6 network = Bus.System.GetObject<INetworkManager> (NetworkManagerName, new ObjectPath (NetworkManagerPath));
7 network.StateChanged += OnStateChanged;
8+ SetConnected ();
9 }
10 } catch (Exception e) {
11- Log<NetworkService>.Error ("Could not initialize dbus: {0}", e.Message);
12+ // if something bad happened, log the error and assume we are connected
13+ Log<NetworkService>.Error ("Could not initialize Network Manager dbus: {0}", e.Message);
14 Log<NetworkService>.Debug (e.StackTrace);
15+ this.IsConnected = true;
16 }
17-
18- SetConnected ();
19 }
20
21 void OnStateChanged (uint state)