* mu-maildir: also ignore .#evolution, update comments a bit

This commit is contained in:
Dirk-Jan C. Binnema 2011-05-06 08:33:37 +03:00
parent 0758ab6645
commit 3223892e24
1 changed files with 14 additions and 11 deletions

View File

@ -286,7 +286,8 @@ is_maildir_new_or_cur (const char *path)
return FALSE; return FALSE;
} }
/* check if there is a noindex file (MU_WALK_NOINDEX_FILE) in this dir; */ /* check if there is a noindex file (MU_MAILDIR_NOINDEX_FILE) in this
* dir; */
static gboolean static gboolean
has_noindex_file (const char *path) has_noindex_file (const char *path)
{ {
@ -320,6 +321,8 @@ ignore_dir_entry (struct dirent *entry, unsigned char d_type)
/* ignore '.' and '..' dirs, as well as .notmuch and /* ignore '.' and '..' dirs, as well as .notmuch and
* .nnmaildir */ * .nnmaildir */
/* does not start with '.', so don't ignore */
if (G_LIKELY(name[0] != '.')) if (G_LIKELY(name[0] != '.'))
return FALSE; return FALSE;
@ -332,6 +335,11 @@ ignore_dir_entry (struct dirent *entry, unsigned char d_type)
(strcmp (name, ".notmuch") == 0 || (strcmp (name, ".notmuch") == 0 ||
strcmp (name, ".nnmaildir") == 0)) strcmp (name, ".nnmaildir") == 0))
return TRUE; return TRUE;
/* ignore '.#evolution */
if ((name[1] == '#') &&
(strcmp (name, ".#evolution")))
return TRUE;
return FALSE; return FALSE;
} }
@ -604,11 +612,7 @@ mu_maildir_clear_links (const gchar* path, GError **err)
* is this a 'new' msg or a 'cur' msg?; if new, we return * is this a 'new' msg or a 'cur' msg?; if new, we return
* (in info) a ptr to the info part * (in info) a ptr to the info part
*/ */
enum _MsgType { enum _MsgType { MSG_TYPE_CUR, MSG_TYPE_NEW, MSG_TYPE_OTHER };
MSG_TYPE_CUR,
MSG_TYPE_NEW,
MSG_TYPE_OTHER
};
typedef enum _MsgType MsgType; typedef enum _MsgType MsgType;
static MsgType static MsgType
@ -700,7 +704,7 @@ leave:
return flags; return flags;
} }
/* note: returns static string, non-reentrant */
static const char* static const char*
get_flags_str_s (MuMsgFlags flags) get_flags_str_s (MuMsgFlags flags)
{ {
@ -730,8 +734,8 @@ get_flags_str_s (MuMsgFlags flags)
/* /*
* take an exising message path, and return a new path, based on whether it should be in * take an exising message path, and return a new path, based on
* 'new' or 'cur'; ie. * whether it should be in 'new' or 'cur'; ie.
* *
* /home/user/Maildir/foo/bar/cur/abc:2,F and flags == MU_MSG_FLAG_NEW * /home/user/Maildir/foo/bar/cur/abc:2,F and flags == MU_MSG_FLAG_NEW
* => /home/user/Maildir/foo/bar/new * => /home/user/Maildir/foo/bar/new
@ -832,8 +836,7 @@ mu_maildir_get_path_from_flags (const char *oldpath, MuMsgFlags newflags)
/* if MU_MSG_FLAG_NEW is set, it must be the only flag */ /* if MU_MSG_FLAG_NEW is set, it must be the only flag */
g_return_val_if_fail (newflags & MU_MSG_FLAG_NEW ? g_return_val_if_fail (newflags & MU_MSG_FLAG_NEW ?
newflags == MU_MSG_FLAG_NEW : TRUE, NULL); newflags == MU_MSG_FLAG_NEW : TRUE, NULL);
newname = get_new_file_name (oldpath, newflags); newname = get_new_file_name (oldpath, newflags);
if (!newname) if (!newname)
return NULL; return NULL;