Patch: small renderer optimisation
- From: Jose Dapena Paz <jdapena igalia com>
- To: tinymail-devel-list <tinymail-devel-list gnome org>
- Subject: Patch: small renderer optimisation
- Date: Fri, 21 Dec 2007 20:23:24 +0100
Hi,
This is a small (but effective in some degree) optimisation of the
folder store. As we get a lot of updates on folder store, it's good to
reduce the overhead on it.
And it's not increasing the complexity of code.
--
Jose Dapena Paz <jdapena igalia com>
Igalia
Index: libtinymailui-gtk/tny-gtk-folder-store-tree-model.c
===================================================================
--- libtinymailui-gtk/tny-gtk-folder-store-tree-model.c (revision 3176)
+++ libtinymailui-gtk/tny-gtk-folder-store-tree-model.c (working copy)
@@ -112,7 +112,6 @@
{
TnyIterator *iter;
TnyList *folders = tny_simple_list_new ();
- TnyGtkFolderStoreTreeModel *me = (TnyGtkFolderStoreTreeModel*) self;
/* TODO add error checking and reporting here */
tny_folder_store_get_folders (store, folders, self->query, NULL);
@@ -809,6 +808,7 @@
TnyFolderChange *change = user_data1;
TnyFolder *changed_folder = tny_folder_change_get_folder (change);
TnyFolderChangeChanged changed = tny_folder_change_get_changed (change);
+ GValue value = { 0, };
/* This updater will get the folder out of the model, compare with
* the changed_folder pointer, and if there's a match it will update
@@ -832,19 +832,21 @@
*/
+ gtk_tree_model_get_value (model, iter,
+ TNY_GTK_FOLDER_STORE_TREE_MODEL_TYPE_COLUMN, &value);
+ type = g_value_get_int (&value);
+ g_value_unset (&value);
- gtk_tree_model_get (model, iter,
- TNY_GTK_FOLDER_STORE_TREE_MODEL_TYPE_COLUMN,
- &type, -1);
-
if (type != TNY_FOLDER_TYPE_ROOT)
{
TnyFolder *folder;
gint unread, total;
- gtk_tree_model_get (model, iter,
- TNY_GTK_FOLDER_STORE_TREE_MODEL_INSTANCE_COLUMN,
- &folder, -1);
+ gtk_tree_model_get_value (model, iter,
+ TNY_GTK_FOLDER_STORE_TREE_MODEL_INSTANCE_COLUMN, &value);
+
+ folder = g_value_dup_object (&value);
+ g_value_unset (&value);
if (changed & TNY_FOLDER_CHANGE_CHANGED_ALL_COUNT)
total = tny_folder_change_get_new_all_count (change);
Index: ChangeLog
===================================================================
--- ChangeLog (revision 3176)
+++ ChangeLog (working copy)
@@ -1,3 +1,10 @@
+2007-12-21 Jose Dapena Paz <jdapena igalia com>
+
+ * Small speedup in TnyGtkFolderStoreTreeModel. We use
+ gtk_tree_model_get_value instead of gtk_tree_model_get
+ in updater () method.
+ * Removed some warnings.
+
2007-12-21 Felipe Erias Morandeira <femorandeira igalia com>
* libtinymail/tny-mime-part.[hc] : changed the signature of
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]