From 5fe562c0fa96acc656451648e2010182c177b577 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 25 Sep 2011 14:37:04 +0300 Subject: [PATCH] Clean up Web UI code --- src/webui/httpconnection.cpp | 2 +- src/webui/httpresponsegenerator.cpp | 4 ---- src/webui/httpresponsegenerator.h | 3 +-- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/webui/httpconnection.cpp b/src/webui/httpconnection.cpp index 76cc4ad2d..5da07a4f2 100644 --- a/src/webui/httpconnection.cpp +++ b/src/webui/httpconnection.cpp @@ -104,7 +104,7 @@ void HttpConnection::write() { void HttpConnection::translateDocument(QString& data) { static QRegExp regex(QString::fromUtf8("_\\(([\\w\\s?!:\\/\\(\\),%ยต&\\-\\.]+)\\)")); static QRegExp mnemonic("\\(?&([a-zA-Z]?\\))?"); - std::string contexts[] = {"TransferListFiltersWidget", "TransferListWidget", + const std::string contexts[] = {"TransferListFiltersWidget", "TransferListWidget", "PropertiesWidget", "MainWindow", "HttpServer", "confirmDeletionDlg", "TrackerList", "TorrentFilesModel", "options_imp", "Preferences", "TrackersAdditionDlg", diff --git a/src/webui/httpresponsegenerator.cpp b/src/webui/httpresponsegenerator.cpp index 2ea920f06..c18512971 100644 --- a/src/webui/httpresponsegenerator.cpp +++ b/src/webui/httpresponsegenerator.cpp @@ -41,10 +41,6 @@ void HttpResponseGenerator::setMessage(const QString& message) { setMessage(message.toUtf8()); } -void HttpResponseGenerator::stripMessage() { - message.clear(); -} - void HttpResponseGenerator::setContentTypeByExt(const QString& ext) { if(ext == "css") { setContentType("text/css"); diff --git a/src/webui/httpresponsegenerator.h b/src/webui/httpresponsegenerator.h index 62ba9e092..e86cfa7dc 100644 --- a/src/webui/httpresponsegenerator.h +++ b/src/webui/httpresponsegenerator.h @@ -40,10 +40,9 @@ class HttpResponseGenerator : public QHttpResponseHeader public: void setMessage(const QByteArray& message); void setMessage(const QString& message); - void stripMessage(); void setContentTypeByExt(const QString& ext); inline QByteArray toByteArray() const { - return QHttpResponseHeader::toString().toLocal8Bit() + message; + return QHttpResponseHeader::toString().toUtf8() + message; } private: