1
0
Fork 0
mirror of synced 2024-05-17 19:03:08 +12:00
This commit is contained in:
Rafał Mikrut 2023-10-22 13:07:38 +02:00
parent fbe0295f6d
commit e859c777a4
5 changed files with 8 additions and 13 deletions

View file

@ -20,11 +20,7 @@ jobs:
- name: Check the format
run: cargo fmt --all -- --check
# type complexity must be ignored because we use huge templates for queries
# Clippy overly_complex_bool_expr is disabled because mess with generated files in target dir
# and I cannot disable it
- name: Run clippy
run: >
cargo clippy
--all-targets
--all-features
--
-D warnings
run: cargo clippy --all-targets --all-features -- -A clippy::overly_complex_bool_expr -D warnings

View file

View file

@ -20,7 +20,7 @@ pub fn connect_delete_button(app: &MainWindow) {
*selected_row = false;
});
let r = ModelRc::new(VecModel::from(entries_left));
app.set_empty_folder_model(r.into());
app.set_empty_folder_model(r);
}
});
}

View file

@ -1,6 +1,4 @@
use crate::MainWindow;
use slint::{ComponentHandle, Model, ModelRc, SharedString, VecModel};
use std::borrow::BorrowMut;
pub fn connect_open_items(app: &MainWindow) {
app.on_item_opened(move |path| {

View file

@ -24,15 +24,16 @@ fn main() {
app.run().unwrap();
}
type ModelType = VecModel<(bool, bool, bool, ModelRc<SharedString>)>;
// TODO remove this after trying
pub fn to_remove_debug(app: &MainWindow) {
let row_data: Rc<VecModel<(bool, bool, bool, ModelRc<SharedString>)>> = Rc::new(VecModel::default());
let row_data: Rc<ModelType> = Rc::new(VecModel::default());
for r in 0..100000 {
for r in 0..100_000 {
let items = VecModel::default();
for c in 0..3 {
items.push(slint::format!("Item {r}.{c}").into());
items.push(slint::format!("Item {r}.{c}"));
}
row_data.push((r % 2 == 0, r % 3 == 0, false, ModelRc::new(items)));