[evolution-rss] prefer folder info instead of folder object in display_folder_icon() It considerably speeds up the s
- From: Lucian Langa <lucilanga src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-rss] prefer folder info instead of folder object in display_folder_icon() It considerably speeds up the s
- Date: Sat, 30 Oct 2010 16:29:53 +0000 (UTC)
commit bba81d094e09c9e8f69816a43c6934907786712b
Author: Lucian Langa <lucilanga gnome org>
Date: Sat Oct 30 18:20:14 2010 +0300
prefer folder info instead of folder object in display_folder_icon()
It considerably speeds up the startup phase
src/rss-image.c | 22 ++++++++++------------
1 files changed, 10 insertions(+), 12 deletions(-)
---
diff --git a/src/rss-image.c b/src/rss-image.c
index 2c43f90..a46c979 100644
--- a/src/rss-image.c
+++ b/src/rss-image.c
@@ -402,7 +402,7 @@ display_folder_icon(GtkTreeStore *tree_store, gchar *key)
EMFolderTreeModel *mod = (EMFolderTreeModel *)tree_store;
struct _EMFolderTreeModelStoreInfo *si;
CamelStore *store = rss_component_peek_local_store();
- CamelFolder *rss_folder;
+ CamelFolderInfo *rssi;
gint i=0, size;
gint *sizes;
@@ -412,20 +412,22 @@ display_folder_icon(GtkTreeStore *tree_store, gchar *key)
if (pixbuf) {
gchar *name = g_hash_table_lookup(rf->hrname_r, key);
- gchar *full_name = g_strdup_printf(
- "%s" G_DIR_SEPARATOR_S "%s",
+ gchar *full_name = g_build_path(
+ G_DIR_SEPARATOR_S,
get_main_folder(),
- lookup_feed_folder(name));
+ lookup_feed_folder(name),
+ NULL);
+/*folder isn't created yet?*/
#if (DATASERVER_VERSION >= 2033001)
- rss_folder = camel_store_get_folder_sync (
+ rssi = camel_store_get_folder_info_sync (
store,
full_name, 0, NULL, NULL);
#else
- rss_folder = camel_store_get_folder (
+ rssi = camel_store_get_folder_info (
store,
full_name, 0, NULL);
#endif
- if (!rss_folder) {
+ if (!rssi) {
g_free(full_name);
result = FALSE;
goto out;
@@ -462,11 +464,7 @@ display_folder_icon(GtkTreeStore *tree_store, gchar *key)
COL_STRING_ICON_NAME, key,
-1);
g_free(full_name);
-#if (DATASERVER_VERSION >= 2031001)
- g_object_unref (rss_folder);
-#else
- camel_object_unref (rss_folder);
-#endif
+ camel_store_free_folder_info (store, rssi);
g_object_unref(pixbuf);
result = TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]