[evolution-ews] Do not call g_object_notify() when property didn't change
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-ews] Do not call g_object_notify() when property didn't change
- Date: Mon, 18 Jun 2012 15:58:11 +0000 (UTC)
commit 7134beff8ec2b6bb74c868a3f100d69b5414d976
Author: Milan Crha <mcrha redhat com>
Date: Mon Jun 18 17:57:58 2012 +0200
Do not call g_object_notify() when property didn't change
src/server/camel-ews-settings.c | 37 +++++++++++++++++++++++++++++++++++++
src/server/e-source-ews-folder.c | 10 ++++++++++
2 files changed, 47 insertions(+), 0 deletions(-)
---
diff --git a/src/server/camel-ews-settings.c b/src/server/camel-ews-settings.c
index 681c05f..bc0efaa 100644
--- a/src/server/camel-ews-settings.c
+++ b/src/server/camel-ews-settings.c
@@ -476,6 +476,9 @@ camel_ews_settings_set_check_all (CamelEwsSettings *settings,
{
g_return_if_fail (CAMEL_IS_EWS_SETTINGS (settings));
+ if ((settings->priv->check_all ? 1 : 0) == (check_all ? 1 : 0))
+ return;
+
settings->priv->check_all = check_all;
g_object_notify (G_OBJECT (settings), "check-all");
@@ -515,6 +518,11 @@ camel_ews_settings_set_email (CamelEwsSettings *settings,
g_mutex_lock (settings->priv->property_lock);
+ if (g_strcmp0 (settings->priv->email, email) == 0) {
+ g_mutex_unlock (settings->priv->property_lock);
+ return;
+ }
+
g_free (settings->priv->email);
settings->priv->email = e_util_strdup_strip (email);
@@ -558,6 +566,9 @@ camel_ews_settings_set_filter_junk (CamelEwsSettings *settings,
{
g_return_if_fail (CAMEL_IS_EWS_SETTINGS (settings));
+ if ((settings->priv->filter_junk ? 1 : 0) == (filter_junk ? 1 : 0))
+ return;
+
settings->priv->filter_junk = filter_junk;
g_object_notify (G_OBJECT (settings), "filter-junk");
@@ -598,6 +609,9 @@ camel_ews_settings_set_filter_junk_inbox (CamelEwsSettings *settings,
{
g_return_if_fail (CAMEL_IS_EWS_SETTINGS (settings));
+ if ((settings->priv->filter_junk_inbox ? 1 : 0) == (filter_junk_inbox ? 1 : 0))
+ return;
+
settings->priv->filter_junk_inbox = filter_junk_inbox;
g_object_notify (G_OBJECT (settings), "filter-junk-inbox");
@@ -637,6 +651,11 @@ camel_ews_settings_set_gal_uid (CamelEwsSettings *settings,
g_mutex_lock (settings->priv->property_lock);
+ if (g_strcmp0 (settings->priv->gal_uid, gal_uid) == 0) {
+ g_mutex_unlock (settings->priv->property_lock);
+ return;
+ }
+
g_free (settings->priv->gal_uid);
settings->priv->gal_uid = e_util_strdup_strip (gal_uid);
@@ -679,6 +698,11 @@ camel_ews_settings_set_hosturl (CamelEwsSettings *settings,
g_mutex_lock (settings->priv->property_lock);
+ if (g_strcmp0 (settings->priv->hosturl, hosturl) == 0) {
+ g_mutex_unlock (settings->priv->property_lock);
+ return;
+ }
+
g_free (settings->priv->hosturl);
settings->priv->hosturl = e_util_strdup_strip (hosturl);
@@ -721,6 +745,11 @@ camel_ews_settings_set_oaburl (CamelEwsSettings *settings,
g_mutex_lock (settings->priv->property_lock);
+ if (g_strcmp0 (settings->priv->oaburl, oaburl) == 0) {
+ g_mutex_unlock (settings->priv->property_lock);
+ return;
+ }
+
g_free (settings->priv->oaburl);
settings->priv->oaburl = e_util_strdup_strip (oaburl);
@@ -743,6 +772,9 @@ camel_ews_settings_set_oab_offline (CamelEwsSettings *settings,
{
g_return_if_fail (CAMEL_IS_EWS_SETTINGS (settings));
+ if ((settings->priv->oab_offline ? 1 : 0) == (oab_offline ? 1 : 0))
+ return;
+
settings->priv->oab_offline = oab_offline;
g_object_notify (G_OBJECT (settings), "oab-offline");
@@ -782,6 +814,11 @@ camel_ews_settings_set_oal_selected (CamelEwsSettings *settings,
g_mutex_lock (settings->priv->property_lock);
+ if (g_strcmp0 (settings->priv->oal_selected, oal_selected) == 0) {
+ g_mutex_unlock (settings->priv->property_lock);
+ return;
+ }
+
g_free (settings->priv->oal_selected);
settings->priv->oal_selected = e_util_strdup_strip (oal_selected);
diff --git a/src/server/e-source-ews-folder.c b/src/server/e-source-ews-folder.c
index cb79f8b..7a632dc 100644
--- a/src/server/e-source-ews-folder.c
+++ b/src/server/e-source-ews-folder.c
@@ -202,6 +202,11 @@ e_source_ews_folder_set_change_key (ESourceEwsFolder *extension,
g_mutex_lock (extension->priv->property_lock);
+ if (g_strcmp0 (extension->priv->change_key, change_key) == 0) {
+ g_mutex_unlock (extension->priv->property_lock);
+ return;
+ }
+
g_free (extension->priv->change_key);
extension->priv->change_key = g_strdup (change_key);
@@ -244,6 +249,11 @@ e_source_ews_folder_set_id (ESourceEwsFolder *extension,
g_mutex_lock (extension->priv->property_lock);
+ if (g_strcmp0 (extension->priv->id, id) == 0) {
+ g_mutex_unlock (extension->priv->property_lock);
+ return;
+ }
+
g_free (extension->priv->id);
extension->priv->id = g_strdup (id);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]