Browse Source

Rename class variables

adaptive-webui-19844
Chocobo1 8 years ago
parent
commit
05d8c46bb0
  1. 42
      src/webui/webui.cpp
  2. 6
      src/webui/webui.h

42
src/webui/webui.cpp

@ -64,13 +64,13 @@ void WebUI::init() @@ -64,13 +64,13 @@ void WebUI::init()
}
// http server
if (!httpServer_) {
webapp_ = new WebApplication(this);
httpServer_ = new Http::Server(webapp_, this);
if (!m_httpServer) {
m_webapp = new WebApplication(this);
m_httpServer = new Http::Server(m_webapp, this);
}
else {
if (httpServer_->serverPort() != m_port)
httpServer_->close();
if (m_httpServer->serverPort() != m_port)
m_httpServer->close();
}
#ifndef QT_NO_OPENSSL
@ -84,17 +84,17 @@ void WebUI::init() @@ -84,17 +84,17 @@ void WebUI::init()
const bool areCertsValid = !certs.empty() && std::all_of(certs.begin(), certs.end(), [](QSslCertificate c) { return !c.isNull(); });
if (!key.isNull() && areCertsValid)
httpServer_->enableHttps(certs, key);
m_httpServer->enableHttps(certs, key);
else
httpServer_->disableHttps();
m_httpServer->disableHttps();
}
else {
httpServer_->disableHttps();
m_httpServer->disableHttps();
}
#endif
if (!httpServer_->isListening()) {
bool success = httpServer_->listen(QHostAddress::Any, m_port);
if (!m_httpServer->isListening()) {
bool success = m_httpServer->listen(QHostAddress::Any, m_port);
if (success)
logger->addMessage(tr("Web UI: Now listening on port %1").arg(m_port));
else
@ -103,26 +103,26 @@ void WebUI::init() @@ -103,26 +103,26 @@ void WebUI::init()
// DynDNS
if (pref->isDynDNSEnabled()) {
if (!dynDNSUpdater_)
dynDNSUpdater_ = new Net::DNSUpdater(this);
if (!m_dnsUpdater)
m_dnsUpdater = new Net::DNSUpdater(this);
else
dynDNSUpdater_->updateCredentials();
m_dnsUpdater->updateCredentials();
}
else {
if (dynDNSUpdater_)
delete dynDNSUpdater_;
if (m_dnsUpdater)
delete m_dnsUpdater;
}
}
else {
Net::PortForwarder::instance()->deletePort(oldPort);
if (httpServer_)
delete httpServer_;
if (m_httpServer)
delete m_httpServer;
if (webapp_)
delete webapp_;
if (m_webapp)
delete m_webapp;
if (dynDNSUpdater_)
delete dynDNSUpdater_;
if (m_dnsUpdater)
delete m_dnsUpdater;
}
}

6
src/webui/webui.h

@ -55,9 +55,9 @@ private slots: @@ -55,9 +55,9 @@ private slots:
void init();
private:
QPointer<Http::Server> httpServer_;
QPointer<Net::DNSUpdater> dynDNSUpdater_;
QPointer<AbstractWebApplication> webapp_;
QPointer<Http::Server> m_httpServer;
QPointer<Net::DNSUpdater> m_dnsUpdater;
QPointer<AbstractWebApplication> m_webapp;
quint16 m_port;
};

Loading…
Cancel
Save