Browse Source

Clean up Web UI code

adaptive-webui-19844
Christophe Dumez 13 years ago
parent
commit
5fe562c0fa
  1. 2
      src/webui/httpconnection.cpp
  2. 4
      src/webui/httpresponsegenerator.cpp
  3. 3
      src/webui/httpresponsegenerator.h

2
src/webui/httpconnection.cpp

@ -104,7 +104,7 @@ void HttpConnection::write() { @@ -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",

4
src/webui/httpresponsegenerator.cpp

@ -41,10 +41,6 @@ void HttpResponseGenerator::setMessage(const QString& message) { @@ -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");

3
src/webui/httpresponsegenerator.h

@ -40,10 +40,9 @@ class HttpResponseGenerator : public QHttpResponseHeader @@ -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:

Loading…
Cancel
Save