mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-10 14:57:52 +00:00
Web UI code optimization
This commit is contained in:
parent
dad1568657
commit
f98d4e9149
@ -403,7 +403,7 @@ void HttpConnection::respondCommand(const QString& command) {
|
|||||||
tmpfile->write(m_parser.torrent());
|
tmpfile->write(m_parser.torrent());
|
||||||
tmpfile->close();
|
tmpfile->close();
|
||||||
emit torrentReadyToBeDownloaded(tmpfile->fileName(), false, QString(), false);
|
emit torrentReadyToBeDownloaded(tmpfile->fileName(), false, QString(), false);
|
||||||
delete tmpfile;
|
tmpfile->deleteLater();
|
||||||
} else {
|
} else {
|
||||||
std::cerr << "I/O Error: Could not create temporary file" << std::endl;
|
std::cerr << "I/O Error: Could not create temporary file" << std::endl;
|
||||||
delete tmpfile;
|
delete tmpfile;
|
||||||
|
@ -61,7 +61,7 @@ QString HttpRequestParser::post(const QString& key) const {
|
|||||||
return m_postMap.value(key);
|
return m_postMap.value(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray HttpRequestParser::torrent() const {
|
const QByteArray& HttpRequestParser::torrent() const {
|
||||||
return m_torrentContent;
|
return m_torrentContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ public:
|
|||||||
QByteArray message() const;
|
QByteArray message() const;
|
||||||
QString get(const QString& key) const;
|
QString get(const QString& key) const;
|
||||||
QString post(const QString& key) const;
|
QString post(const QString& key) const;
|
||||||
QByteArray torrent() const;
|
const QByteArray& torrent() const;
|
||||||
void write(const QByteArray& ba);
|
void write(const QByteArray& ba);
|
||||||
inline QHttpRequestHeader& header() { return m_header; }
|
inline QHttpRequestHeader& header() { return m_header; }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user