After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 736290 - rfkill: add a property to determine whether to show airplane mode
rfkill: add a property to determine whether to show airplane mode
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks: 736291 736292
 
 
Reported: 2014-09-08 22:38 UTC by Cosimo Cecchi
Modified: 2014-09-09 18:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
rfkill: add a property to determine whether to show airplane mode (7.38 KB, patch)
2014-09-08 22:38 UTC, Cosimo Cecchi
accepted-commit_now Details | Review
rfkill: add a property to determine whether to show airplane mode (7.35 KB, patch)
2014-09-08 23:07 UTC, Cosimo Cecchi
committed Details | Review

Description Cosimo Cecchi 2014-09-08 22:38:25 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.
Comment 1 Cosimo Cecchi 2014-09-08 22:38:27 UTC
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.
Comment 2 Giovanni Campagna 2014-09-08 22:44:46 UTC
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?
Comment 3 Cosimo Cecchi 2014-09-08 22:50:30 UTC
(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...
Comment 4 Bastien Nocera 2014-09-08 22:56:42 UTC
(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.
Comment 5 Giovanni Campagna 2014-09-08 22:58:39 UTC
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)
Comment 6 Cosimo Cecchi 2014-09-08 23:00:07 UTC
(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...
Comment 7 Bastien Nocera 2014-09-08 23:00:42 UTC
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()
Comment 8 Giovanni Campagna 2014-09-08 23:02:55 UTC
(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.
Comment 9 Cosimo Cecchi 2014-09-08 23:04:17 UTC
(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.
Comment 10 Cosimo Cecchi 2014-09-08 23:07:43 UTC
Created attachment 285691 [details] [review]
rfkill: add a property to determine whether to show airplane mode

--

Updated for review comments.
Comment 11 Bastien Nocera 2014-09-09 00:05:21 UTC
Review of attachment 285691 [details] [review]:

Looks good
Comment 12 Cosimo Cecchi 2014-09-09 18:56:46 UTC
Attachment 285691 [details] pushed as b098762 - rfkill: add a property to determine whether to show airplane mode

Thanks, pushed to master.