mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
Prevent opening local files if web page is expected
This commit is contained in:
parent
71af105a89
commit
d379fa3035
3 changed files with 16 additions and 16 deletions
|
@ -48,16 +48,16 @@ const QString Article::KeyIsRead = u"isRead"_s;
|
||||||
|
|
||||||
Article::Article(Feed *feed, const QVariantHash &varHash)
|
Article::Article(Feed *feed, const QVariantHash &varHash)
|
||||||
: QObject(feed)
|
: QObject(feed)
|
||||||
, m_feed(feed)
|
, m_feed {feed}
|
||||||
, m_guid(varHash.value(KeyId).toString())
|
, m_guid {varHash.value(KeyId).toString()}
|
||||||
, m_date(varHash.value(KeyDate).toDateTime())
|
, m_date {varHash.value(KeyDate).toDateTime()}
|
||||||
, m_title(varHash.value(KeyTitle).toString())
|
, m_title {varHash.value(KeyTitle).toString()}
|
||||||
, m_author(varHash.value(KeyAuthor).toString())
|
, m_author {varHash.value(KeyAuthor).toString()}
|
||||||
, m_description(varHash.value(KeyDescription).toString())
|
, m_description {varHash.value(KeyDescription).toString()}
|
||||||
, m_torrentURL(varHash.value(KeyTorrentURL).toString())
|
, m_torrentURL {varHash.value(KeyTorrentURL).toString()}
|
||||||
, m_link(varHash.value(KeyLink).toString())
|
, m_link {varHash.value(KeyLink).toString()}
|
||||||
, m_isRead(varHash.value(KeyIsRead, false).toBool())
|
, m_isRead {varHash.value(KeyIsRead, false).toBool()}
|
||||||
, m_data(varHash)
|
, m_data {varHash}
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -441,8 +441,8 @@ void RSSWidget::openSelectedArticlesUrls()
|
||||||
// Mark as read
|
// Mark as read
|
||||||
article->markAsRead();
|
article->markAsRead();
|
||||||
|
|
||||||
if (!article->link().isEmpty())
|
if (const QUrl articleLink {article->link()}; !articleLink.isEmpty() && !articleLink.isLocalFile())
|
||||||
QDesktopServices::openUrl(QUrl(article->link()));
|
QDesktopServices::openUrl(articleLink);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -321,13 +321,13 @@ void SearchJobWidget::downloadTorrents(const AddTorrentOption option)
|
||||||
|
|
||||||
void SearchJobWidget::openTorrentPages() const
|
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)
|
for (const QModelIndex &rowIndex : rows)
|
||||||
{
|
{
|
||||||
const QString descrLink = m_proxyModel->data(
|
const QString descrLink = m_proxyModel->data(
|
||||||
m_proxyModel->index(rowIndex.row(), SearchSortModel::DESC_LINK)).toString();
|
m_proxyModel->index(rowIndex.row(), SearchSortModel::DESC_LINK)).toString();
|
||||||
if (!descrLink.isEmpty())
|
if (const QUrl descrLinkURL {descrLink}; !descrLinkURL.isEmpty() && !descrLinkURL.isLocalFile())
|
||||||
QDesktopServices::openUrl(QUrl::fromEncoded(descrLink.toUtf8()));
|
QDesktopServices::openUrl(descrLinkURL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue