tweaks to debugging file saving

This commit is contained in:
Chris Cochrun 2024-02-28 09:48:37 -06:00
parent ea686a9d9b
commit ca6cccd24d
2 changed files with 6 additions and 2 deletions

View file

@ -262,14 +262,16 @@ Kirigami.ApplicationWindow {
console.log(saveFile.toString());
let file = "";
if (saveFile.length === 0) {
saveFileDialog.open()
file = fileHelper.saveFile();
finalSave(file);
} else {
finalSave(saveFile);
}
}
function saveAs() {
saveFileDialog.open();
let file = fileHelper.saveFile();
finalSave(file);
}
function finalSave(file) {

View file

@ -80,6 +80,7 @@ impl file_helper::FileHelper {
}
pub fn save_file(self: Pin<&mut Self>) -> QUrl {
debug!("Saving file in rust");
let file = FileDialog::new()
.set_file_name("NVTFC.pres")
.set_title("Save Presentation")
@ -95,6 +96,7 @@ impl file_helper::FileHelper {
QUrl::from(string.as_str())
}
} else {
error!("There was an error, is xdg-desktop-portals correctly setup?");
QUrl::default()
}
}