Browse Source

- Display favicon in Web UI

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
2707aa2818
  1. 15
      src/httpconnection.cpp

15
src/httpconnection.cpp

@ -140,6 +140,21 @@ void HttpConnection::respond() @@ -140,6 +140,21 @@ void HttpConnection::respond()
return;
}
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);
if (list.contains(".") || list.contains(".."))
{

Loading…
Cancel
Save