mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-27 08:19:30 +08:00
Web UI code clean up
This commit is contained in:
parent
3f4947259b
commit
4be897a4e5
@ -238,7 +238,7 @@ void HttpConnection::respond() {
|
||||
}
|
||||
}
|
||||
if (list[0] == "command") {
|
||||
QString command = list[1];
|
||||
const QString& command = list[1];
|
||||
respondCommand(command);
|
||||
m_generator.setStatusLine(200, "OK");
|
||||
write();
|
||||
@ -361,8 +361,7 @@ void HttpConnection::respondGlobalTransferInfoJson() {
|
||||
|
||||
void HttpConnection::respondCommand(const QString& command)
|
||||
{
|
||||
if(command == "download")
|
||||
{
|
||||
if(command == "download") {
|
||||
QString urls = m_parser.post("urls");
|
||||
QStringList list = urls.split('\n');
|
||||
foreach(QString url, list){
|
||||
@ -382,6 +381,7 @@ void HttpConnection::respondCommand(const QString& command)
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if(command == "addTrackers") {
|
||||
QString hash = m_parser.post("hash");
|
||||
if(!hash.isEmpty()) {
|
||||
@ -451,7 +451,7 @@ void HttpConnection::respondCommand(const QString& command)
|
||||
m_generator.setStatusLine(200, "OK");
|
||||
m_generator.setContentTypeByExt("html");
|
||||
#if LIBTORRENT_VERSION_MINOR > 15
|
||||
generator.setMessage(QString::number(QBtSession::instance()->getSession()->settings().upload_rate_limit));
|
||||
m_generator.setMessage(QString::number(QBtSession::instance()->getSession()->settings().upload_rate_limit));
|
||||
#else
|
||||
m_generator.setMessage(QString::number(QBtSession::instance()->getSession()->upload_rate_limit()));
|
||||
#endif
|
||||
@ -461,7 +461,7 @@ void HttpConnection::respondCommand(const QString& command)
|
||||
m_generator.setStatusLine(200, "OK");
|
||||
m_generator.setContentTypeByExt("html");
|
||||
#if LIBTORRENT_VERSION_MINOR > 15
|
||||
generator.setMessage(QString::number(QBtSession::instance()->getSession()->settings().download_rate_limit));
|
||||
m_generator.setMessage(QString::number(QBtSession::instance()->getSession()->settings().download_rate_limit));
|
||||
#else
|
||||
m_generator.setMessage(QString::number(QBtSession::instance()->getSession()->download_rate_limit()));
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user