Create a funtion to generate filepath from received uri

This commit is contained in:
Angela Mazzurco 2017-07-12 16:47:12 +02:00
parent 9a621b7509
commit e58cd8f363

View File

@ -1,6 +1,8 @@
import QtQuick 2.7
import QtQuick.Dialogs 1.2
import "../URI.js" as UriJs
Item
{
id: compRoot
@ -41,10 +43,18 @@ Item
function androidResult (uri)
{
console.log("Android image uri found" , uri)
resultFile = uri
console.log("QML Android image uri found" , uri)
resultFile = uriToFilePath (uri)
mainWindow.delUriHandler("media", androidResult)
}
function normalizeUriToFilePath (uriStr)
{
var uri = new UriJs.URI(uriStr)
var hPath = uri.path()
return "file:///"+hPath
}
}