This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository enlightenment-module-forecasts.
View the commit online.
commit ecdab2d699f564280b12d3fdf145feb37bae8ebf
Author: Alastair Poole <nets...@gmail.com>
AuthorDate: Thu Apr 24 23:08:19 2025 +0100
forecast: fix popup.
Popup code didn't check values.
---
src/e_mod_main.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/src/e_mod_main.c b/src/e_mod_main.c
index d093b65..7e1fb38 100644
--- a/src/e_mod_main.c
+++ b/src/e_mod_main.c
@@ -1050,13 +1050,19 @@ _forecasts_popup_content_create(Instance *inst)
lb = _lb_add(base, D_("High"));
elm_table_pack(tb, lb, 0, 1, 1, 1);
- snprintf(buf, sizeof(buf), "%d°%c", inst->forecast[0].high, inst->units.temp);
+ if (inst->forecast[0].high != TEMP_MIN_OUT_OF_RANGE && inst->forecast[0].high != TEMP_MAX_OUT_OF_RANGE)
+ snprintf(buf, sizeof(buf), "%d°%c", inst->forecast[0].high, inst->units.temp);
+ else
+ snprintf(buf, sizeof(buf), D_("N/A"));
lb = _lb_add(base, buf);
elm_table_pack(tb, lb, 0, 2, 1, 1);
lb = _lb_add(base, D_("Low"));
elm_table_pack(tb, lb, 1, 1, 1, 1);
- snprintf(buf, sizeof(buf), "%d°%c", inst->forecast[0].low, inst->units.temp);
+ if (inst->forecast[0].low != TEMP_MIN_OUT_OF_RANGE && inst->forecast[0].low != TEMP_MAX_OUT_OF_RANGE)
+ snprintf(buf, sizeof(buf), "%d°%c", inst->forecast[0].low, inst->units.temp);
+ else
+ snprintf(buf, sizeof(buf), D_("N/A"));
lb = _lb_add(base, buf);
elm_table_pack(tb, lb, 1, 2, 1, 1);
elm_box_pack_end(hbx, fr);
@@ -1083,13 +1089,19 @@ _forecasts_popup_content_create(Instance *inst)
lb = _lb_add(base, D_("High"));
elm_table_pack(tb, lb, 0, 1, 1, 1);
- snprintf(buf, sizeof(buf), "%d°%c", inst->forecast[1].high, inst->units.temp);
+ if (inst->forecast[1].high != TEMP_MIN_OUT_OF_RANGE && inst->forecast[1].high != TEMP_MAX_OUT_OF_RANGE)
+ snprintf(buf, sizeof(buf), "%d°%c", inst->forecast[1].high, inst->units.temp);
+ else
+ snprintf(buf, sizeof(buf), D_("N/A"));
lb = _lb_add(base, buf);
elm_table_pack(tb, lb, 0, 2, 1, 1);
lb = _lb_add(base, D_("Low"));
elm_table_pack(tb, lb, 1, 1, 1, 1);
- snprintf(buf, sizeof(buf), "%d°%c", inst->forecast[1].low, inst->units.temp);
+ if (inst->forecast[1].low != TEMP_MIN_OUT_OF_RANGE && inst->forecast[1].low != TEMP_MAX_OUT_OF_RANGE)
+ snprintf(buf, sizeof(buf), "%d°%c", inst->forecast[1].low, inst->units.temp);
+ else
+ snprintf(buf, sizeof(buf), D_("N/A"));
lb = _lb_add(base, buf);
elm_table_pack(tb, lb, 1, 2, 1, 1);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.