Browse Source

fixup some TODO and FIXMEs

tags/pre-alpha-0.4.0
Manos Pitsidianakis 1 year ago
parent
commit
424b244bb7
Signed by: epilys GPG Key ID: 73627C2F690DF710
4 changed files with 34 additions and 31 deletions
  1. +0
    -1
      melib/src/backends/imap/watch.rs
  2. +5
    -7
      ui/src/components/mail/listing/thread.rs
  3. +29
    -22
      ui/src/conf/accounts.rs
  4. +0
    -1
      ui/src/terminal/cells.rs

+ 0
- 1
melib/src/backends/imap/watch.rs View File

@ -477,7 +477,6 @@ fn examine_updates(
*v = ok.uidvalidity;
}
} else {
// FIXME: Handle this case in ui/src/conf/accounts.rs
sender.send(RefreshEvent {
hash: folder_hash,
kind: RefreshEventKind::Rescan,

+ 5
- 7
ui/src/components/mail/listing/thread.rs View File

@ -250,7 +250,6 @@ impl ThreadListing {
if !(self.cursor_pos.0 == self.new_cursor_pos.0
&& self.cursor_pos.1 == self.new_cursor_pos.1)
{
//TODO: store cursor_pos in each folder
self.cursor_pos.2 = 0;
self.new_cursor_pos.2 = 0;
}
@ -451,15 +450,14 @@ impl ThreadListing {
s.push('>');
}
s.push_str(if envelope.has_attachments() {
"📎"
} else {
""
});
if show_subject {
s.push_str(&format!("{:.85}", envelope.subject()));
}
/* TODO Very slow since we have to build all attachments
let attach_count = envelope.body(op).count_attachments();
if attach_count > 1 {
s.push_str(&format!(" {}∞ ", attach_count - 1));
}
*/
s
}
fn format_date(envelope: &Envelope) -> String {

+ 29
- 22
ui/src/conf/accounts.rs View File

@ -166,30 +166,37 @@ pub struct Account {
impl Drop for Account {
fn drop(&mut self) {
//TODO: Avoid panics
let data_dir = xdg::BaseDirectories::with_profile("meli", &self.name).unwrap();
if let Ok(data) = data_dir.place_data_file("addressbook") {
/* place result in cache directory */
let f = match fs::File::create(data) {
Ok(f) => f,
Err(e) => {
panic!("{}", e);
}
if let Ok(data_dir) = xdg::BaseDirectories::with_profile("meli", &self.name) {
if let Ok(data) = data_dir.place_data_file("addressbook") {
/* place result in cache directory */
let f = match fs::File::create(data) {
Ok(f) => f,
Err(e) => {
eprintln!("{}", e);
return;
}
};
let writer = io::BufWriter::new(f);
if let Err(err) = serde_json::to_writer(writer, &self.address_book) {
eprintln!("{}", err);
return;
};
};
let writer = io::BufWriter::new(f);
serde_json::to_writer(writer, &self.address_book).unwrap();
};
if let Ok(data) = data_dir.place_data_file("mailbox") {
/* place result in cache directory */
let f = match fs::File::create(data) {
Ok(f) => f,
Err(e) => {
panic!("{}", e);
}
if let Ok(data) = data_dir.place_data_file("mailbox") {
/* place result in cache directory */
let f = match fs::File::create(data) {
Ok(f) => f,
Err(e) => {
eprintln!("{}", e);
return;
}
};
let writer = io::BufWriter::new(f);
if let Err(err) = bincode::serialize_into(writer, &self.folders) {
eprintln!("{}", err);
};
};
let writer = io::BufWriter::new(f);
bincode::serialize_into(writer, &self.folders).unwrap();
};
}
}
}

+ 0
- 1
ui/src/terminal/cells.rs View File

@ -641,7 +641,6 @@ pub enum Attr {
BoldReverseUnderline = 0b111,
}
// TODO: word break.
pub fn copy_area_with_break(
grid_dest: &mut CellBuffer,
grid_src: &CellBuffer,

Loading…
Cancel
Save