mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-03 06:02:29 -06:00
Prevent opening local files if web page is expected
This commit is contained in:
committed by
sledgehammer999
parent
22df0b45c5
commit
ad68813fe8
@@ -321,13 +321,13 @@ void SearchJobWidget::downloadTorrents(const AddTorrentOption option)
|
||||
|
||||
void SearchJobWidget::openTorrentPages() const
|
||||
{
|
||||
const QModelIndexList rows {m_ui->resultsBrowser->selectionModel()->selectedRows()};
|
||||
const QModelIndexList rows = m_ui->resultsBrowser->selectionModel()->selectedRows();
|
||||
for (const QModelIndex &rowIndex : rows)
|
||||
{
|
||||
const QString descrLink = m_proxyModel->data(
|
||||
m_proxyModel->index(rowIndex.row(), SearchSortModel::DESC_LINK)).toString();
|
||||
if (!descrLink.isEmpty())
|
||||
QDesktopServices::openUrl(QUrl::fromEncoded(descrLink.toUtf8()));
|
||||
m_proxyModel->index(rowIndex.row(), SearchSortModel::DESC_LINK)).toString();
|
||||
if (const QUrl descrLinkURL {descrLink}; !descrLinkURL.isEmpty() && !descrLinkURL.isLocalFile())
|
||||
QDesktopServices::openUrl(descrLinkURL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user