buffer = g_string_append (buffer, *item_name);
if (concat_folder_name) {
- buffer = g_string_append (buffer, folder_name);
+ if (!is_special && folder_type == TNY_FOLDER_TYPE_DRAFTS) {
+ buffer = g_string_append (buffer, folder_name);
+ /* TODO: append a sensitive string to the remote drafts to
+ * be able to know it's the remote one */
+/* buffer = g_string_append (buffer, " (TODO:remote)"); */
+ } else {
+ buffer = g_string_append (buffer, folder_name);
+ }
}
g_free (*item_name);
g_object_unref (account);
/* Convert INBOX */
if (type == TNY_FOLDER_TYPE_INBOX &&
- !g_ascii_strcasecmp (fname, "Inbox")) {
+ g_str_has_suffix (fname, "Inbox")) {
g_free (item_name);
item_name = g_strdup (_("mcen_me_folder_inbox"));
}
{
ThreePixbufs *retval;
- if (!*pixbuf) {
+ if (pixbuf && !*pixbuf) {
GdkPixbuf *icon;
icon = modest_platform_get_icon (icon_code, FOLDER_ICON_SIZE);
if (icon) {
}
}
- if (!*pixbuf_open && pixbuf && *pixbuf)
+ if (pixbuf_open && !*pixbuf_open && pixbuf && *pixbuf)
*pixbuf_open = get_composite_pixbuf ("qgn_list_gene_fldr_exp",
FOLDER_ICON_SIZE,
*pixbuf);
- if (!*pixbuf_close && pixbuf && *pixbuf)
+ if (pixbuf_close && !*pixbuf_close && pixbuf && *pixbuf)
*pixbuf_close = get_composite_pixbuf ("qgn_list_gene_fldr_clp",
FOLDER_ICON_SIZE,
*pixbuf);
retval = g_slice_new0 (ThreePixbufs);
- if (*pixbuf)
+ if (pixbuf && *pixbuf)
retval->pixbuf = g_object_ref (*pixbuf);
- if (*pixbuf_open)
+ else
+ retval->pixbuf = NULL;
+ if (pixbuf_open && *pixbuf_open)
retval->pixbuf_open = g_object_ref (*pixbuf_open);
- if (*pixbuf_close)
+ else
+ retval->pixbuf_open = NULL;
+ if (pixbuf_close && *pixbuf_close)
retval->pixbuf_close = g_object_ref (*pixbuf_close);
+ else
+ retval->pixbuf_close = NULL;
return retval;
}
modest_folder_view_dispose (GObject *obj)
{
ModestFolderViewPrivate *priv;
+ GtkTreeModel *model = NULL;
priv = MODEST_FOLDER_VIEW_GET_PRIVATE (obj);
+ get_inner_models (MODEST_FOLDER_VIEW (obj),
+ NULL, NULL, &model);
+
#ifdef MODEST_TOOLKIT_HILDON2
if (priv->signal_handlers) {
modest_signal_mgr_disconnect_all_and_destroy (priv->signal_handlers);
g_object_unref (account);
}
- /* Get the accounts: */
- tny_account_store_get_accounts (TNY_ACCOUNT_STORE(account_store),
- TNY_LIST (model),
- TNY_ACCOUNT_STORE_STORE_ACCOUNTS);
+ if (priv->style == MODEST_FOLDER_VIEW_STYLE_SHOW_ALL) {
+ /* Get the accounts */
+ tny_account_store_get_accounts (TNY_ACCOUNT_STORE(account_store),
+ TNY_LIST (model),
+ TNY_ACCOUNT_STORE_STORE_ACCOUNTS);
+ } else {
+ if (priv->visible_account_id) {
+ TnyAccount *account;
+
+ /* Add local folders account */
+ account = modest_tny_account_store_get_local_folders_account ((ModestTnyAccountStore *) account_store);
+
+ if (account) {
+ tny_list_append (TNY_LIST (model), (GObject *) account);
+ g_object_unref (account);
+ }
+
+ account = modest_tny_account_store_get_mmc_folders_account ((ModestTnyAccountStore *) account_store);
+
+ if (account) {
+ tny_list_append (TNY_LIST (model), (GObject *) account);
+ g_object_unref (account);
+ }
+
+ /* Add visible account */
+ account = modest_tny_account_store_get_tny_account_by ((ModestTnyAccountStore *) account_store,
+ MODEST_TNY_ACCOUNT_STORE_QUERY_ID,
+ priv->visible_account_id);
+ if (account) {
+ tny_list_append (TNY_LIST (model), (GObject *) account);
+ g_object_unref (account);
+ } else {
+ g_warning ("You need to set an account first");
+ g_object_unref (model);
+ return FALSE;
+ }
+ } else {
+ g_warning ("You need to set an account first");
+ g_object_unref (model);
+ return FALSE;
+ }
+ }
sortable = gtk_tree_model_sort_new_with_model (model);
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE(sortable),
self,
NULL);
- GtkTreeModel *old_tny_model;
+ GtkTreeModel *old_tny_model = NULL;
if (get_inner_models (self, NULL, NULL, &old_tny_model)) {
if (priv->signal_handlers > 0) {
priv->signal_handlers = modest_signal_mgr_disconnect (priv->signal_handlers,
priv->signal_handlers = modest_signal_mgr_connect (priv->signal_handlers,
G_OBJECT (model),
"activity-changed",
- G_CALLBACK (on_activity_changed),
+ G_CALLBACK (on_activity_changed),
self);
#endif
model = gtk_tree_view_get_model (GTK_TREE_VIEW (self));
if (GTK_IS_TREE_MODEL_FILTER (model))
gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (model));
+ else
+ modest_folder_view_update_model(self,
+ (TnyAccountStore *) modest_runtime_get_account_store());
/* Save settings to gconf */
modest_widget_memory_save (modest_runtime_get_conf (), G_OBJECT(self),
activity);
}
#endif
+
+TnyList *
+modest_folder_view_get_model_tny_list (ModestFolderView *self)
+{
+ GtkTreeModel *model;
+ TnyList *ret_value;
+
+ ret_value = NULL;
+ model = NULL;
+
+ if (get_inner_models (MODEST_FOLDER_VIEW (self), NULL, NULL, (GtkTreeModel **) &model)) {
+ ret_value = TNY_LIST (model);
+ g_object_ref (ret_value);
+ }
+
+ return ret_value;
+
+}