diff --git a/Cargo.lock b/Cargo.lock index 262dbd7..7f58215 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1871,7 +1871,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index f5fd52b..c09a465 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,16 +7,8 @@ description = "Export your FFXIV character in portable, generic formats" [lib] crate-type = ["cdylib", "rlib"] -[[bin]] -name = "ui" -required-features = ["ui"] - -[features] -# Builds the Qt UI for Auracite -ui = ["cxx", "cxx-qt-build", "cxx-qt", "cxx-qt-lib", "cxx-qt-lib-extras", "cxx-kde-frameworks"] - [build-dependencies] -cxx-qt-build = { git = "https://github.com/KDAB/cxx-qt", branch = "main", features = ["link_qt_object_files"], default-features = false, optional = true } +cxx-qt-build = { git = "https://github.com/KDAB/cxx-qt", branch = "main", features = ["link_qt_object_files"], default-features = false } [dependencies] # Used to scrape the Lodestone HTML pages @@ -66,10 +58,10 @@ serde_json = { version = "1.0", default-features = false, features = ["alloc"] } tokio = { version = "1.41", features = ["rt", "rt-multi-thread", "macros"], default-features = false } # Used for the Qt UI -cxx = { version = "1.0", default-features = false, optional = true } -cxx-qt = { git = "https://github.com/KDAB/cxx-qt", branch = "main", default-features = false, optional = true } -cxx-qt-lib = { git = "https://github.com/KDAB/cxx-qt", branch = "main", default-features = false, optional = true} -cxx-qt-lib-extras = { git = "https://github.com/KDAB/cxx-qt", branch = "main", default-features = false, optional = true} -cxx-kde-frameworks = { git = "https://invent.kde.org/libraries/cxx-kde-frameworks", branch = "work/redstrate/kaboutdata-process-cmdline", default-features = false, optional = true } +cxx = { version = "1.0", default-features = false } +cxx-qt = { git = "https://github.com/KDAB/cxx-qt", branch = "main", default-features = false } +cxx-qt-lib = { git = "https://github.com/KDAB/cxx-qt", branch = "main", default-features = false } +cxx-qt-lib-extras = { git = "https://github.com/KDAB/cxx-qt", branch = "main", default-features = false } +cxx-kde-frameworks = { git = "https://invent.kde.org/libraries/cxx-kde-frameworks", branch = "work/redstrate/kaboutdata-process-cmdline", default-features = false } serde_json = { version = "1.0", default-features = false, features = ["std"] } \ No newline at end of file diff --git a/build.rs b/build.rs index 92caaa5..db654f2 100644 --- a/build.rs +++ b/build.rs @@ -1,15 +1,15 @@ -#[cfg(feature = "ui")] use cxx_qt_build::{CxxQtBuilder, QmlModule}; fn main() { - #[cfg(feature = "ui")] - CxxQtBuilder::new() - .qt_module("Quick") - .qml_module(QmlModule { - uri: "zone.xiv.auracite", - rust_files: &["src/bin/ui/bridge.rs"], - qml_files: &["src/bin/ui/Main.qml"], - ..Default::default() - }) - .build(); + if std::env::var("CARGO_CFG_TARGET_FAMILY").unwrap() != "wasm" { + CxxQtBuilder::new() + .qt_module("Quick") + .qml_module(QmlModule { + uri: "zone.xiv.auracite", + rust_files: &["src/bin/auracite/bridge.rs"], + qml_files: &["src/bin/auracite/Main.qml"], + ..Default::default() + }) + .build(); + } } \ No newline at end of file diff --git a/src/bin/ui/Main.qml b/src/bin/auracite/Main.qml similarity index 100% rename from src/bin/ui/Main.qml rename to src/bin/auracite/Main.qml diff --git a/src/bin/ui/bridge.rs b/src/bin/auracite/bridge.rs similarity index 100% rename from src/bin/ui/bridge.rs rename to src/bin/auracite/bridge.rs diff --git a/src/bin/ui/main.rs b/src/bin/auracite/main.rs similarity index 99% rename from src/bin/ui/main.rs rename to src/bin/auracite/main.rs index 275e822..d5bd18b 100644 --- a/src/bin/ui/main.rs +++ b/src/bin/auracite/main.rs @@ -69,7 +69,7 @@ fn main() { if let Some(mut engine) = engine.as_mut() { KLocalizedContext::initialize_engine(engine.as_mut().as_qqmlengine()); // TODO: replace with loadModule (requires cxx-qt changes) - engine.load(&QUrl::from("qrc:/qt/qml/zone/xiv/auracite/src/bin/ui/Main.qml")); + engine.load(&QUrl::from("qrc:/qt/qml/zone/xiv/auracite/src/bin/auracite/Main.qml")); } if let Some(app) = app.as_mut() { diff --git a/src/lib.rs b/src/lib.rs index 1d1dd6b..19adf79 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -63,7 +63,7 @@ impl Service for PackageService<'_> { } /// Archives the character named `character_name` and gives a ZIP file as bytes that can be written to disk. -pub async extern fn archive_character(character_name: &str, use_dalamud: bool) -> Vec { +pub async fn archive_character(character_name: &str, use_dalamud: bool) -> Vec { let search_page = download(&Url::parse_with_params(&format!("{LODESTONE_HOST}/lodestone/character?"), &[("q", character_name)]).unwrap()) .await .expect("Failed to download the search page from the Lodestone.");