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 724138 - Add support for pretty hostnames
Add support for pretty hostnames
Status: RESOLVED FIXED
Product: rygel
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: rygel-maint
rygel-maint
Depends on:
Blocks:
 
 
Reported: 2014-02-11 18:47 UTC by Giovanni Campagna
Modified: 2014-02-13 14:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add support for pretty hostnames (4.70 KB, patch)
2014-02-11 18:47 UTC, Giovanni Campagna
needs-work Details | Review
Add support for pretty hostnames (4.81 KB, patch)
2014-02-12 22:38 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2014-02-11 18:47:22 UTC
Read and parse /etc/machine-info to obtain a pretty human readable
hostname (eg. "Bob's Laptop" instead of "bob-laptop"). If the
file is not found, or it can't be parsed, we fall back on the
normal hostname.

In GNOME, the pretty hostname can be configured in the control
center details and sharing panels. In other systems, it can be
changed using "hostnamectl --pretty".
Comment 1 Giovanni Campagna 2014-02-11 18:47:25 UTC
Created attachment 268823 [details] [review]
Add support for pretty hostnames
Comment 2 Jens Georg 2014-02-12 07:39:59 UTC
Review of attachment 268823 [details] [review]:

Otherwise looks ok, thanks

::: src/librygel-core/rygel-root-device-factory.vala
@@ +45,3 @@
+                var parts = line.split ("=");
+
+                if (parts[0] == "PRETTY_HOSTNAME")

Missing curlies.

@@ +48,3 @@
+                    return string.joinv("=", parts[1:-1]);
+            }
+        } catch (GLib.Error e) { }

Please add a debug message here (debug because the fail isn't severe), empty catches are a PITA when something goes wrong (and if it's only "Why is pretty name not working")
Comment 3 Giovanni Campagna 2014-02-12 22:38:57 UTC
Created attachment 268961 [details] [review]
Add support for pretty hostnames

Read and parse /etc/machine-info to obtain a pretty human readable
hostname (eg. "Bob's Laptop" instead of "bob-laptop"). If the
file is not found, or it can't be parsed, we fall back on the
normal hostname.

In GNOME, the pretty hostname can be configured in the control
center details and sharing panels. In other systems, it can be
changed using "hostnamectl --pretty".
Comment 4 Jens Georg 2014-02-13 07:40:05 UTC
Review of attachment 268961 [details] [review]:

+1
Comment 5 Giovanni Campagna 2014-02-13 14:15:07 UTC
Attachment 268961 [details] pushed as 93cc069 - Add support for pretty hostnames