Closed
This commit is contained in:
parent
0c3dd22b0e
commit
0f56ca0187
|
@ -2,7 +2,7 @@ use crate::{split_path, CurrentTab, MainWindow};
|
||||||
use chrono::NaiveDateTime;
|
use chrono::NaiveDateTime;
|
||||||
use czkawka_core::common_tool::CommonData;
|
use czkawka_core::common_tool::CommonData;
|
||||||
use czkawka_core::empty_folder::EmptyFolder;
|
use czkawka_core::empty_folder::EmptyFolder;
|
||||||
use slint::{ComponentHandle, ModelRc, SharedString, VecModel};
|
use slint::{ComponentHandle, ModelRc, SharedString, VecModel, Weak};
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
@ -16,6 +16,14 @@ pub fn connect_scan_button(app: &MainWindow) {
|
||||||
let a = app.as_weak();
|
let a = app.as_weak();
|
||||||
match active_tab {
|
match active_tab {
|
||||||
CurrentTab::EmptyFolders => {
|
CurrentTab::EmptyFolders => {
|
||||||
|
scan_empty_folders(a);
|
||||||
|
}
|
||||||
|
_ => panic!(),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
fn scan_empty_folders(a: Weak<MainWindow>) {
|
||||||
thread::spawn(move || {
|
thread::spawn(move || {
|
||||||
let mut ef = EmptyFolder::new();
|
let mut ef = EmptyFolder::new();
|
||||||
ef.set_included_directory(vec![PathBuf::from("/home/rafal/Desktop")]);
|
ef.set_included_directory(vec![PathBuf::from("/home/rafal/Desktop")]);
|
||||||
|
@ -47,8 +55,4 @@ pub fn connect_scan_button(app: &MainWindow) {
|
||||||
app.set_scanning(false);
|
app.set_scanning(false);
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
}
|
|
||||||
_ => panic!(),
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,9 +24,9 @@ fn main() {
|
||||||
items.push(slint::format!("Item {r}.{c}").into());
|
items.push(slint::format!("Item {r}.{c}").into());
|
||||||
}
|
}
|
||||||
|
|
||||||
row_data.push((r % 4 == 0, r % 3 == 0, r % 2 == 0, ModelRc::new(items)));
|
row_data.push((r % 2 == 0, false, true, ModelRc::new(items)));
|
||||||
}
|
}
|
||||||
// app.set_empty_folder_model(row_data.into());
|
app.set_empty_folder_model(row_data.into());
|
||||||
|
|
||||||
connect_delete_button(&app);
|
connect_delete_button(&app);
|
||||||
connect_scan_button(&app);
|
connect_scan_button(&app);
|
||||||
|
|
Loading…
Reference in a new issue