make sure the folder rules understand it's a special folder
pmo-trunk-r2795
12 files changed:
folder = tny_msg_get_folder (msg);
/* Drafts will be opened in the editor, instead of the viewer, as per the UI spec: */
folder = tny_msg_get_folder (msg);
/* Drafts will be opened in the editor, instead of the viewer, as per the UI spec: */
+ /* FIXME: same should happen for Outbox; not enabling that, as the handling
+ * of edited messages is not clear in that case */
gboolean is_draft = FALSE;
if (folder && modest_tny_folder_is_local_folder (folder) &&
gboolean is_draft = FALSE;
if (folder && modest_tny_folder_is_local_folder (folder) &&
- (modest_tny_folder_get_local_folder_type (folder) == TNY_FOLDER_TYPE_DRAFTS)) {
+ (modest_tny_folder_get_local_or_mmc_folder_type (folder) == TNY_FOLDER_TYPE_DRAFTS)) {
show_reply = show_forward = show_cancel_send = show_clipboard = show_delete = FALSE;
} else if (TNY_IS_FOLDER (folder_store)) {
if (modest_tny_folder_is_local_folder (TNY_FOLDER (folder_store))) {
show_reply = show_forward = show_cancel_send = show_clipboard = show_delete = FALSE;
} else if (TNY_IS_FOLDER (folder_store)) {
if (modest_tny_folder_is_local_folder (TNY_FOLDER (folder_store))) {
- TnyFolderType folder_type = modest_tny_folder_get_local_folder_type (
+ TnyFolderType folder_type = modest_tny_folder_get_local_or_mmc_folder_type (
TNY_FOLDER (folder_store));
switch (folder_type) {
case TNY_FOLDER_TYPE_DRAFTS:
TNY_FOLDER (folder_store));
switch (folder_type) {
case TNY_FOLDER_TYPE_DRAFTS:
msg_folder = tny_msg_get_folder (msg);
if (msg_folder) {
if (modest_tny_folder_is_local_folder (msg_folder) &&
msg_folder = tny_msg_get_folder (msg);
if (msg_folder) {
if (modest_tny_folder_is_local_folder (msg_folder) &&
- modest_tny_folder_get_local_folder_type (msg_folder) == TNY_FOLDER_TYPE_DRAFTS)
+ modest_tny_folder_get_local_or_mmc_folder_type (msg_folder) == TNY_FOLDER_TYPE_DRAFTS)
priv->draft_msg = g_object_ref(msg);
g_object_unref (msg_folder);
}
priv->draft_msg = g_object_ref(msg);
g_object_unref (msg_folder);
}
*/
gchar *dir = g_build_filename (maildir_path,
*/
gchar *dir = g_build_filename (maildir_path,
+ modest_local_folder_info_get_type_name(TNY_FOLDER_TYPE_ARCHIVE),
+ NULL);
const gboolean created = modest_init_one_local_folder (dir);
g_free(dir);
const gboolean created = modest_init_one_local_folder (dir);
g_free(dir);
* { TNY_FOLDER_TYPE_OUTBOX, "contacts", N_("Contacts")},
{ TNY_FOLDER_TYPE_OUTBOX, "calendar", N_("Calendar")},
*/
* { TNY_FOLDER_TYPE_OUTBOX, "contacts", N_("Contacts")},
{ TNY_FOLDER_TYPE_OUTBOX, "calendar", N_("Calendar")},
*/
- { TNY_FOLDER_TYPE_ARCHIVE, "archive", N_("Archive")}
+ { TNY_FOLDER_TYPE_ARCHIVE, "archive", N_("mcen_me_folder_archive")}
-gchar *modest_per_account_local_outbox_folder_info_get_maildir_path (const gchar* account_name)
+gchar*
+modest_per_account_local_outbox_folder_info_get_maildir_path (const gchar* account_name)
{
/* This directory should contain an "outbox" child directory: */
return g_build_filename (g_get_home_dir(),
{
/* This directory should contain an "outbox" child directory: */
return g_build_filename (g_get_home_dir(),
-gchar *modest_per_account_local_outbox_folder_info_get_maildir_path_to_outbox_folder (const gchar* account_name)
+gchar*
+modest_per_account_local_outbox_folder_info_get_maildir_path_to_outbox_folder (const gchar* account_name)
{
gchar *path_to_account_folder =
modest_per_account_local_outbox_folder_info_get_maildir_path(account_name);
{
gchar *path_to_account_folder =
modest_per_account_local_outbox_folder_info_get_maildir_path(account_name);
TnyFolder *folder =
TNY_FOLDER (tny_iterator_get_current (iter));
if (folder) {
TnyFolder *folder =
TNY_FOLDER (tny_iterator_get_current (iter));
if (folder) {
- if (modest_tny_folder_get_local_folder_type (folder) == special_type) {
+ if (modest_tny_folder_get_local_or_mmc_folder_type (folder) == special_type) {
special_folder = folder;
break; /* Leaving a ref for the special_folder return value. */
}
special_folder = folder;
break; /* Leaving a ref for the special_folder return value. */
}
g_return_val_if_fail (TNY_IS_FOLDER(folder), TNY_FOLDER_TYPE_UNKNOWN);
if (modest_tny_folder_is_local_folder ((TnyFolder*)folder))
g_return_val_if_fail (TNY_IS_FOLDER(folder), TNY_FOLDER_TYPE_UNKNOWN);
if (modest_tny_folder_is_local_folder ((TnyFolder*)folder))
- type = modest_tny_folder_get_local_folder_type ((TnyFolder*)folder);
+ type = modest_tny_folder_get_local_or_mmc_folder_type ((TnyFolder*)folder);
else
type = tny_folder_get_folder_type (TNY_FOLDER (folder));
else
type = tny_folder_get_folder_type (TNY_FOLDER (folder));
if (modest_tny_folder_is_local_folder (folder) ||
modest_tny_folder_is_memory_card_folder (folder)) {
if (modest_tny_folder_is_local_folder (folder) ||
modest_tny_folder_is_memory_card_folder (folder)) {
- type = modest_tny_folder_get_local_folder_type (folder);
+ type = modest_tny_folder_get_local_or_mmc_folder_type (folder);
switch (type) {
case TNY_FOLDER_TYPE_OUTBOX:
switch (type) {
case TNY_FOLDER_TYPE_OUTBOX:
TnyAccount* account = tny_folder_get_account ((TnyFolder*)folder);
if (!account)
return FALSE;
TnyAccount* account = tny_folder_get_account ((TnyFolder*)folder);
if (!account)
return FALSE;
/* Outbox is a special case, using a derived TnyAccount: */
if (MODEST_IS_TNY_OUTBOX_ACCOUNT (account)) {
g_object_unref (G_OBJECT(account));
/* Outbox is a special case, using a derived TnyAccount: */
if (MODEST_IS_TNY_OUTBOX_ACCOUNT (account)) {
g_object_unref (G_OBJECT(account));
-modest_tny_folder_get_local_folder_type (TnyFolder *folder)
+modest_tny_folder_get_local_or_mmc_folder_type (TnyFolder *folder)
{
g_return_val_if_fail (folder, TNY_FOLDER_TYPE_UNKNOWN);
{
g_return_val_if_fail (folder, TNY_FOLDER_TYPE_UNKNOWN);
+ g_return_val_if_fail (modest_tny_folder_is_local_folder(folder)||
+ modest_tny_folder_is_memory_card_folder(folder),
+ TNY_FOLDER_TYPE_UNKNOWN);
+
/* The merge folder is a special case,
* used to merge the per-account local outbox folders.
* and can have no get_account() implementation.
/* The merge folder is a special case,
* used to merge the per-account local outbox folders.
* and can have no get_account() implementation.
g_object_unref (parent_account);
parent_account = NULL;
}
g_object_unref (parent_account);
parent_account = NULL;
}
-
-
- g_return_val_if_fail (modest_tny_folder_is_local_folder(folder),
- TNY_FOLDER_TYPE_UNKNOWN);
-
/* we need to use the camel functions, because we want the
* _full name_, that is, the full path name of the folder,
* to distinguish between 'Outbox' and 'myfunkyfolder/Outbox'
/* we need to use the camel functions, because we want the
* _full name_, that is, the full path name of the folder,
* to distinguish between 'Outbox' and 'myfunkyfolder/Outbox'
g_return_val_if_fail(folder, FALSE);
g_return_val_if_fail(account, FALSE);
g_return_val_if_fail(folder, FALSE);
g_return_val_if_fail(account, FALSE);
- if (modest_tny_folder_get_local_folder_type (folder) != TNY_FOLDER_TYPE_OUTBOX)
+ if (modest_tny_folder_get_local_or_mmc_folder_type (folder) != TNY_FOLDER_TYPE_OUTBOX)
return FALSE;
return TRUE;
return FALSE;
return TRUE;
*
* Returns: TRUE if it's a local folder, FALSE otherwise
*/
*
* Returns: TRUE if it's a local folder, FALSE otherwise
*/
-TnyFolderType modest_tny_folder_get_local_folder_type (TnyFolder *folder);
+TnyFolderType modest_tny_folder_get_local_or_mmc_folder_type (TnyFolder *folder);
* because these are just left-over from earlier Modest versions
* that put the outbox there: */
if (is_actual_local_folders_account) {
* because these are just left-over from earlier Modest versions
* that put the outbox there: */
if (is_actual_local_folders_account) {
- const TnyFolderType type = modest_tny_folder_get_local_folder_type (folder);
+ const TnyFolderType type = modest_tny_folder_get_local_or_mmc_folder_type (folder);
if (type == TNY_FOLDER_TYPE_OUTBOX) {
add = FALSE;
}
if (type == TNY_FOLDER_TYPE_OUTBOX) {
add = FALSE;
}
/* Gets folder type (OUTBOX headers will be opened in edit window */
if (modest_tny_folder_is_local_folder (folder))
/* Gets folder type (OUTBOX headers will be opened in edit window */
if (modest_tny_folder_is_local_folder (folder))
- folder_type = modest_tny_folder_get_local_folder_type (folder);
+ folder_type = modest_tny_folder_get_local_or_mmc_folder_type (folder);
/* If the header is in the drafts folder then open the editor,
else the message view window */
/* If the header is in the drafts folder then open the editor,
else the message view window */
/* Different names for the local folders */
if (modest_tny_folder_is_local_folder (folder)) {
/* Different names for the local folders */
if (modest_tny_folder_is_local_folder (folder)) {
- gint type = modest_tny_folder_get_local_folder_type (folder);
+ gint type = modest_tny_folder_get_local_or_mmc_folder_type (folder);
if (type != TNY_FOLDER_TYPE_UNKNOWN)
name = g_strdup(modest_local_folder_info_get_type_display_name (type));
}
if (type != TNY_FOLDER_TYPE_UNKNOWN)
name = g_strdup(modest_local_folder_info_get_type_display_name (type));
}
/* printf ("DEBU1G: %s: account name=%s\n", __FUNCTION__, tny_account_get_name (TNY_ACCOUNT(account))); */
GetMmcAccountNameData *data = (GetMmcAccountNameData*)user_data;
/* printf ("DEBU1G: %s: account name=%s\n", __FUNCTION__, tny_account_get_name (TNY_ACCOUNT(account))); */
GetMmcAccountNameData *data = (GetMmcAccountNameData*)user_data;
if (!strings_are_equal (
tny_account_get_name(TNY_ACCOUNT(account)),
data->previous_name)) {
if (!strings_are_equal (
tny_account_get_name(TNY_ACCOUNT(account)),
data->previous_name)) {
if (type != TNY_FOLDER_TYPE_ROOT) {
gint number = 0;
if (type != TNY_FOLDER_TYPE_ROOT) {
gint number = 0;
- if (modest_tny_folder_is_local_folder (TNY_FOLDER (instance))) {
- type = modest_tny_folder_get_local_folder_type (TNY_FOLDER (instance));
+ if (modest_tny_folder_is_local_folder (TNY_FOLDER (instance)) ||
+ modest_tny_folder_is_memory_card_folder (TNY_FOLDER (instance))) {
+ type = modest_tny_folder_get_local_or_mmc_folder_type (TNY_FOLDER (instance));
if (type != TNY_FOLDER_TYPE_UNKNOWN) {
g_free (fname);
fname = g_strdup(modest_local_folder_info_get_type_display_name (type));
if (type != TNY_FOLDER_TYPE_UNKNOWN) {
g_free (fname);
fname = g_strdup(modest_local_folder_info_get_type_display_name (type));
if ((parent_type == TNY_FOLDER_TYPE_ROOT) &&
TNY_IS_ACCOUNT (parent_folder) &&
modest_tny_account_is_virtual_local_folders (TNY_ACCOUNT (parent_folder))) {
if ((parent_type == TNY_FOLDER_TYPE_ROOT) &&
TNY_IS_ACCOUNT (parent_folder) &&
modest_tny_account_is_virtual_local_folders (TNY_ACCOUNT (parent_folder))) {
- cmp1 = get_cmp_subfolder_type_pos (modest_tny_folder_get_local_folder_type (TNY_FOLDER (folder1)));
- cmp2 = get_cmp_subfolder_type_pos (modest_tny_folder_get_local_folder_type (TNY_FOLDER (folder2)));
+ cmp1 = get_cmp_subfolder_type_pos (modest_tny_folder_get_local_or_mmc_folder_type (TNY_FOLDER (folder1)));
+ cmp2 = get_cmp_subfolder_type_pos (modest_tny_folder_get_local_or_mmc_folder_type (TNY_FOLDER (folder2)));
}
g_object_unref (parent_folder);
}
}
g_object_unref (parent_folder);
}