[gnome-software] Don't emit notify if the quirks are unchanged



commit 3c2776d9031c04c9b728687214cc5e868cfd6812
Author: Richard Hughes <richard hughsie com>
Date:   Thu Sep 27 15:11:30 2018 +0100

    Don't emit notify if the quirks are unchanged

 lib/gs-app.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/lib/gs-app.c b/lib/gs-app.c
index 805c6894..c40564bb 100644
--- a/lib/gs-app.c
+++ b/lib/gs-app.c
@@ -3882,6 +3882,10 @@ gs_app_add_quirk (GsApp *app, AsAppQuirk quirk)
        g_autoptr(GMutexLocker) locker = NULL;
        g_return_if_fail (GS_IS_APP (app));
 
+       /* same */
+       if ((priv->quirk & quirk) > 0)
+               return;
+
        locker = g_mutex_locker_new (&priv->mutex);
        priv->quirk |= quirk;
        gs_app_queue_notify (app, "quirk");
@@ -3903,6 +3907,10 @@ gs_app_remove_quirk (GsApp *app, AsAppQuirk quirk)
        g_autoptr(GMutexLocker) locker = NULL;
        g_return_if_fail (GS_IS_APP (app));
 
+       /* same */
+       if ((priv->quirk & quirk) == 0)
+               return;
+
        locker = g_mutex_locker_new (&priv->mutex);
        priv->quirk &= ~quirk;
        gs_app_queue_notify (app, "quirk");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]