summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--qml_plugin/src/launcher/duckduckgo.rs11
-rw-r--r--qml_plugin/src/web/duckduckgo.rs8
2 files changed, 9 insertions, 10 deletions
diff --git a/qml_plugin/src/launcher/duckduckgo.rs b/qml_plugin/src/launcher/duckduckgo.rs
index 1de7161..a2785f2 100644
--- a/qml_plugin/src/launcher/duckduckgo.rs
+++ b/qml_plugin/src/launcher/duckduckgo.rs
@@ -27,8 +27,7 @@ mod qobject {
description_html
)]
#[qproperty(
- QString,
- preview_image
+ QString, image
)]
type DuckDuckGo = super::DuckDuckGoRs;
@@ -46,7 +45,7 @@ mod qobject {
pub struct QmlDuckDuckGo {
pub title: QString,
pub description_html: QString,
- pub preview_image: QString,
+ pub image: QString,
}
#[derive(Default)]
@@ -54,7 +53,7 @@ pub struct DuckDuckGoRs {
ok: bool,
title: QString,
description_html: QString,
- preview_image: QString,
+ image: QString,
executor: ExclusiveExecutor,
}
@@ -83,7 +82,7 @@ impl qobject::DuckDuckGo {
qo.as_mut()
.set_description_html(r.description_html);
qo.as_mut()
- .set_preview_image(r.preview_image);
+ .set_image(r.image);
}
Err(_) => qo.set_ok(false),
},
@@ -101,6 +100,6 @@ impl qobject::DuckDuckGo {
self.as_mut()
.set_description_html("".into());
self.as_mut()
- .set_preview_image("".into());
+ .set_image("".into());
}
}
diff --git a/qml_plugin/src/web/duckduckgo.rs b/qml_plugin/src/web/duckduckgo.rs
index 3b73501..6de39af 100644
--- a/qml_plugin/src/web/duckduckgo.rs
+++ b/qml_plugin/src/web/duckduckgo.rs
@@ -14,7 +14,7 @@ const DUCKDUCKGO: &str = "https://duckduckgo.com";
pub struct DuckDuckGoContent {
title: String,
description_html: String,
- preview_image: Option<Url>,
+ image: Option<Url>,
}
impl From<DuckDuckGoContent> for QmlDuckDuckGo {
@@ -26,8 +26,8 @@ impl From<DuckDuckGoContent> for QmlDuckDuckGo {
description_html: value
.description_html
.into(),
- preview_image: value
- .preview_image
+ image: value
+ .image
.map(
|u| {
u.to_string()
@@ -143,7 +143,7 @@ pub async fn query(input: &str) -> anyhow::Result<DuckDuckGoContent> {
.unwrap_or(alt_desc),
),
// TODO: try also Results[*].Icon.URL and RelatedTopics[*].Icon.URL
- preview_image: resp
+ image: resp
.image
.and_then(|i| Url::parse(&format!("{DUCKDUCKGO}{i}",)).ok()),
},