aboutsummaryrefslogtreecommitdiffstats
path: root/composer
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-06-24 00:30:36 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-06-30 00:42:32 +0800
commit54e056e2ddd661e589ccbc31b3faa2999631175e (patch)
tree42c18758598ee6f6973800ddff890a3cc56424e3 /composer
parentaa1c135937b7c533ff8b599cf6009a4507afb51c (diff)
downloadgsoc2013-evolution-54e056e2ddd661e589ccbc31b3faa2999631175e.tar
gsoc2013-evolution-54e056e2ddd661e589ccbc31b3faa2999631175e.tar.gz
gsoc2013-evolution-54e056e2ddd661e589ccbc31b3faa2999631175e.tar.bz2
gsoc2013-evolution-54e056e2ddd661e589ccbc31b3faa2999631175e.tar.lz
gsoc2013-evolution-54e056e2ddd661e589ccbc31b3faa2999631175e.tar.xz
gsoc2013-evolution-54e056e2ddd661e589ccbc31b3faa2999631175e.tar.zst
gsoc2013-evolution-54e056e2ddd661e589ccbc31b3faa2999631175e.zip
Postpone ENameSelector loading as much as possible
Also fixes few memory leaks around ENameSelector and cancels loading of its address books when not needed any more.
Diffstat (limited to 'composer')
-rw-r--r--composer/e-composer-header-table.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/composer/e-composer-header-table.c b/composer/e-composer-header-table.c
index 78404a62e7..c87abcf307 100644
--- a/composer/e-composer-header-table.c
+++ b/composer/e-composer-header-table.c
@@ -825,6 +825,7 @@ composer_header_table_dispose (GObject *object)
}
if (priv->name_selector != NULL) {
+ e_name_selector_cancel_loading (priv->name_selector);
g_object_unref (priv->name_selector);
priv->name_selector = NULL;
}
@@ -991,6 +992,17 @@ e_composer_header_table_class_init (EComposerHeaderTableClass *class)
}
static void
+composer_header_table_realize_cb (EComposerHeaderTable *table)
+{
+ g_return_if_fail (table != NULL);
+ g_return_if_fail (table->priv != NULL);
+
+ g_signal_handlers_disconnect_by_func (table, composer_header_table_realize_cb, NULL);
+
+ e_name_selector_load_books (table->priv->name_selector);
+}
+
+static void
e_composer_header_table_init (EComposerHeaderTable *table)
{
EComposerHeader *header;
@@ -1064,6 +1076,9 @@ e_composer_header_table_init (EComposerHeaderTable *table)
header->input_widget, "visible",
G_BINDING_SYNC_CREATE);
}
+
+ /* postpone name_selector loading, do that only when really needed */
+ g_signal_connect (table, "realize", G_CALLBACK (composer_header_table_realize_cb), NULL);
}
GtkWidget *