Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Lachu:SystemServices
PackageKit
n-0002-pk-client-Avoid-spurious-GObject-notify-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File n-0002-pk-client-Avoid-spurious-GObject-notify-signal-emiss.patch of Package PackageKit
From c32ae111760bb91b7f76b98deaefe060aae29c4c Mon Sep 17 00:00:00 2001 From: Philip Withnall <pwithnall@endlessos.org> Date: Sat, 1 May 2021 01:05:01 +0100 Subject: [PATCH 002/102] pk-client: Avoid spurious GObject::notify signal emissions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the property value doesn’t actually change, there’s no need to emit the `notify` signal. Note that I didn’t see this happening in practice — this fix is only as a result of reading the code. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> diff --git a/lib/packagekit-glib2/pk-client.c b/lib/packagekit-glib2/pk-client.c index 48c33c8bf..13666b0a5 100644 --- a/lib/packagekit-glib2/pk-client.c +++ b/lib/packagekit-glib2/pk-client.c @@ -4744,6 +4744,10 @@ void pk_client_set_locale (PkClient *client, const gchar *locale) { g_return_if_fail (PK_IS_CLIENT (client)); + + if (g_strcmp0 (client->priv->locale, locale) == 0) + return; + client->priv->locale = g_strdup (locale); g_object_notify (G_OBJECT (client), "locale"); } @@ -4780,6 +4784,10 @@ void pk_client_set_background (PkClient *client, gboolean background) { g_return_if_fail (PK_IS_CLIENT (client)); + + if (client->priv->background == background) + return; + client->priv->background = background; g_object_notify (G_OBJECT (client), "background"); } @@ -4815,6 +4823,10 @@ void pk_client_set_interactive (PkClient *client, gboolean interactive) { g_return_if_fail (PK_IS_CLIENT (client)); + + if (client->priv->interactive == interactive) + return; + client->priv->interactive = interactive; g_object_notify (G_OBJECT (client), "interactive"); } @@ -4866,6 +4878,10 @@ void pk_client_set_cache_age (PkClient *client, guint cache_age) { g_return_if_fail (PK_IS_CLIENT (client)); + + if (client->priv->cache_age == cache_age) + return; + client->priv->cache_age = cache_age; g_object_notify (G_OBJECT (client), "cache-age"); } -- 2.35.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor