From ded5dd9d31ad1a8967bb07ce20276529f376a7d2 Mon Sep 17 00:00:00 2001 From: dolcetriade Date: Mon, 29 May 2017 12:01:08 -0700 Subject: [PATCH] Fix setting install path on Windows --- Settings.qml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Settings.qml b/Settings.qml index 60c0ff2..c5c8455 100644 --- a/Settings.qml +++ b/Settings.qml @@ -53,9 +53,13 @@ Item { id: fileDialog title: "Please choose a folder" onAccepted: { - updaterSettings.installPath = Qt.resolvedUrl(fileDialog.fileUrl).substring('file://'.length); - updaterSettings.currentVersion = ""; - updaterSettings.installFinished = false + var clipLength = 'file://'.length; + // On Windows, apparently, there are three slashes. Increment + // the substring clip length as a result. + if (Qt.platform.os === "windows") { + clipLength += 1; + } + updaterSettings.installPath = Qt.resolvedUrl(fileDialog.fileUrl).substring(clipLength); } selectFolder: true }