mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 23:17:21 -06:00
Web UI code optimization
This commit is contained in:
@@ -97,6 +97,8 @@ HttpServer::HttpServer(int msec, QObject* parent) : QTcpServer(parent),
|
||||
m_username = pref.getWebUiUsername().toLocal8Bit();
|
||||
m_passwordSha1 = pref.getWebUiPassword().toLocal8Bit();
|
||||
m_localAuthEnabled = pref.isWebUiLocalAuthEnabled();
|
||||
m_needsTranslation = !Preferences().getLocale().startsWith("en");
|
||||
connect(m_eventManager, SIGNAL(localeChanged(QString)), SLOT(onLocaleChanged(QString)));
|
||||
|
||||
// HTTPS-related
|
||||
#ifndef QT_NO_OPENSSL
|
||||
@@ -337,3 +339,11 @@ void HttpServer::setlocalAuthEnabled(bool enabled) {
|
||||
bool HttpServer::isLocalAuthEnabled() const {
|
||||
return m_localAuthEnabled;
|
||||
}
|
||||
|
||||
bool HttpServer::isTranslationNeeded() {
|
||||
return m_needsTranslation;
|
||||
}
|
||||
|
||||
void HttpServer::onLocaleChanged(const QString &locale) {
|
||||
m_needsTranslation = !locale.startsWith("en");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user