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 705456 - Uniformize usage of gsettings key
Uniformize usage of gsettings key
Status: RESOLVED FIXED
Product: system-monitor
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: System-monitor maintainers
System-monitor maintainers
Depends on:
Blocks:
 
 
Reported: 2013-08-04 17:28 UTC by Stefano Facchini
Modified: 2013-08-05 21:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Consistently use #defines to identify gsettings keys (35.62 KB, patch)
2013-08-05 10:35 UTC, Stefano Facchini
committed Details | Review

Description Stefano Facchini 2013-08-04 17:28:45 UTC
Currently gsettings key are mostly referred to by writing directly the corresponding name, i.e.

  g_settings_get (settings, "key-name");

while four of them are defined in settings-key.{h,cpp} for no apparent reason (solaris_mode, draw_stacked, open_files_tree_prefix, network_in_bits).

I'd say, all keys should be treated on an equal footing. The simplest thing is drop settings-key.* and just use "key-name" for all of them. Alternatively, if we want to keep symbolic names (which could be a good idea since we would get compiler errors on typos), then I'd prefer just going with simple macros like

#define GSM_SETTING_CURRENT_TAB "current-tab"

What do you think?
Comment 1 Robert Roth 2013-08-04 17:55:36 UTC
I have also seen that settings-key.{cpp,h} might need either dropping or updating, but dropping sounds better, and use #define instead. So we should go for that.
Comment 2 Stefano Facchini 2013-08-05 10:35:16 UTC
Created attachment 250842 [details] [review]
Consistently use #defines to identify gsettings keys
Comment 3 Robert Roth 2013-08-05 21:25:47 UTC
Attachment 250842 [details] pushed as b4f345c - Consistently use #defines to identify gsettings keys