1
Fork 0
mirror of https://github.com/redstrate/Auracite.git synced 2025-05-02 08:57:44 +00:00

Simplify features, Qt is now required on desktop

This commit is contained in:
Joshua Goins 2024-10-31 19:33:45 -04:00
parent 7c28e03d63
commit eb14e13311
7 changed files with 20 additions and 28 deletions

2
Cargo.lock generated
View file

@ -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]]

View file

@ -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"] }

View file

@ -1,15 +1,15 @@
#[cfg(feature = "ui")]
use cxx_qt_build::{CxxQtBuilder, QmlModule};
fn main() {
#[cfg(feature = "ui")]
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/ui/bridge.rs"],
qml_files: &["src/bin/ui/Main.qml"],
rust_files: &["src/bin/auracite/bridge.rs"],
qml_files: &["src/bin/auracite/Main.qml"],
..Default::default()
})
.build();
}
}

View file

@ -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() {

View file

@ -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<u8> {
pub async fn archive_character(character_name: &str, use_dalamud: bool) -> Vec<u8> {
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.");