gchar *fname = NULL;
const gchar *account_id = NULL;
gint unread = 0;
+ gboolean has_children;
rendobj = G_OBJECT(renderer);
gtk_tree_model_get (tree_model, iter,
TNY_GTK_FOLDER_STORE_TREE_MODEL_UNREAD_COLUMN, &unread,
TNY_GTK_FOLDER_STORE_TREE_MODEL_INSTANCE_COLUMN, &instance,
-1);
+ has_children = gtk_tree_model_iter_has_child (tree_model, iter);
if (!fname)
return;
/* Set pixbuf */
g_object_set (rendobj, "pixbuf", pixbuf, NULL);
+ if (has_children && (pixbuf != NULL)) {
+ GdkPixbuf *open_pixbuf, *closed_pixbuf;
+ GdkPixbuf *open_emblem, *closed_emblem;
+ open_pixbuf = gdk_pixbuf_copy (pixbuf);
+ closed_pixbuf = gdk_pixbuf_copy (pixbuf);
+ open_emblem = modest_platform_get_icon ("qgn_list_gene_fldr_exp");
+ closed_emblem = modest_platform_get_icon ("qgn_list_gene_fldr_clp");
+
+ if (open_emblem) {
+ gdk_pixbuf_composite (open_emblem, open_pixbuf, 0, 0,
+ MIN (gdk_pixbuf_get_width (open_emblem),
+ gdk_pixbuf_get_width (open_pixbuf)),
+ MIN (gdk_pixbuf_get_height (open_emblem),
+ gdk_pixbuf_get_height (open_pixbuf)),
+ 0, 0, 1, 1, GDK_INTERP_NEAREST, 255);
+ g_object_set (rendobj, "pixbuf-expander-open", open_pixbuf, NULL);
+ g_object_unref (open_emblem);
+ }
+ if (closed_emblem) {
+ gdk_pixbuf_composite (closed_emblem, closed_pixbuf, 0, 0,
+ MIN (gdk_pixbuf_get_width (closed_emblem),
+ gdk_pixbuf_get_width (closed_pixbuf)),
+ MIN (gdk_pixbuf_get_height (closed_emblem),
+ gdk_pixbuf_get_height (closed_pixbuf)),
+ 0, 0, 1, 1, GDK_INTERP_NEAREST, 255);
+ g_object_set (rendobj, "pixbuf-expander-closed", closed_pixbuf, NULL);
+ g_object_unref (closed_emblem);
+ }
+ if (closed_pixbuf)
+ g_object_unref (closed_pixbuf);
+ if (open_pixbuf)
+ g_object_unref (open_pixbuf);
+ }
if (pixbuf != NULL)
g_object_unref (pixbuf);
/* Current folder was unselected */
if (priv->cur_folder_store) {
if (TNY_IS_FOLDER(priv->cur_folder_store))
- tny_folder_sync (TNY_FOLDER(priv->cur_folder_store), FALSE, NULL);
+ tny_folder_sync_async (TNY_FOLDER(priv->cur_folder_store), FALSE, NULL, NULL, NULL);
/* FALSE --> don't expunge the messages */
g_signal_emit (G_OBJECT(tree_view), signals[FOLDER_SELECTION_CHANGED_SIGNAL], 0,
static gint
get_cmp_subfolder_type_pos (TnyFolderType t)
{
- /* Outbox, Drafts, Sent, User */
- /* 0, 1, 2, 3 */
+ /* Inbox, Outbox, Drafts, Sent, User */
+ /* 0, 1, 2, 3, 4 */
switch (t) {
- case TNY_FOLDER_TYPE_OUTBOX:
+ case TNY_FOLDER_TYPE_INBOX:
return 0;
break;
- case TNY_FOLDER_TYPE_DRAFTS:
+ case TNY_FOLDER_TYPE_OUTBOX:
return 1;
break;
- case TNY_FOLDER_TYPE_SENT:
+ case TNY_FOLDER_TYPE_DRAFTS:
return 2;
break;
- default:
+ case TNY_FOLDER_TYPE_SENT:
return 3;
+ break;
+ default:
+ return 4;
}
}
cmp = modest_text_utils_utf8_strcmp (name1, name2, TRUE);
}
} else {
- GtkTreeIter parent;
- gboolean has_parent;
gint cmp1 = 0, cmp2 = 0;
/* get the parent to know if it's a local folder */
+
+ GtkTreeIter parent;
+ gboolean has_parent;
has_parent = gtk_tree_model_iter_parent (tree_model, &parent, iter1);
if (has_parent) {
GObject *parent_folder;
}
g_object_unref (parent_folder);
}
+
+ /* if they are not local folders */
+ if (cmp1 == cmp2) {
+ cmp1 = get_cmp_subfolder_type_pos (tny_folder_get_folder_type (TNY_FOLDER (folder1)));
+ cmp2 = get_cmp_subfolder_type_pos (tny_folder_get_folder_type (TNY_FOLDER (folder2)));
+ }
+
if (cmp1 == cmp2)
cmp = modest_text_utils_utf8_strcmp (name1, name2, TRUE);
else