[evolution-data-server] Bug #659736 - Do not report change on property set when not changed
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Bug #659736 - Do not report change on property set when not changed
- Date: Thu, 10 Nov 2011 16:32:18 +0000 (UTC)
commit 208ae96fc848d15f93415dea2d5ba16e52e2767a
Author: Milan Crha <mcrha redhat com>
Date: Thu Nov 10 17:31:23 2011 +0100
Bug #659736 - Do not report change on property set when not changed
libedataserver/e-source-group.c | 6 ++++++
libedataserver/e-source.c | 7 +++++++
2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/libedataserver/e-source-group.c b/libedataserver/e-source-group.c
index 277a724..d4a5835 100644
--- a/libedataserver/e-source-group.c
+++ b/libedataserver/e-source-group.c
@@ -975,10 +975,16 @@ e_source_group_set_property (ESourceGroup *source_group,
const gchar *value)
{
ESourceGroupPrivate *priv;
+ const gchar *old_value;
g_return_if_fail (E_IS_SOURCE_GROUP (source_group));
priv = source_group->priv;
+ old_value = g_hash_table_lookup (priv->properties, property);
+
+ if (g_strcmp0 (old_value, value) == 0)
+ return;
+
if (value)
g_hash_table_replace (priv->properties, g_strdup (property), g_strdup (value));
else
diff --git a/libedataserver/e-source.c b/libedataserver/e-source.c
index 4754615..2552849 100644
--- a/libedataserver/e-source.c
+++ b/libedataserver/e-source.c
@@ -1151,9 +1151,16 @@ e_source_set_property (ESource *source,
const gchar *property_name,
const gchar *property_value)
{
+ const gchar *old_value;
+
g_return_if_fail (E_IS_SOURCE (source));
g_return_if_fail (property_name != NULL);
+ old_value = g_hash_table_lookup (source->priv->properties, property_name);
+
+ if (g_strcmp0 (old_value, property_value) == 0)
+ return;
+
if (property_value != NULL)
g_hash_table_replace (
source->priv->properties,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]