Merge pull request #12774 from howard-stearns/RC66-commerce-workaround-for-broken-qt5.10

Rc66 commerce workaround for broken qt5.10
This commit is contained in:
John Conklin II 2018-04-04 11:39:44 -07:00 committed by GitHub
commit c3cad62bff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 4 deletions

View file

@ -122,9 +122,21 @@ Item {
newViewRequestedCallback(request) newViewRequestedCallback(request)
} }
// Prior to 5.10, the WebEngineView loading property is true during initial page loading and then stays false
// as in-page javascript adds more html content. However, in 5.10 there is a bug such that adding html turns
// loading true, and never turns it false again. safeLoading provides a workaround, but it should be removed
// when QT fixes this.
property bool safeLoading: false
property bool loadingLatched: false
property var loadingRequest: null
onLoadingChanged: { onLoadingChanged: {
flick.onLoadingChanged(loadRequest) webViewCore.loadingRequest = loadRequest;
loadingChangedCallback(loadRequest) webViewCore.safeLoading = webViewCore.loading && !loadingLatched;
webViewCore.loadingLatched |= webViewCore.loading;
}
onSafeLoadingChanged: {
flick.onLoadingChanged(webViewCore.loadingRequest)
loadingChangedCallback(webViewCore.loadingRequest)
} }
} }
@ -133,7 +145,7 @@ Item {
x: flick.width/2 - width/2 x: flick.width/2 - width/2
y: flick.height/2 - height/2 y: flick.height/2 - height/2
source: "../../icons/loader-snake-64-w.gif" source: "../../icons/loader-snake-64-w.gif"
visible: webViewCore.loading && /^(http.*|)$/i.test(webViewCore.url.toString()) visible: webViewCore.safeLoading && /^(http.*|)$/i.test(webViewCore.url.toString())
playing: visible playing: visible
z: 10000 z: 10000
} }

View file

@ -40,7 +40,7 @@
} }
function onScreenChanged(type, url) { function onScreenChanged(type, url) {
onHelpScreen = type === "Web" && url.startsWith(HELP_URL); onHelpScreen = type === "Web" && (url.indexOf(HELP_URL) === 0);
button.editProperties({ isActive: onHelpScreen }); button.editProperties({ isActive: onHelpScreen });
} }