1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

Use runtime Qt version instead of define where appropriate

This commit is contained in:
David Rosca 2016-10-24 21:10:15 +02:00
parent cf3fa88942
commit e1c97e1a6d
3 changed files with 8 additions and 5 deletions

View File

@ -382,7 +382,7 @@ QString QupZillaSchemeReply::configPage()
Qz::VERSION
#endif
) +
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Qt version"), QT_VERSION_STR) +
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Qt version"), qVersion()) +
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Platform"), QzTools::operatingSystemLong()));
cPage.replace(QLatin1String("%PATHS-TEXT%"),

View File

@ -1,6 +1,6 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2010-2014 David Rosca <nowrep@gmail.com>
* Copyright (C) 2010-2016 David Rosca <nowrep@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -73,7 +73,7 @@ void AboutDialog::showAbout()
Qz::VERSION
#endif
);
m_aboutHtml += tr("<b>QtWebEngine version %1</b></p>").arg(QT_VERSION_STR);
m_aboutHtml += tr("<b>QtWebEngine version %1</b></p>").arg(qVersion());
m_aboutHtml += QString("<p>&copy; %1 %2<br/>").arg(Qz::COPYRIGHT, Qz::AUTHOR);
m_aboutHtml += QString("<a href=%1>%1</a></p>").arg(Qz::WWWADDRESS);
m_aboutHtml += "<p>" + mApp->userAgentManager()->defaultUserAgent() + "</p>";

View File

@ -370,7 +370,11 @@ void WebPage::renderProcessTerminated(QWebEnginePage::RenderProcessTerminationSt
if (terminationStatus == NormalTerminationStatus)
return;
#if QT_VERSION != QT_VERSION_CHECK(5, 7, 0) // Crashes with QtWebEngine 5.7.0
if (qstrcmp(qVersion(), "5.7.0") == 0) {
// Crashes with QtWebEngine 5.7.0
return;
}
QTimer::singleShot(0, this, [this]() {
QString page = QzTools::readAllFileContents(":html/tabcrash.html");
page.replace(QL1S("%IMAGE%"), QzTools::pixmapToDataUrl(IconProvider::standardIcon(QStyle::SP_MessageBoxWarning).pixmap(45)).toString());
@ -384,7 +388,6 @@ void WebPage::renderProcessTerminated(QWebEnginePage::RenderProcessTerminationSt
page = QzTools::applyDirectionToPage(page);
setHtml(page.toUtf8(), url());
});
#endif
}
bool WebPage::acceptNavigationRequest(const QUrl &url, QWebEnginePage::NavigationType type, bool isMainFrame)