diff options
author | raveit65 <[email protected]> | 2018-01-15 19:23:16 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2018-01-25 12:23:55 +0100 |
commit | cbbf80cb0a395fca2ca39aa9812c6093c204435f (patch) | |
tree | b3dcea272a7d1984aa197b9d77700f92c2f87bb7 | |
parent | e174c0d04e08571e154136c545d5024ca1cfd26c (diff) | |
download | libmateweather-cbbf80cb0a395fca2ca39aa9812c6093c204435f.tar.bz2 libmateweather-cbbf80cb0a395fca2ca39aa9812c6093c204435f.tar.xz |
Revert "Start reducing weather spam by creating intial cut of weather_info_equal () function that will help apps determine if two WeatherInfo instances are 'the same' enough to not bother with a notification"
This reverts commit 97326e615fffaef92669dbe82c8955c2c2e2edda.
fixes clock-applet crashes
https://github.com/mate-desktop/libmateweather/issues/51
-rw-r--r-- | libmateweather/weather.c | 38 | ||||
-rw-r--r-- | libmateweather/weather.h | 2 |
2 files changed, 0 insertions, 40 deletions
diff --git a/libmateweather/weather.c b/libmateweather/weather.c index 71d43a4..8ffbfde 100644 --- a/libmateweather/weather.c +++ b/libmateweather/weather.c @@ -1656,41 +1656,3 @@ _weather_internal_check (void) g_assert (G_N_ELEMENTS (conditions_str) == PHENOMENON_LAST); g_assert (G_N_ELEMENTS (conditions_str[0]) == QUALIFIER_LAST); } - -/** - * weather_info_equal: - * @info1: WeatherInfo to compare - * @info2: WeatherInfo to compare - * - * Returns: gboolean indicating if the two info's are "equal" (i.e. basic - * weather attributes are the same) - */ - -gboolean -weather_info_equal (WeatherInfo *info1, WeatherInfo *info2) -{ - g_return_val_if_fail (info1 != NULL, FALSE); - g_return_val_if_fail (info2 != NULL, FALSE); - g_return_val_if_fail (info1->valid, FALSE); - g_return_val_if_fail (info2->valid, FALSE); - - /* - * This function is intended to be used to reduce notification spam. - * the idea is that unless there's a significant change to either - * temp, windspeed, or conditions, there's no need to issue a notification - * to the user. - */ - - if (info1->temp != info2->temp) - return FALSE; - if (info1->wind != info2->wind) - return FALSE; - if (info1->windspeed != info2->windspeed) - return FALSE; - if (info1->cond.significant != info2->cond.significant) - return FALSE; - if (info1->cond.phenomenon != info2->cond.phenomenon) - return FALSE; - - return TRUE; -} diff --git a/libmateweather/weather.h b/libmateweather/weather.h index d30b39f..204e095 100644 --- a/libmateweather/weather.h +++ b/libmateweather/weather.h @@ -176,8 +176,6 @@ gchar * weather_info_get_weather_summary(WeatherInfo *info); const gchar * weather_info_get_icon_name (WeatherInfo *info); gint weather_info_next_sun_event (WeatherInfo *info); -gboolean weather_info_equal (WeatherInfo *info1, WeatherInfo *info2); - /* values retrieving functions */ enum _WeatherWindDirection { |