aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-attachment.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2014-06-05 01:46:25 +0800
committerMilan Crha <mcrha@redhat.com>2014-06-05 01:46:25 +0800
commit2f3fbdd6c6ff42a6c71ebe1d1d78108affe59d0f (patch)
treefd60a103158c3cfdbbce197feca07d7fea008a3d /e-util/e-attachment.c
parent668745ff49d8f312c7d419a691cdab3e128ded06 (diff)
downloadgsoc2013-evolution-2f3fbdd6c6ff42a6c71ebe1d1d78108affe59d0f.tar
gsoc2013-evolution-2f3fbdd6c6ff42a6c71ebe1d1d78108affe59d0f.tar.gz
gsoc2013-evolution-2f3fbdd6c6ff42a6c71ebe1d1d78108affe59d0f.tar.bz2
gsoc2013-evolution-2f3fbdd6c6ff42a6c71ebe1d1d78108affe59d0f.tar.lz
gsoc2013-evolution-2f3fbdd6c6ff42a6c71ebe1d1d78108affe59d0f.tar.xz
gsoc2013-evolution-2f3fbdd6c6ff42a6c71ebe1d1d78108affe59d0f.tar.zst
gsoc2013-evolution-2f3fbdd6c6ff42a6c71ebe1d1d78108affe59d0f.zip
Ignore false GObject property change notifications
This is related to bug 698275, which did not cover all cases. The problem here is that the dconf can in certain situation claim that everything changed (path "/" changed), which GSettingsBinding propagates to a GObject property unconditionally and GObject's property setter (g_object_set_property()) also notifies about the property change unconditionally, despite the real descendant property setter properly checks for the value change. After all these false notifications a callback on "notify" signal is called and possibly an expensive operation is run. Checking whether the value really changed helps in performance, for which were added new e-util functions: e_signal_connect_notify() e_signal_connect_notify_after() e_signal_connect_notify_swapped() e_signal_connect_notify_object() which have the same prototype as their GLib counterparts, but they allow only "notify::..." signals and they test whether the value really changed before they call the registered callback.
Diffstat (limited to 'e-util/e-attachment.c')
-rw-r--r--e-util/e-attachment.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/e-util/e-attachment.c b/e-util/e-attachment.c
index 06018e8130..1ce400767d 100644
--- a/e-util/e-attachment.c
+++ b/e-util/e-attachment.c
@@ -33,6 +33,7 @@
#include "e-attachment-store.h"
#include "e-icon-factory.h"
#include "e-mktemp.h"
+#include "e-misc-utils.h"
#define E_ATTACHMENT_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE \
@@ -997,51 +998,51 @@ e_attachment_init (EAttachment *attachment)
g_mutex_init (&attachment->priv->property_lock);
g_mutex_init (&attachment->priv->idle_lock);
- g_signal_connect (
+ e_signal_connect_notify (
attachment, "notify::encrypted",
G_CALLBACK (attachment_update_icon_column), NULL);
- g_signal_connect (
+ e_signal_connect_notify (
attachment, "notify::file-info",
G_CALLBACK (attachment_update_file_info_columns), NULL);
- g_signal_connect (
+ e_signal_connect_notify (
attachment, "notify::file-info",
G_CALLBACK (attachment_update_icon_column), NULL);
- g_signal_connect (
+ e_signal_connect_notify (
attachment, "notify::loading",
G_CALLBACK (attachment_update_icon_column), NULL);
- g_signal_connect (
+ e_signal_connect_notify (
attachment, "notify::loading",
G_CALLBACK (attachment_update_progress_columns), NULL);
- g_signal_connect (
+ e_signal_connect_notify (
attachment, "notify::percent",
G_CALLBACK (attachment_update_progress_columns), NULL);
- g_signal_connect (
+ e_signal_connect_notify (
attachment, "notify::reference",
G_CALLBACK (attachment_update_file_info_columns), NULL);
- g_signal_connect (
+ e_signal_connect_notify (
attachment, "notify::reference",
G_CALLBACK (attachment_update_icon_column), NULL);
- g_signal_connect (
+ e_signal_connect_notify (
attachment, "notify::reference",
G_CALLBACK (attachment_update_progress_columns), NULL);
- g_signal_connect (
+ e_signal_connect_notify (
attachment, "notify::saving",
G_CALLBACK (attachment_update_icon_column), NULL);
- g_signal_connect (
+ e_signal_connect_notify (
attachment, "notify::saving",
G_CALLBACK (attachment_update_progress_columns), NULL);
- g_signal_connect (
+ e_signal_connect_notify (
attachment, "notify::signed",
G_CALLBACK (attachment_update_icon_column), NULL);