diff --git a/src/qml/main.qml b/src/qml/main.qml index 5813acc..e4d7efd 100644 --- a/src/qml/main.qml +++ b/src/qml/main.qml @@ -289,9 +289,10 @@ Kirigami.ApplicationWindow { target: ServiceItemModel function onSavedToFile(saved, file) { if (saved) { - Utils.dbg(file); - console.log(file); - showPassiveNotification("Saved to ", + Qt.resolvedUrl(file)); + let path = file.toString(); + path = path.replace(/^(file:\/{2})/,""); + let cleanPath = decodeURIComponent(path); + showPassiveNotification("Saved to ", + cleanPath); } } } diff --git a/src/rust/utils.rs b/src/rust/utils.rs index e19de21..108dae9 100644 --- a/src/rust/utils.rs +++ b/src/rust/utils.rs @@ -56,6 +56,7 @@ mod utilities { unsafe extern "C++" { include!("cxx-qt-lib/qstring.h"); type QString = cxx_qt_lib::QString; + type QUrl = cxx_qt_lib::QUrl; } unsafe extern "RustQt" { @@ -71,6 +72,9 @@ mod utilities { #[qinvokable] fn inf(self: &Utils, message: QString); + + #[qinvokable] + fn url_to_string(self: &Utils, url: QUrl) -> QString; } } @@ -99,6 +103,10 @@ impl utilities::Utils { pub fn inf(self: &Self, message: QString) { info!(msg = ?message); } + + pub fn url_to_string(self: &Self, url: QUrl) -> QString { + url.path() + } } pub fn setup() {