Browse Source

melib: rename FolderConf `rename` field to alias

async
Manos Pitsidianakis 2 years ago
parent
commit
9080e0fd96
Signed by: epilys GPG Key ID: 73627C2F690DF710
  1. 9
      meli.conf.5
  2. 8
      melib/src/conf.rs
  3. 2
      ui/src/conf/accounts.rs

9
meli.conf.5

@ -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

8
melib/src/conf.rs

@ -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)
}
}

2
ui/src/conf/accounts.rs

@ -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);
}
}

Loading…
Cancel
Save