Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use common log prefix for window title #28

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 26 additions & 10 deletions src/app.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::collections::{BTreeMap, BTreeSet, VecDeque};
use std::fmt;
use std::path::Path;

Check warning on line 3 in src/app.rs

View workflow job for this annotation

GitHub Actions / Check wasm32

unused import: `std::path::Path`

Check warning on line 3 in src/app.rs

View workflow job for this annotation

GitHub Actions / Check wasm32

unused import: `std::path::Path`
use std::time::Duration;
#[cfg(not(target_arch = "wasm32"))]
use std::time::Instant;
Expand Down Expand Up @@ -1192,7 +1193,7 @@
if !self.result_cache.contains_key(entry.entry_id()) {
self.result_cache
.entry(entry.entry_id().clone())
.or_insert_with(BTreeMap::new);
.or_default();
}

// Always recurse into tiles, because results can be fetched
Expand All @@ -1214,7 +1215,7 @@
.and_modify(|_| {
result = false;
})
.or_insert_with(BTreeMap::new);
.or_default();
result
}

Expand Down Expand Up @@ -1250,13 +1251,8 @@
let level1_index = entry_id.slot_index(1).unwrap();
let level2_index = entry_id.slot_index(2).unwrap();

let level0_subtree = self
.entry_tree
.entry(level0_index)
.or_insert_with(BTreeMap::new);
let level1_subtree = level0_subtree
.entry(level1_index)
.or_insert_with(BTreeSet::new);
let level0_subtree = self.entry_tree.entry(level0_index).or_default();
let level1_subtree = level0_subtree.entry(level1_index).or_default();
level1_subtree.insert(level2_index);
}
}
Expand Down Expand Up @@ -2443,8 +2439,28 @@
env_logger::try_init().unwrap_or(()); // Log to stderr (if you run with `RUST_LOG=debug`).

let native_options = eframe::NativeOptions::default();

let mut paths = BTreeSet::new();
let arguments: Vec<String> = std::env::args().collect();
for argument in &arguments[1..] {
if !argument.starts_with("--") {
let path = Path::new(&argument)
.parent()
.unwrap()
.to_str()
.unwrap()
.to_string();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of this makes sense, but also seems like a lot. If there is something better to do Rust-wise, please lmk.

paths.insert(path);
}
}
let app_name = if paths.len() == 1 {
paths.pop_last().unwrap()
} else {
String::from("Legion Prof")
};

eframe::run_native(
"Legion Prof",
&app_name,
native_options,
Box::new(|cc| Box::new(ProfApp::new(cc, data_sources))),
)
Expand Down
Loading