[evolution] [ESourceSelector] A performance improvement



commit 5cc855e2be8f515cad5389ea865a8a2b8b74578c
Author: Milan Crha <mcrha redhat com>
Date:   Fri Jan 24 17:48:28 2014 +0100

    [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.

 e-util/e-source-selector.c |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/e-util/e-source-selector.c b/e-util/e-source-selector.c
index 1d8da29..43c6d45 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);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]