diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2013-08-06 13:33:08 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2013-08-06 13:33:08 -0500 |
commit | c920d6f9c8d967d7de311fc417fd5a8c8e85dd43 (patch) | |
tree | a6db9f6776971f1d30fe66f64fb50c5cdab9ac0e /src | |
parent | cd197748b97a3c2aeb4d3470805d3e12b7b46983 (diff) | |
download | ayatana-indicator-bluetooth-c920d6f9c8d967d7de311fc417fd5a8c8e85dd43.tar.gz ayatana-indicator-bluetooth-c920d6f9c8d967d7de311fc417fd5a8c8e85dd43.tar.bz2 ayatana-indicator-bluetooth-c920d6f9c8d967d7de311fc417fd5a8c8e85dd43.zip |
add some extra comments
Diffstat (limited to 'src')
-rw-r--r-- | src/killswitch.vala | 9 | ||||
-rw-r--r-- | src/service.vala | 4 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/killswitch.vala b/src/killswitch.vala index 7695c0c..6d8f195 100644 --- a/src/killswitch.vala +++ b/src/killswitch.vala @@ -22,12 +22,14 @@ * either by software (e.g., a session configuration setting) * or by hardware (e.g., user disabled it via a physical switch on her laptop). * - * KillSwitchBluetooth uses this as a backend for its Bluetooth.blocked property. + * KillSwitchBluetooth uses this as the impl for its Bluetooth.blocked property */ public interface KillSwitch: Object { public abstract bool blocked { get; protected set; } + /* Try to block/unblock bluetooth. + * This can fail if the requested state is overruled by a hardware block. */ public abstract void try_set_blocked (bool blocked); } @@ -42,13 +44,16 @@ public class RfKillSwitch: KillSwitch, Object { return_if_fail (this.blocked != blocked); - // try to soft-block all the bluetooth devices + // Try to soft-block all the bluetooth devices var event = Linux.RfKillEvent() { op = Linux.RfKillOp.CHANGE_ALL, type = Linux.RfKillType.BLUETOOTH, soft = (uint8)blocked }; + /* Write this request to rfkill. + * Don't update this object's "blocked" property here -- + * We'll get the update when on_channel_event() reads it below */ var bwritten = Posix.write (fd, &event, sizeof(Linux.RfKillEvent)); if (bwritten == -1) warning (@"Could not write rfkill event: $(strerror(errno))"); diff --git a/src/service.vala b/src/service.vala index c51e58f..e6d217a 100644 --- a/src/service.vala +++ b/src/service.vala @@ -18,6 +18,10 @@ * Robert Ancell <robert.ancell@canonical.com> */ +/** + * Boilerplate class to own the name on the bus, + * to create the profiles, and to export them on the bus. + */ public class Service: Object { private MainLoop loop; |