Fixed: Code style for "OpenSSL" should be "OpenSsl" #4313

This commit is contained in:
Nick Bolton 2015-03-03 08:38:27 +00:00
parent f8847bfde8
commit 68a49e0a3a
2 changed files with 25 additions and 25 deletions

View File

@ -38,11 +38,11 @@ static const char kLinuxProcessorArchRpm64[] = "Linux-x86_64-rpm";
static QString kCertificateLifetime = "365"; static QString kCertificateLifetime = "365";
static QString kCertificateSubjectInfo = "/CN=Synergy"; static QString kCertificateSubjectInfo = "/CN=Synergy";
static QString kCertificateFilename = "Synergy.pem"; static QString kCertificateFilename = "Synergy.pem";
static QString kUnixOpenSSLCommand = "openssl"; static QString kUnixOpenSslCommand = "openssl";
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
static const char kWinPluginExt[] = ".dll"; static const char kWinPluginExt[] = ".dll";
static const char kWinOpenSSLBinary[] = "openssl.exe"; static const char kWinOpenSslBinary[] = "openssl.exe";
#elif defined(Q_OS_MAC) #elif defined(Q_OS_MAC)
static const char kMacPluginPrefix[] = "lib"; static const char kMacPluginPrefix[] = "lib";
@ -100,7 +100,7 @@ void PluginManager::downloadPlugins()
} }
} }
void PluginManager::saveOpenSSLBinary() void PluginManager::saveOpenSslBinary()
{ {
QDir dir(m_ProfileDir); QDir dir(m_ProfileDir);
if (!dir.exists()) { if (!dir.exists()) {
@ -109,7 +109,7 @@ void PluginManager::saveOpenSSLBinary()
QString filename = m_ProfileDir; QString filename = m_ProfileDir;
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
filename.append("\\").append(kWinOpenSSLBinary); filename.append("\\").append(kWinOpenSslBinary);
#endif #endif
@ -124,18 +124,18 @@ void PluginManager::saveOpenSSLBinary()
file.write(m_DataDownloader.data()); file.write(m_DataDownloader.data());
file.close(); file.close();
emit openSSLBinaryReady(); emit openSslBinaryReady();
} }
void PluginManager::generateCertificate() void PluginManager::generateCertificate()
{ {
connect( connect(
this, this,
SIGNAL(openSSLBinaryReady()), SIGNAL(openSslBinaryReady()),
this, this,
SLOT(doGenerateCertificate())); SLOT(doGenerateCertificate()));
downloadOpenSSLBinary(); downloadOpenSslBinary();
} }
void PluginManager::savePlugin() void PluginManager::savePlugin()
@ -221,14 +221,14 @@ QString PluginManager::getPluginUrl(const QString& pluginName)
return result; return result;
} }
QString PluginManager::getOpenSSLBinaryUrl() QString PluginManager::getOpenSslBinaryUrl()
{ {
QString result; QString result;
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
result = kBaseUrl; result = kBaseUrl;
result.append("/tools/"); result.append("/tools/");
result.append(kWinOpenSSLBinary); result.append(kWinOpenSslBinary);
#endif #endif
return result; return result;
@ -247,9 +247,9 @@ QString PluginManager::getPluginOSSpecificName(const QString& pluginName)
return result; return result;
} }
bool PluginManager::checkOpenSSLBinary() bool PluginManager::checkOpenSslBinary()
{ {
// assume OpenSSL is unavailable on Windows, // assume OpenSsl is unavailable on Windows,
// but always available on both Mac and Linux // but always available on both Mac and Linux
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
return false; return false;
@ -258,15 +258,15 @@ bool PluginManager::checkOpenSSLBinary()
#endif #endif
} }
void PluginManager::downloadOpenSSLBinary() void PluginManager::downloadOpenSslBinary()
{ {
if (checkOpenSSLBinary()) { if (checkOpenSslBinary()) {
emit openSSLBinaryReady(); emit openSslBinaryReady();
return; return;
} }
QUrl url; QUrl url;
QString openSslUrl = getOpenSSLBinaryUrl(); QString openSslUrl = getOpenSslBinaryUrl();
url.setUrl(openSslUrl); url.setUrl(openSslUrl);
disconnect( disconnect(
@ -279,18 +279,18 @@ void PluginManager::downloadOpenSSLBinary()
&m_DataDownloader, &m_DataDownloader,
SIGNAL(isComplete()), SIGNAL(isComplete()),
this, this,
SLOT(saveOpenSSLBinary())); SLOT(saveOpenSslBinary()));
m_DataDownloader.download(url); m_DataDownloader.download(url);
} }
void PluginManager::doGenerateCertificate() void PluginManager::doGenerateCertificate()
{ {
QString openSSLFilename = m_ProfileDir; QString openSslFilename = m_ProfileDir;
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
openSSLFilename.append("\\").append(kWinOpenSSLBinary); openSslFilename.append("\\").append(kWinOpenSslBinary);
#else #else
openSSLFilename = kUnixOpenSSLCommand; openSslFilename = kUnixOpenSslCommand;
#endif #endif
QStringList arguments; QStringList arguments;
@ -325,7 +325,7 @@ void PluginManager::doGenerateCertificate()
arguments.append(filename); arguments.append(filename);
QProcess process; QProcess process;
process.start(openSSLFilename, arguments); process.start(openSslFilename, arguments);
bool success = process.waitForStarted(); bool success = process.waitForStarted();
QString standardOutput, standardError; QString standardOutput, standardError;

View File

@ -37,23 +37,23 @@ public:
public slots: public slots:
void downloadPlugins(); void downloadPlugins();
void saveOpenSSLBinary(); void saveOpenSslBinary();
void generateCertificate(); void generateCertificate();
void doGenerateCertificate(); void doGenerateCertificate();
private: private:
void savePlugin(); void savePlugin();
QString getPluginUrl(const QString& pluginName); QString getPluginUrl(const QString& pluginName);
QString getOpenSSLBinaryUrl(); QString getOpenSslBinaryUrl();
QString getPluginOSSpecificName(const QString& pluginName); QString getPluginOSSpecificName(const QString& pluginName);
bool checkOpenSSLBinary(); bool checkOpenSslBinary();
void downloadOpenSSLBinary(); void downloadOpenSslBinary();
signals: signals:
void error(QString e); void error(QString e);
void downloadNext(); void downloadNext();
void downloadFinished(); void downloadFinished();
void openSSLBinaryReady(); void openSslBinaryReady();
void generateCertificateFinished(); void generateCertificateFinished();
private: private: