GNOME Bugzilla – Bug 736290
rfkill: add a property to determine whether to show airplane mode
Last modified: 2014-09-09 18:57:41 UTC
This is useful to avoid showing an Airplane Mode switch or icon on systems that you would not use in an airplane, e.g. a desktop or a server.
Created attachment 285687 [details] [review] rfkill: add a property to determine whether to show airplane mode Interested parties can read this property to determine whether to show an airplane switch in the UI.
Review of attachment 285687 [details] [review]: I don't understand this, if the device is not a laptop according to the BIOS, why does it have an rfkill?
(In reply to comment #2) > Review of attachment 285687 [details] [review]: > > I don't understand this, if the device is not a laptop according to the BIOS, > why does it have an rfkill? Not really sure, but I have a desktop device on my desk that has a /dev/rfkill device...
(In reply to comment #2) > Review of attachment 285687 [details] [review]: > > I don't understand this, if the device is not a laptop according to the BIOS, > why does it have an rfkill? Because it still has software rfkill plus, possibly, a 3G modem.
I don't know, it looks like a hack to me. (In any case, you should probably parse /etc/machine-info instead of starting hostnamed just for this property)
(In reply to comment #5) > (In any case, you should probably parse /etc/machine-info instead of starting > hostnamed just for this property) You got this backwards - hostnamed already parses /etc/machine-info and returns its values over DBus if set, falling back to ACPI/DMI detection otherwise...
Review of attachment 285687 [details] [review]: Looks good to me. ::: plugins/rfkill/gsd-rfkill-manager.c @@ +636,3 @@ + "Chassis"); + + if (property == NULL) { No braces for one-line conditionals. @@ +782,3 @@ + + g_clear_object (&p->hostnamed_client); + g_free (p->chassis_type); g_clear_pointer()
(In reply to comment #6) > (In reply to comment #5) > > > (In any case, you should probably parse /etc/machine-info instead of starting > > hostnamed just for this property) > > You got this backwards - hostnamed already parses /etc/machine-info and returns > its values over DBus if set, falling back to ACPI/DMI detection otherwise... Yes, I was suggesting to optimize away the DBus activation of the service.
(In reply to comment #8) > > Yes, I was suggesting to optimize away the DBus activation of the service. CHASSIS will typically be unset in the file, as calling SetChassis() on the hostname interface is very uncommon.
Created attachment 285691 [details] [review] rfkill: add a property to determine whether to show airplane mode -- Updated for review comments.
Review of attachment 285691 [details] [review]: Looks good
Attachment 285691 [details] pushed as b098762 - rfkill: add a property to determine whether to show airplane mode Thanks, pushed to master.