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) {
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;

2
src/webui/httprequestparser.cpp

@ -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;
} }

2
src/webui/httprequestparser.h

@ -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…
Cancel
Save