mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 07:18:08 +00:00
Clean up Web UI code
This commit is contained in:
parent
61faf34ef7
commit
5fe562c0fa
@ -104,7 +104,7 @@ void HttpConnection::write() {
|
|||||||
void HttpConnection::translateDocument(QString& data) {
|
void HttpConnection::translateDocument(QString& data) {
|
||||||
static QRegExp regex(QString::fromUtf8("_\\(([\\w\\s?!:\\/\\(\\),%µ&\\-\\.]+)\\)"));
|
static QRegExp regex(QString::fromUtf8("_\\(([\\w\\s?!:\\/\\(\\),%µ&\\-\\.]+)\\)"));
|
||||||
static QRegExp mnemonic("\\(?&([a-zA-Z]?\\))?");
|
static QRegExp mnemonic("\\(?&([a-zA-Z]?\\))?");
|
||||||
std::string contexts[] = {"TransferListFiltersWidget", "TransferListWidget",
|
const std::string contexts[] = {"TransferListFiltersWidget", "TransferListWidget",
|
||||||
"PropertiesWidget", "MainWindow", "HttpServer",
|
"PropertiesWidget", "MainWindow", "HttpServer",
|
||||||
"confirmDeletionDlg", "TrackerList", "TorrentFilesModel",
|
"confirmDeletionDlg", "TrackerList", "TorrentFilesModel",
|
||||||
"options_imp", "Preferences", "TrackersAdditionDlg",
|
"options_imp", "Preferences", "TrackersAdditionDlg",
|
||||||
|
@ -41,10 +41,6 @@ void HttpResponseGenerator::setMessage(const QString& message) {
|
|||||||
setMessage(message.toUtf8());
|
setMessage(message.toUtf8());
|
||||||
}
|
}
|
||||||
|
|
||||||
void HttpResponseGenerator::stripMessage() {
|
|
||||||
message.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
void HttpResponseGenerator::setContentTypeByExt(const QString& ext) {
|
void HttpResponseGenerator::setContentTypeByExt(const QString& ext) {
|
||||||
if(ext == "css") {
|
if(ext == "css") {
|
||||||
setContentType("text/css");
|
setContentType("text/css");
|
||||||
|
@ -40,10 +40,9 @@ class HttpResponseGenerator : public QHttpResponseHeader
|
|||||||
public:
|
public:
|
||||||
void setMessage(const QByteArray& message);
|
void setMessage(const QByteArray& message);
|
||||||
void setMessage(const QString& message);
|
void setMessage(const QString& message);
|
||||||
void stripMessage();
|
|
||||||
void setContentTypeByExt(const QString& ext);
|
void setContentTypeByExt(const QString& ext);
|
||||||
inline QByteArray toByteArray() const {
|
inline QByteArray toByteArray() const {
|
||||||
return QHttpResponseHeader::toString().toLocal8Bit() + message;
|
return QHttpResponseHeader::toString().toUtf8() + message;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user