[evolution-groupwise] 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-groupwise] Do not call g_object_notify() when property didn't change
- Date: Mon, 18 Jun 2012 16:23:51 +0000 (UTC)
commit c9f75f257433f0357c726c397e12b56780fccf09
Author: Milan Crha <mcrha redhat com>
Date: Mon Jun 18 18:23:36 2012 +0200
Do not call g_object_notify() when property didn't change
src/camel/camel-groupwise-settings.c | 12 ++++++++++++
src/camel/imapx/camel-gwimap-settings.c | 3 +++
2 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/camel/camel-groupwise-settings.c b/src/camel/camel-groupwise-settings.c
index f479864..2fff988 100644
--- a/src/camel/camel-groupwise-settings.c
+++ b/src/camel/camel-groupwise-settings.c
@@ -312,6 +312,9 @@ camel_groupwise_settings_set_check_all (CamelGroupwiseSettings *settings,
{
g_return_if_fail (CAMEL_IS_GROUPWISE_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");
@@ -331,6 +334,9 @@ camel_groupwise_settings_set_filter_junk (CamelGroupwiseSettings *settings,
{
g_return_if_fail (CAMEL_IS_GROUPWISE_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");
@@ -350,6 +356,9 @@ camel_groupwise_settings_set_filter_junk_inbox (CamelGroupwiseSettings *settings
{
g_return_if_fail (CAMEL_IS_GROUPWISE_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");
@@ -372,6 +381,9 @@ camel_groupwise_settings_set_soap_port (CamelGroupwiseSettings *settings,
{
g_return_if_fail (CAMEL_IS_GROUPWISE_SETTINGS (settings));
+ if (g_strcmp0 (settings->priv->soap_port, soap_port) == 0)
+ return;
+
g_free (settings->priv->soap_port);
if (atoi (soap_port))
settings->priv->soap_port = g_strdup (soap_port);
diff --git a/src/camel/imapx/camel-gwimap-settings.c b/src/camel/imapx/camel-gwimap-settings.c
index 5e4055b..4052005 100644
--- a/src/camel/imapx/camel-gwimap-settings.c
+++ b/src/camel/imapx/camel-gwimap-settings.c
@@ -133,6 +133,9 @@ camel_gwimap_settings_set_soap_port (CamelGwImapSettings *settings,
{
g_return_if_fail (CAMEL_IS_GWIMAP_SETTINGS (settings));
+ if (g_strcmp0 (settings->priv->soap_port, soap_port) == 0)
+ return;
+
g_free (settings->priv->soap_port);
if (atoi (soap_port))
settings->priv->soap_port = g_strdup (soap_port);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]