Skip to content

Commit

Permalink
fix: some todo
Browse files Browse the repository at this point in the history
  • Loading branch information
Horbin-Magician committed Jul 13, 2024
1 parent 18414d8 commit 96d9438
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rotor"
version = "0.4.9"
version = "0.4.10"
authors = ["Horbin"]
edition = "2021"
license = "MIT"
Expand Down
4 changes: 1 addition & 3 deletions src/module/screen_shotter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ impl ScreenShotter{
}

// event listen
// let pin_wins_clone = pin_wins.clone(); // TODO: clear pin_wins
let pin_windows_clone = pin_windows.clone();
std::thread::spawn(move || {
loop {
Expand All @@ -199,9 +198,8 @@ impl ScreenShotter{
ScreenShotter::pin_win_move_hander(pin_windows.clone(), id);
},
ShotterMessage::Close(id) => {
println!("close pin_win: {}", id);
pin_windows_clone.lock().unwrap().remove(&id);
// pin_wins_clone.lock().unwrap().remove(&id);
// pin_wins_clone.lock().unwrap().remove(&id); // TODO: clear pin_wins
}
}
}
Expand Down
1 change: 0 additions & 1 deletion src/module/searcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ impl Module for Searcher{
match msg_reciever.recv().unwrap() {
ModuleMessage::Trigger => {
search_win_clone.upgrade_in_event_loop(move |win| {
// TODO BUG1: a trick to make on_lose_focus_trick work on the first time
win.show().unwrap();
win.window().with_winit_window(|winit_win: &i_slint_backend_winit::winit::window::Window| {
winit_win.focus_window();
Expand Down
2 changes: 1 addition & 1 deletion src/module/searcher/file_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ impl FileData {

let return_result =
if self.finding_result.items.len() > self.show_num { self.finding_result.items[..self.show_num].to_vec() }
else { self.finding_result.items.to_vec() }; // TODO 搜索不到更多文件了
else { self.finding_result.items.to_vec() };
self.update_result_model(filename, return_result, increment_find);
}
break;
Expand Down
5 changes: 2 additions & 3 deletions src/module/searcher/volume.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ impl Volume {
});

if let Some(sender) = sender {
let _ = sender.send(true); // TODO return false when failed
let _ = sender.send(true);
}
}

Expand Down Expand Up @@ -342,8 +342,7 @@ impl Volume {
let query_lower = query.to_lowercase();
let query_filter = Self::make_filter(&query_lower);

// clear channel before find !!! TODO need to use a better way
while self.stop_receiver.try_recv().is_ok() { }
while self.stop_receiver.try_recv().is_ok() { } // clear channel before find

if self.last_query != query {
self.last_search_num = 0;
Expand Down

0 comments on commit 96d9438

Please sign in to comment.