Migrate everything to use the new Preferences class and not access directly the qbittorrent.ini file.(webui)

This commit is contained in:
sledgehammer999
2014-07-05 15:38:17 +03:00
parent d8d95d2195
commit 15d3df380c
3 changed files with 147 additions and 145 deletions

View File

@@ -91,18 +91,18 @@ void HttpServer::resetNbFailedAttemptsForIp(const QString& ip) {
HttpServer::HttpServer(QObject* parent) : QTcpServer(parent)
{
const Preferences pref;
const Preferences* const pref = Preferences::instance();
m_username = pref.getWebUiUsername().toUtf8();
m_passwordSha1 = pref.getWebUiPassword().toUtf8();
m_localAuthEnabled = pref.isWebUiLocalAuthEnabled();
m_username = pref->getWebUiUsername().toUtf8();
m_passwordSha1 = pref->getWebUiPassword().toUtf8();
m_localAuthEnabled = pref->isWebUiLocalAuthEnabled();
// HTTPS-related
#ifndef QT_NO_OPENSSL
m_https = pref.isWebUiHttpsEnabled();
m_https = pref->isWebUiHttpsEnabled();
if (m_https) {
m_certificate = QSslCertificate(pref.getWebUiHttpsCertificate());
m_key = QSslKey(pref.getWebUiHttpsKey(), QSsl::Rsa);
m_certificate = QSslCertificate(pref->getWebUiHttpsCertificate());
m_key = QSslKey(pref->getWebUiHttpsKey(), QSsl::Rsa);
}
#endif