diff options
author | Scott Balneaves <[email protected]> | 2017-03-29 15:31:56 -0500 |
---|---|---|
committer | raveit65 <[email protected]> | 2017-07-23 14:55:15 +0200 |
commit | 109a7fa77bb4745524eca8a0735b210b55b81fe0 (patch) | |
tree | 86696f58a2e6f0625b125f040f24eb9b6cd7fef0 /mateweather/mateweather-applet.c | |
parent | b5e5639f43d2a7aae2c9dfa74f03992ca1cbd2e1 (diff) | |
download | mate-applets-109a7fa77bb4745524eca8a0735b210b55b81fe0.tar.bz2 mate-applets-109a7fa77bb4745524eca8a0735b210b55b81fe0.tar.xz |
Added logic to not send notification if weather update is equal (as decided by weather_info_equal ()) to the previous update
Diffstat (limited to 'mateweather/mateweather-applet.c')
-rw-r--r-- | mateweather/mateweather-applet.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/mateweather/mateweather-applet.c b/mateweather/mateweather-applet.c index 88840803..cde3e62e 100644 --- a/mateweather/mateweather-applet.c +++ b/mateweather/mateweather-applet.c @@ -451,7 +451,8 @@ update_finish (WeatherInfo *info, gpointer data) place_widgets(gw_applet); #ifdef HAVE_LIBNOTIFY - if (gw_applet->mateweather_pref.show_notifications) + if (gw_applet->mateweather_pref.show_notifications && + !weather_info_equal(gw_applet->mateweather_previnfo, gw_applet->mateweather_info)) { NotifyNotification *n; @@ -491,6 +492,9 @@ update_finish (WeatherInfo *info, gpointer data) g_free (detail); } } + + weather_info_free (gw_applet->mateweather_previnfo); + gw_applet->mateweather_previnfo = weather_info_clone (gw_applet->mateweather_info); #endif } else @@ -547,4 +551,5 @@ void mateweather_update (MateWeatherApplet *gw_applet) &prefs, update_finish, gw_applet); } + } |