mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +01:00
WebPage: Make the loadFinished workaround for all Qt 5.10 versions
See #2479
This commit is contained in:
parent
99eb9c8089
commit
9e3423ff9e
|
@ -82,7 +82,7 @@ void WebViewTest::loadSignalsChangePageTest()
|
||||||
view.setPage(page2);
|
view.setPage(page2);
|
||||||
|
|
||||||
// WebPage: Workaround for broken load started/finished signals in QtWebEngine 5.10
|
// WebPage: Workaround for broken load started/finished signals in QtWebEngine 5.10
|
||||||
const int loadFinishedEmitCount = qstrcmp(qVersion(), "5.10.0") == 0 ? 2 : 1;
|
const int loadFinishedEmitCount = qstrncmp(qVersion(), "5.10.", 5) == 0 ? 2 : 1;
|
||||||
|
|
||||||
QTRY_COMPARE(loadFinishedSpy.count(), loadFinishedEmitCount);
|
QTRY_COMPARE(loadFinishedSpy.count(), loadFinishedEmitCount);
|
||||||
QCOMPARE(loadStartedSpy.count(), 0);
|
QCOMPARE(loadStartedSpy.count(), 0);
|
||||||
|
|
|
@ -100,7 +100,7 @@ WebPage::WebPage(QObject* parent)
|
||||||
});
|
});
|
||||||
|
|
||||||
// Workaround for broken load started/finished signals in QtWebEngine 5.10
|
// Workaround for broken load started/finished signals in QtWebEngine 5.10
|
||||||
if (qstrcmp(qVersion(), "5.10.0") == 0) {
|
if (qstrncmp(qVersion(), "5.10.", 5) == 0) {
|
||||||
connect(this, &QWebEnginePage::loadProgress, this, [this](int progress) {
|
connect(this, &QWebEnginePage::loadProgress, this, [this](int progress) {
|
||||||
if (progress == 100) {
|
if (progress == 100) {
|
||||||
emit loadFinished(true);
|
emit loadFinished(true);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user