aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2014-01-25 00:48:28 +0800
committerMilan Crha <mcrha@redhat.com>2014-01-25 00:48:28 +0800
commit5cc855e2be8f515cad5389ea865a8a2b8b74578c (patch)
treeb23c3cc4212cae9ab43ae2a107c3bc6fffeb3a20
parent83ddf07ee832410c70c57f5a1c0a5942bccbb351 (diff)
downloadgsoc2013-evolution-5cc855e2be8f515cad5389ea865a8a2b8b74578c.tar
gsoc2013-evolution-5cc855e2be8f515cad5389ea865a8a2b8b74578c.tar.gz
gsoc2013-evolution-5cc855e2be8f515cad5389ea865a8a2b8b74578c.tar.bz2
gsoc2013-evolution-5cc855e2be8f515cad5389ea865a8a2b8b74578c.tar.lz
gsoc2013-evolution-5cc855e2be8f515cad5389ea865a8a2b8b74578c.tar.xz
gsoc2013-evolution-5cc855e2be8f515cad5389ea865a8a2b8b74578c.tar.zst
gsoc2013-evolution-5cc855e2be8f515cad5389ea865a8a2b8b74578c.zip
[ESourceSelector] A performance improvement
A simple performance improvement to ignore ESourceRegistry notifications on source changes for sources which do not belong to the ESourceSelector. Such notifications could cause whole model rebuild, which has other side effects, like a bug #722399.
-rw-r--r--e-util/e-source-selector.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/e-util/e-source-selector.c b/e-util/e-source-selector.c
index 1d8da2930f..43c6d453bd 100644
--- a/e-util/e-source-selector.c
+++ b/e-util/e-source-selector.c
@@ -445,6 +445,12 @@ source_selector_source_added_cb (ESourceRegistry *registry,
ESource *source,
ESourceSelector *selector)
{
+ const gchar *extension_name;
+
+ extension_name = e_source_selector_get_extension_name (selector);
+ if (!extension_name || !e_source_has_extension (source, extension_name))
+ return;
+
source_selector_build_model (selector);
source_selector_expand_to_source (selector, source);
@@ -455,6 +461,12 @@ source_selector_source_changed_cb (ESourceRegistry *registry,
ESource *source,
ESourceSelector *selector)
{
+ const gchar *extension_name;
+
+ extension_name = e_source_selector_get_extension_name (selector);
+ if (!extension_name || !e_source_has_extension (source, extension_name))
+ return;
+
source_selector_cancel_write (selector, source);
e_source_selector_update_row (selector, source);
@@ -465,6 +477,12 @@ source_selector_source_removed_cb (ESourceRegistry *registry,
ESource *source,
ESourceSelector *selector)
{
+ const gchar *extension_name;
+
+ extension_name = e_source_selector_get_extension_name (selector);
+ if (!extension_name || !e_source_has_extension (source, extension_name))
+ return;
+
source_selector_build_model (selector);
}
@@ -473,6 +491,12 @@ source_selector_source_enabled_cb (ESourceRegistry *registry,
ESource *source,
ESourceSelector *selector)
{
+ const gchar *extension_name;
+
+ extension_name = e_source_selector_get_extension_name (selector);
+ if (!extension_name || !e_source_has_extension (source, extension_name))
+ return;
+
source_selector_build_model (selector);
source_selector_expand_to_source (selector, source);
@@ -483,6 +507,12 @@ source_selector_source_disabled_cb (ESourceRegistry *registry,
ESource *source,
ESourceSelector *selector)
{
+ const gchar *extension_name;
+
+ extension_name = e_source_selector_get_extension_name (selector);
+ if (!extension_name || !e_source_has_extension (source, extension_name))
+ return;
+
source_selector_build_model (selector);
}