1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-22 12:34:19 +00:00

- Display favicon in Web UI

This commit is contained in:
Christophe Dumez 2010-01-14 12:37:19 +00:00
parent 93c644da88
commit 2707aa2818

View File

@ -140,6 +140,21 @@ void HttpConnection::respond()
return; return;
} }
QString url = parser.url(); QString url = parser.url();
// Favicon
if(url.endsWith("favicon.ico")) {
qDebug("Returning favicon");
QFile favicon(":/Icons/skin/qbittorrent16.png");
if(favicon.open(QIODevice::ReadOnly)) {
QByteArray data = favicon.readAll();
generator.setStatusLine(200, "OK");
generator.setContentTypeByExt("png");
generator.setMessage(data);
write();
} else {
respondNotFound();
}
return;
}
QStringList list = url.split('/', QString::SkipEmptyParts); QStringList list = url.split('/', QString::SkipEmptyParts);
if (list.contains(".") || list.contains("..")) if (list.contains(".") || list.contains(".."))
{ {