melib: rename FolderConf rename field to alias

This commit is contained in:
Manos Pitsidianakis 2019-12-18 15:40:57 +02:00
parent 450c9f2b1c
commit 9080e0fd96
No known key found for this signature in database
GPG Key ID: 73627C2F690DF710
3 changed files with 10 additions and 9 deletions

View File

@ -69,8 +69,8 @@ display_name = "Name"
# Set folder-specific settings
[accounts.account-name.folders]
"INBOX" = { rename="Inbox" } #inline table
"drafts" = { rename="Drafts" } #inline table
"INBOX" = { alias="Inbox" } #inline table
"drafts" = { alias="Drafts" } #inline table
[accounts.account-name.folders."foobar-devel"] # or a regular table
ignore = true # don't show notifications for this folder
@ -206,7 +206,7 @@ example:
.El
.Sh FOLDERS
.Bl -tag -width 36n
.It Ic rename Ar String
.It Ic alias Ar String
(optional) show a different name for this folder in the UI
.It Ic autoload Ar boolean
(optional) load this folder on startup (not functional yet)
@ -307,6 +307,7 @@ open_thread = "Enter"
exit_thread = 'i'
.Bd
.Pp
.Sy Em general
.Bl -tag -width 36n
.It Ic next_tab
@ -430,7 +431,7 @@ Edit mail.
.El
.Sy Em envelope-view
.Pp
To "select" an attachment, type its index (you will see the typed result in the command buffer on your bottom right of the status line) and then issue the corresponding command.
.Bl -tag -width 36n
.It Ic add_addresses_to_contacts Ns

View File

@ -75,7 +75,7 @@ impl AccountSettings {
#[serde(default)]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FolderConf {
pub rename: Option<String>,
pub alias: Option<String>,
#[serde(default = "true_val")]
pub autoload: bool,
#[serde(deserialize_with = "toggleflag_de")]
@ -91,7 +91,7 @@ pub struct FolderConf {
impl Default for FolderConf {
fn default() -> Self {
FolderConf {
rename: None,
alias: None,
autoload: true,
subscribe: ToggleFlag::Unset,
ignore: ToggleFlag::Unset,
@ -102,8 +102,8 @@ impl Default for FolderConf {
}
impl FolderConf {
pub fn rename(&self) -> Option<&str> {
self.rename.as_ref().map(String::as_str)
pub fn alias(&self) -> Option<&str> {
self.alias.as_ref().map(String::as_str)
}
}

View File

@ -781,7 +781,7 @@ impl Account {
//debug!("folder renames: {:?}", folder_renames);
for f in folders.values_mut() {
if let Some(r) = folder_confs.get(&f.hash()) {
if let Some(rename) = r.folder_conf().rename() {
if let Some(rename) = r.folder_conf().alias() {
f.change_name(rename);
}
}