mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-21 08:09:35 +08:00
Refactor: initialize class variable directly
This commit is contained in:
parent
e4d6fe2d02
commit
e26b30a5f4
@ -396,18 +396,11 @@ QString AbstractWebApplication::saveTmpFile(const QByteArray &data)
|
||||
return QString();
|
||||
}
|
||||
|
||||
QStringMap AbstractWebApplication::initializeContentTypeByExtMap()
|
||||
{
|
||||
QStringMap map;
|
||||
|
||||
map["htm"] = Http::CONTENT_TYPE_HTML;
|
||||
map["html"] = Http::CONTENT_TYPE_HTML;
|
||||
map["css"] = Http::CONTENT_TYPE_CSS;
|
||||
map["gif"] = Http::CONTENT_TYPE_GIF;
|
||||
map["png"] = Http::CONTENT_TYPE_PNG;
|
||||
map["js"] = Http::CONTENT_TYPE_JS;
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
const QStringMap AbstractWebApplication::CONTENT_TYPE_BY_EXT = AbstractWebApplication::initializeContentTypeByExtMap();
|
||||
const QStringMap AbstractWebApplication::CONTENT_TYPE_BY_EXT = {
|
||||
{ "htm", Http::CONTENT_TYPE_HTML },
|
||||
{ "html", Http::CONTENT_TYPE_HTML },
|
||||
{ "css", Http::CONTENT_TYPE_CSS },
|
||||
{ "gif", Http::CONTENT_TYPE_GIF },
|
||||
{ "png", Http::CONTENT_TYPE_PNG },
|
||||
{ "js", Http::CONTENT_TYPE_JS }
|
||||
};
|
||||
|
@ -103,7 +103,6 @@ private:
|
||||
static void translateDocument(QString &data);
|
||||
|
||||
static const QStringMap CONTENT_TYPE_BY_EXT;
|
||||
static QStringMap initializeContentTypeByExtMap();
|
||||
};
|
||||
|
||||
#endif // ABSTRACTWEBAPPLICATION_H
|
||||
|
Loading…
Reference in New Issue
Block a user