summaryrefslogtreecommitdiffstats
path: root/imap
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2019-09-08 12:09:51 -0700
committerKevin McCarthy <kevin@8t8.us>2019-09-08 15:36:33 -0700
commit1600dd189b064341b6579d8b07d0bf5f6ad80f8d (patch)
treeef761f439e496eb7d23301b19aa4af62e63df219 /imap
parentad72ec6c4672149a21c9655299b5c769bd3cbf78 (diff)
Rename browser fields to display_name and full_path.
Mailbox and Folder view don't make use of the desc field. They store an abbreviated version in the name field and expand it when selecting or testing it. IMAP stores the full URL in name, and stores an abbreviated version (possibly with a trailing slash) in the desc field. The asymetricity makes it awkward, and interferes with a smart-cursor option in the next commit. So instead rename the fields to "display_name" and "full_path". In Mailfox and Folder view, store the fully expanded path, which we have while iterating, in "full_path", and the shortened version in "display_name". Likewise in IMAP, store the full URL in "full_path" and the shortened version in "display_name". Simplify the code in browser.c to use the full_path instead of concatenating and expanding.
Diffstat (limited to 'imap')
-rw-r--r--imap/browse.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/imap/browse.c b/imap/browse.c
index ab965803..277444aa 100644
--- a/imap/browse.c
+++ b/imap/browse.c
@@ -426,7 +426,7 @@ static void imap_add_folder (char delim, char *folder, int noselect,
}
imap_qualify_path (tmp, sizeof (tmp), &mx, folder);
- (state->entry)[state->entrylen].name = safe_strdup (tmp);
+ (state->entry)[state->entrylen].full_path = safe_strdup (tmp);
/* mark desc with delim in browser if it can have subfolders */
if (!isparent && !noinferiors && strlen (relpath) < sizeof (relpath) - 1)
@@ -435,7 +435,7 @@ static void imap_add_folder (char delim, char *folder, int noselect,
relpath[strlen (relpath)] = delim;
}
- (state->entry)[state->entrylen].desc = safe_strdup (relpath);
+ (state->entry)[state->entrylen].display_name = safe_strdup (relpath);
(state->entry)[state->entrylen].imap = 1;
/* delimiter at the root is useless. */
@@ -469,5 +469,5 @@ static void imap_add_folder (char delim, char *folder, int noselect,
static int compare_names(struct folder_file *a, struct folder_file *b)
{
- return mutt_strcmp(a->name, b->name);
+ return mutt_strcmp(a->full_path, b->full_path);
}