Build: the wasm check is warning-free; one file-dialog check instead of two

- ui-egui: the font-install poll (#2576) only runs on native builds, but its
  timestamp field, its initializer and FONT_INSTALL_POLL were compiled for
  wasm too, where nothing read them. They're gated like the code that reads
  them.
- engine: `Session::store_profile` is only called by the native Load
  Profile (cmd/colormgmt.rs); gated the same way.
- app (macOS): `App::logic_frame` checked `!file_dialog_open()` twice, one
  `if` nested in an identical one, with the comment repeated. One check.

`cargo xtask wasm` runs `cargo check` without `-D warnings`, so these
warnings didn't fail CI; after this change it prints none.
This commit is contained in:
Taha-Mahmoodi
2026-10-21 16:46:41 +07:00
committed by bflatastic
parent 0701340720
commit d4df4646ee
3 changed files with 5 additions and 5 deletions
+1 -5
View File
@@ -144,11 +144,7 @@ impl App {
// again on its document when it answers.
#[cfg(target_os = "macos")]
if !self.app.file_dialog_open() {
// Files from the Finder and the Dock wait while a file dialog is open: what asked for it runs
// again on its document when it answers.
if !self.app.file_dialog_open() {
open_files(&mut self.app, open_documents::take());
}
open_files(&mut self.app, open_documents::take());
}
self.app.logic(ctx);
window::track(ctx, &mut self.app.ui.window);
+1
View File
@@ -204,6 +204,7 @@ impl Session {
}
/// Write the profile `name` (its file's `bytes`) to the store; `false` when it didn't go there.
#[cfg(not(target_arch = "wasm32"))]
pub(crate) fn store_profile(&self, name: &str, bytes: &[u8]) -> bool {
self.profile_dir.as_deref().is_some_and(|dir| put(dir, &format!("{}.{PROFILE_EXT}", file_stem(name)), bytes))
}
+3
View File
@@ -486,6 +486,7 @@ pub struct VectorcraftApp {
/// the answer.
font_check: Option<(std::sync::mpsc::Receiver<bool>, bool)>,
/// When installed fonts were last checked in line (app time, s).
#[cfg(not(target_arch = "wasm32"))]
font_install_check_at: f64,
/// Keyboard pastes of something other than text (see [`shortcuts::PasteChord`]).
pub(crate) paste_chord: shortcuts::PasteChord,
@@ -535,6 +536,7 @@ struct PendingScreenshot {
/// Seconds between two looks at the system clipboard for [`VectorcraftApp::system_paste`].
const SYSTEM_CLIPBOARD_POLL: f64 = 0.25;
/// Seconds between looks for fonts a font manager activated while the app stays in front (#2576).
#[cfg(not(target_arch = "wasm32"))]
const FONT_INSTALL_POLL: f64 = 2.0;
impl VectorcraftApp {
@@ -601,6 +603,7 @@ impl VectorcraftApp {
picks: picks::Picks::default(),
screen_sampler: None,
font_check: None,
#[cfg(not(target_arch = "wasm32"))]
font_install_check_at: f64::NEG_INFINITY,
paste_chord: Default::default(),
background: Default::default(),