1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-19 18:26:34 +01:00

Fix compilation against Qt 6.7

QUrl::fromEncoded(const QByteArray &url...) is removed in Qt 6.7 in
favor of QUrl::fromEncoded(QByteArrayView input...).
Wrap the corresponding argument in QByteArray() to make the cast explicit.
This is backwards-compatible with old Qt versions.

See qt/qtbase commit aa481854a98b1be0a061257ae4e817adcf1f77fc

BUG: 478857
This commit is contained in:
Yifan Zhu 2023-12-21 17:23:47 -08:00 committed by Juraj Oravec
parent 10977578a9
commit 0681dccfcc
3 changed files with 4 additions and 4 deletions

View File

@ -177,7 +177,7 @@ void MainMenu::savePageAs()
void MainMenu::sendLink()
{
const QUrl mailUrl = QUrl::fromEncoded("mailto:%20?body=" + QUrl::toPercentEncoding(QString::fromUtf8(m_window->weView()->url().toEncoded())) + "&subject=" + QUrl::toPercentEncoding(m_window->weView()->title()));
const QUrl mailUrl = QUrl::fromEncoded(QByteArray("mailto:%20?body=" + QUrl::toPercentEncoding(QString::fromUtf8(m_window->weView()->url().toEncoded())) + "&subject=" + QUrl::toPercentEncoding(m_window->weView()->title())));
QDesktopServices::openUrl(mailUrl);
}

View File

@ -157,5 +157,5 @@ void Updater::downCompleted()
void Updater::downloadNewVersion()
{
m_window->tabWidget()->addView(QUrl::fromEncoded(QByteArray(Qz::WWWADDRESS) + QByteArray("/download")), tr("Update"), Qz::NT_NotSelectedTab);
m_window->tabWidget()->addView(QUrl::fromEncoded(QByteArray(QByteArray(Qz::WWWADDRESS) + QByteArray("/download"))), tr("Update"), Qz::NT_NotSelectedTab);
}

View File

@ -475,14 +475,14 @@ void WebView::openUrlInNewWindow()
void WebView::sendTextByMail()
{
if (auto* action = qobject_cast<QAction*>(sender())) {
const QUrl mailUrl = QUrl::fromEncoded("mailto:%20?body=" + QUrl::toPercentEncoding(action->data().toString()));
const QUrl mailUrl = QUrl::fromEncoded(QByteArray("mailto:%20?body=" + QUrl::toPercentEncoding(action->data().toString())));
QDesktopServices::openUrl(mailUrl);
}
}
void WebView::sendPageByMail()
{
const QUrl mailUrl = QUrl::fromEncoded("mailto:%20?body=" + QUrl::toPercentEncoding(QString::fromUtf8(url().toEncoded())) + "&subject=" + QUrl::toPercentEncoding(title()));
const QUrl mailUrl = QUrl::fromEncoded(QByteArray("mailto:%20?body=" + QUrl::toPercentEncoding(QString::fromUtf8(url().toEncoded())) + "&subject=" + QUrl::toPercentEncoding(title())));
QDesktopServices::openUrl(mailUrl);
}