From c13ad48dd3efa67250b7285026f2ad989bf631f3 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sat, 1 Aug 2026 18:33:24 +0800 Subject: fixup! launcher(duckduckgo.rs): qml usable interface --- qml_plugin/src/launcher/duckduckgo.rs | 7 ++----- qml_plugin/src/launcher/smartcalc.rs | 2 ++ qml_plugin/src/web/duckduckgo.rs | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'qml_plugin') diff --git a/qml_plugin/src/launcher/duckduckgo.rs b/qml_plugin/src/launcher/duckduckgo.rs index 1106212..aa1ce2d 100644 --- a/qml_plugin/src/launcher/duckduckgo.rs +++ b/qml_plugin/src/launcher/duckduckgo.rs @@ -1,11 +1,8 @@ use cxx_qt::Threading; use cxx_qt_lib::QString; -use std::{pin::Pin, ptr}; +use std::pin::Pin; -use crate::{ - RUNTIME, - web::duckduckgo::{self, DuckDuckGoContent}, -}; +use crate::{RUNTIME, web::duckduckgo}; #[cxx_qt::bridge] mod qobject { diff --git a/qml_plugin/src/launcher/smartcalc.rs b/qml_plugin/src/launcher/smartcalc.rs index 7b1b066..eee975d 100644 --- a/qml_plugin/src/launcher/smartcalc.rs +++ b/qml_plugin/src/launcher/smartcalc.rs @@ -104,6 +104,8 @@ impl qobject::SmartCalc { ); qo.as_mut() .set_result( + // TODO: do the calc outside of ts main qt ui render thread.(all + // *.rs) match result { Ok(value) => { if value.formatted == value.input { diff --git a/qml_plugin/src/web/duckduckgo.rs b/qml_plugin/src/web/duckduckgo.rs index 3793485..3b73501 100644 --- a/qml_plugin/src/web/duckduckgo.rs +++ b/qml_plugin/src/web/duckduckgo.rs @@ -117,7 +117,7 @@ pub async fn query(input: &str) -> anyhow::Result { .clone() } else { match i.value { - InfoboxValue::Entity(ref entity_value) => unreachable!(), + InfoboxValue::Entity(_) => unreachable!(), InfoboxValue::String(ref s) => s.to_string(), } } -- cgit v1.2.3