[evolution/gnome-3-8] Add e_source_selector_update_all_rows().



commit e2988440bbb5b7616e8067e53c08e65d16b05fbb
Author: Matthew Barnes <mbarnes redhat com>
Date:   Mon Jun 10 10:25:00 2013 -0400

    Add e_source_selector_update_all_rows().
    
    Calls e_source_selector_update_row() for each ESource being shown
    by the ESourceSelector, according to the "extension-name" property.
    
    (cherry picked from commit ab42fdc8c751622e3239d43e793f06e8b6703bf7)

 doc/reference/libeutil/libeutil-sections.txt |    1 +
 e-util/e-source-selector.c                   |   31 ++++++++++++++++++++++++++
 e-util/e-source-selector.h                   |    2 +
 3 files changed, 34 insertions(+), 0 deletions(-)
---
diff --git a/doc/reference/libeutil/libeutil-sections.txt b/doc/reference/libeutil/libeutil-sections.txt
index 53743cc..f2ea822 100644
--- a/doc/reference/libeutil/libeutil-sections.txt
+++ b/doc/reference/libeutil/libeutil-sections.txt
@@ -3194,6 +3194,7 @@ e_source_selector_ref_source_by_iter
 e_source_selector_ref_source_by_path
 e_source_selector_queue_write
 e_source_selector_update_row
+e_source_selector_update_all_rows
 <SUBSECTION Standard>
 E_SOURCE_SELECTOR
 E_IS_SOURCE_SELECTOR
diff --git a/e-util/e-source-selector.c b/e-util/e-source-selector.c
index 07a3754..e84566d 100644
--- a/e-util/e-source-selector.c
+++ b/e-util/e-source-selector.c
@@ -2132,3 +2132,34 @@ e_source_selector_update_row (ESourceSelector *selector,
        }
 }
 
+/**
+ * e_source_selector_update_all_rows:
+ * @selector: an #ESourceSelector
+ *
+ * Calls e_source_selector_update_row() for each #ESource being shown by
+ * @selector, according to the #ESourceSelector:extension_name property.
+ *
+ * Since: 3.10
+ **/
+void
+e_source_selector_update_all_rows (ESourceSelector *selector)
+{
+       ESourceRegistry *registry;
+       GList *list, *link;
+       const gchar *extension_name;
+
+       g_return_if_fail (E_IS_SOURCE_SELECTOR (selector));
+
+       registry = e_source_selector_get_registry (selector);
+       extension_name = e_source_selector_get_extension_name (selector);
+
+       list = e_source_registry_list_sources (registry, extension_name);
+
+       for (link = list; link != NULL; link = g_list_next (link)) {
+               ESource *source = E_SOURCE (link->data);
+               e_source_selector_update_row (selector, source);
+       }
+
+       g_list_free_full (list, (GDestroyNotify) g_object_unref);
+}
+
diff --git a/e-util/e-source-selector.h b/e-util/e-source-selector.h
index b49d65a..949c94b 100644
--- a/e-util/e-source-selector.h
+++ b/e-util/e-source-selector.h
@@ -140,6 +140,8 @@ void                e_source_selector_queue_write   (ESourceSelector *selector,
                                                 ESource *source);
 void           e_source_selector_update_row    (ESourceSelector *selector,
                                                 ESource *source);
+void           e_source_selector_update_all_rows
+                                               (ESourceSelector *selector);
 
 G_END_DECLS
 


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