From ab02d16eb7656ea0a37785a398716fad62dff045 Mon Sep 17 00:00:00 2001 From: elisa-lj11 Date: Mon, 18 Jul 2016 19:37:24 -0700 Subject: [PATCH] QML troubleshooting Trying to find out why it does multiple downloads on one click, when everything fails. Has something to do with a download finish request getting sent despite not being completed. --- interface/resources/qml/Browser.qml | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/interface/resources/qml/Browser.qml b/interface/resources/qml/Browser.qml index 7436328dd8..e9421d5ad1 100644 --- a/interface/resources/qml/Browser.qml +++ b/interface/resources/qml/Browser.qml @@ -221,20 +221,25 @@ ScrollingWindow { Component.onCompleted: { webview.profile.downloadRequested.connect(function(download){ - console.log("Download start: " + download.state) - download.accept() - console.log("Download accept: " + download.state) - if (download.state === WebEngineDownloadItem.DownloadInterrupted) { - console.log("Download? " + download.state) - console.log("download failed to complete") + if (download.state === WebEngineDownloadItem.DownloadRequested) { + console.log("Download start: " + download.state) + download.accept() + console.log("Download accept: " + download.state) + if (download.state === WebEngineDownloadItem.DownloadInterrupted) { + console.log("Download? " + download.state) + console.log("download failed to complete") + } } }) webview.profile.downloadFinished.connect(function(download){ - console.log("Download Finished: " + download.state) - if (download.state === WebEngineDownloadItem.DownloadCompleted) {console.log("getting download completed state")} - console.log("download success") - File.runUnzip(download.path) + if (download.state === WebEngineDownloadItem.DownloadCompleted) { + console.log("Download Finished: " + download.state) + console.log("File object is: " + File) + File.runUnzip(download.path) + } else { + console.log("The download was corrupted") + } }) }