Browse Source

Web UI code optimization

adaptive-webui-19844
Christophe Dumez 13 years ago
parent
commit
f98d4e9149
  1. 2
      src/webui/httpconnection.cpp
  2. 2
      src/webui/httprequestparser.cpp
  3. 2
      src/webui/httprequestparser.h

2
src/webui/httpconnection.cpp

@ -403,7 +403,7 @@ void HttpConnection::respondCommand(const QString& command) { @@ -403,7 +403,7 @@ void HttpConnection::respondCommand(const QString& command) {
tmpfile->write(m_parser.torrent());
tmpfile->close();
emit torrentReadyToBeDownloaded(tmpfile->fileName(), false, QString(), false);
delete tmpfile;
tmpfile->deleteLater();
} else {
std::cerr << "I/O Error: Could not create temporary file" << std::endl;
delete tmpfile;

2
src/webui/httprequestparser.cpp

@ -61,7 +61,7 @@ QString HttpRequestParser::post(const QString& key) const { @@ -61,7 +61,7 @@ QString HttpRequestParser::post(const QString& key) const {
return m_postMap.value(key);
}
QByteArray HttpRequestParser::torrent() const {
const QByteArray& HttpRequestParser::torrent() const {
return m_torrentContent;
}

2
src/webui/httprequestparser.h

@ -44,7 +44,7 @@ public: @@ -44,7 +44,7 @@ public:
QByteArray message() const;
QString get(const QString& key) const;
QString post(const QString& key) const;
QByteArray torrent() const;
const QByteArray& torrent() const;
void write(const QByteArray& ba);
inline QHttpRequestHeader& header() { return m_header; }

Loading…
Cancel
Save