Browse Source

Merge pull request #8531 from Chocobo1/https

Improve URL scheme handling
adaptive-webui-19844
Mike Tzou 7 years ago committed by GitHub
parent
commit
b0781e820c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/gui/advancedsettings.cpp
  2. 16
      src/gui/transferlistfilterswidget.cpp

2
src/gui/advancedsettings.cpp

@ -289,7 +289,7 @@ void AdvancedSettings::loadAdvancedSettings()
addRow(LIBTORRENT_HEADER, tr("libtorrent Section"), &labelLibtorrentLink); addRow(LIBTORRENT_HEADER, tr("libtorrent Section"), &labelLibtorrentLink);
item(LIBTORRENT_HEADER, PROPERTY)->setFont(boldFont); item(LIBTORRENT_HEADER, PROPERTY)->setFont(boldFont);
labelLibtorrentLink.setText(QString("<a href=\"%1\">%2</a>").arg("http://www.libtorrent.org/reference.html").arg(tr("Open documentation"))); labelLibtorrentLink.setText(QString("<a href=\"%1\">%2</a>").arg("https://www.libtorrent.org/reference.html").arg(tr("Open documentation")));
labelLibtorrentLink.setOpenExternalLinks(true); labelLibtorrentLink.setOpenExternalLinks(true);
// Disk write cache // Disk write cache
spin_cache.setMinimum(-1); spin_cache.setMinimum(-1);

16
src/gui/transferlistfilterswidget.cpp

@ -59,7 +59,19 @@
#include "transferlistwidget.h" #include "transferlistwidget.h"
#include "utils.h" #include "utils.h"
const QLatin1String GOOGLE_FAVICON_URL("https://www.google.com/s2/favicons?domain="); namespace
{
QString getScheme(const QString &tracker)
{
const QUrl url {tracker};
QString scheme = url.scheme();
if (scheme.isEmpty())
scheme = "http";
return scheme;
}
const QLatin1String GOOGLE_FAVICON_URL("https://www.google.com/s2/favicons?domain=");
}
FiltersBase::FiltersBase(QWidget *parent, TransferListWidget *transferList) FiltersBase::FiltersBase(QWidget *parent, TransferListWidget *transferList)
: QListWidget(parent) : QListWidget(parent)
@ -237,7 +249,7 @@ void TrackerFiltersList::addItem(const QString &tracker, const QString &hash)
trackerItem = new QListWidgetItem(); trackerItem = new QListWidgetItem();
trackerItem->setData(Qt::DecorationRole, GuiIconProvider::instance()->getIcon("network-server")); trackerItem->setData(Qt::DecorationRole, GuiIconProvider::instance()->getIcon("network-server"));
downloadFavicon(QString("http://%1/favicon.ico").arg(host)); downloadFavicon(QString("%1://%2/favicon.ico").arg(getScheme(tracker), host));
} }
if (!trackerItem) return; if (!trackerItem) return;

Loading…
Cancel
Save