[recipes] Cosmetic fixes
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [recipes] Cosmetic fixes
- Date: Thu, 11 May 2017 02:54:38 +0000 (UTC)
commit b55f185ce1ce368376ed94858862d020af018176
Author: Matthias Clasen <mclasen redhat com>
Date: Wed May 10 22:42:26 2017 -0400
Cosmetic fixes
data/org.gnome.Recipes.gschema.xml | 3 ++-
src/gr-recipe-formatter.c | 17 +++++++----------
2 files changed, 9 insertions(+), 11 deletions(-)
---
diff --git a/data/org.gnome.Recipes.gschema.xml b/data/org.gnome.Recipes.gschema.xml
index ad32a99..c822a6d 100644
--- a/data/org.gnome.Recipes.gschema.xml
+++ b/data/org.gnome.Recipes.gschema.xml
@@ -73,7 +73,8 @@
<default>'locale'</default>
<summary>The setting for which unit temperatures should be displayed in. </summary>
<description>
- The setting for which unit temperatures should be displayed in. Default is celsius.
+ The setting for which unit temperatures should be displayed in. Default is 'locale',
+ which means to use the LC_MEASUREMENT category of the current locale to decide.
</description>
</key>
diff --git a/src/gr-recipe-formatter.c b/src/gr-recipe-formatter.c
index 0de372c..0299562 100644
--- a/src/gr-recipe-formatter.c
+++ b/src/gr-recipe-formatter.c
@@ -44,25 +44,22 @@ static gint
get_temperature_unit (void)
{
gint unit;
- const gchar *fmt;
-
- GSettings *settings = gr_settings_get();
- unit = g_settings_get_enum (settings, "temperature-unit");
- if (unit == GR_TEMPERATURE_UNIT_CELSIUS || unit == GR_TEMPERATURE_UNIT_FAHRENHEIT) {
- ;}
- else if (unit == GR_TEMPERATURE_UNIT_LOCALE) {
-
+ GSettings *settings = gr_settings_get ();
+ unit = g_settings_get_enum (settings, "temperature-unit");
+ if (unit == GR_TEMPERATURE_UNIT_LOCALE) {
+ const gchar *fmt;
fmt = nl_langinfo (_NL_MEASUREMENT_MEASUREMENT);
if (fmt && *fmt == 2)
unit = GR_TEMPERATURE_UNIT_FAHRENHEIT;
else
unit = GR_TEMPERATURE_UNIT_CELSIUS;
- }
- return unit;
}
+ return unit;
+}
+
char *
gr_recipe_format (GrRecipe *recipe)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]