From ab187f06da6fc1df75c239489c796dd0c86d5537 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Tue, 6 Dec 2016 10:30:37 +0800 Subject: [PATCH] Fix unused variable warnings --- src/base/net/geoipmanager.cpp | 1 - src/base/net/smtp.cpp | 6 ++++-- src/gui/optionsdlg.cpp | 6 ++++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/base/net/geoipmanager.cpp b/src/base/net/geoipmanager.cpp index 61da07d44..990c2f48c 100644 --- a/src/base/net/geoipmanager.cpp +++ b/src/base/net/geoipmanager.cpp @@ -45,7 +45,6 @@ static const char DATABASE_URL[] = "https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz"; static const char GEOIP_FOLDER[] = "GeoIP"; static const char GEOIP_FILENAME[] = "GeoLite2-Country.mmdb"; -static const int CACHE_SIZE = 1000; static const int UPDATE_INTERVAL = 30; // Days between database updates using namespace Net; diff --git a/src/base/net/smtp.cpp b/src/base/net/smtp.cpp index 2507c5532..fc5810aef 100644 --- a/src/base/net/smtp.cpp +++ b/src/base/net/smtp.cpp @@ -53,7 +53,9 @@ namespace { const short DEFAULT_PORT = 25; +#ifndef QT_NO_OPENSSL const short DEFAULT_PORT_SSL = 465; +#endif QByteArray hmacMD5(QByteArray key, const QByteArray &msg) { @@ -98,12 +100,12 @@ Smtp::Smtp(QObject *parent) , m_authType(AuthPlain) { static bool needToRegisterMetaType = true; - + if (needToRegisterMetaType) { qRegisterMetaType(); needToRegisterMetaType = false; } - + #ifndef QT_NO_OPENSSL m_socket = new QSslSocket(this); #else diff --git a/src/gui/optionsdlg.cpp b/src/gui/optionsdlg.cpp index 5d690a634..ee18a2f36 100644 --- a/src/gui/optionsdlg.cpp +++ b/src/gui/optionsdlg.cpp @@ -1638,6 +1638,9 @@ void OptionsDialog::setSslKey(const QByteArray &key, bool interactive) if (interactive) QMessageBox::warning(this, tr("Invalid key"), tr("This is not a valid SSL key.")); } +#else + Q_UNUSED(key); + Q_UNUSED(interactive); #endif } @@ -1654,6 +1657,9 @@ void OptionsDialog::setSslCertificate(const QByteArray &cert, bool interactive) if (interactive) QMessageBox::warning(this, tr("Invalid certificate"), tr("This is not a valid SSL certificate.")); } +#else + Q_UNUSED(cert); + Q_UNUSED(interactive); #endif }