Commit 9ac171fb authored by Leander Schulten's avatar Leander Schulten

SettingsView: Fix Bug: Handle file URLs right, until now they don't work on...

SettingsView: Fix Bug: Handle file URLs right, until now they don't work on linux. file:/// vs file://
parent 40a5ff45
Pipeline #191099 passed with stage
in 8 minutes and 52 seconds
......@@ -115,15 +115,19 @@ Pane{
}
FileDialog{
property var callback;
function openAt(path, isFolder){
selectFolder = isFolder;
folder = pathToUrl(path);
open();
}
id: fileDialog
title: "Please choose a file"
onAccepted: {
console.log("fftey:"+callback);
if(callback)callback(fileDialog.fileUrl.toString().substring(8));
}
onSelectionAccepted: console.log("3")
onVisibleChanged: console.info("this")
onRejected: console.log("rej")
Component.onCompleted: console.log("comp")
if(callback){
callback(urlToPath(fileDialog.fileUrl));
}else{
console.error("Error in File Dialog in SettingsView: No callback provided!")
}
}
}
}
......@@ -36,13 +36,8 @@ RowLayout{
if(root.fileChooser === null){
throw "fileChooser ist not set!";
}
path = root.path
var fileDialog = root.fileChooser;
fileDialog.selectFolder = parent.folder;
fileDialog.selectMultiple = !parent.folder;
fileDialog.folder = "file:///"+path.substring(0,path.lastIndexOf("/"));
fileDialog.addSelection("file:///"+path);
fileDialog.open();
const fileDialog = root.fileChooser;
fileDialog.openAt(parent.path, parent.folder);
fileDialog.callback = function(file){
root.path = file;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment