Refactored certificate class

Split `generateCertificate` into separtate `generateFingerprint`
function, renamed a few functions, removed some unused functions.
This commit is contained in:
Nick Bolton 2015-04-20 19:26:41 +01:00
parent a894615ca7
commit 7e239c6f71
4 changed files with 25 additions and 17 deletions

View File

@ -133,7 +133,7 @@ bool PluginManager::savePlugin()
QFile file(filename); QFile file(filename);
if (!file.open(QIODevice::WriteOnly)) { if (!file.open(QIODevice::WriteOnly)) {
emit error( emit error(
tr("Failed to download plugin '%1' to: %2 \n %3") tr("Failed to download plugin '%1' to: %2\n%3")
.arg(m_PluginList.at(m_DownloadIndex)) .arg(m_PluginList.at(m_DownloadIndex))
.arg(m_PluginDir) .arg(m_PluginDir)
.arg(file.errorString())); .arg(file.errorString()));

View File

@ -44,7 +44,6 @@ public slots:
private: private:
bool savePlugin(); bool savePlugin();
QString getPluginUrl(const QString& pluginName); QString getPluginUrl(const QString& pluginName);
bool checkOpenSslBinary();
bool runProgram( bool runProgram(
const QString& program, const QString& program,
const QStringList& args, const QStringList& args,
@ -57,7 +56,6 @@ signals:
void info(QString i); void info(QString i);
void downloadNext(); void downloadNext();
void downloadFinished(); void downloadFinished();
void openSslBinaryReady();
private: private:
QStringList m_PluginList; QStringList m_PluginList;
@ -66,7 +64,6 @@ private:
int m_DownloadIndex; int m_DownloadIndex;
DataDownloader m_DataDownloader; DataDownloader m_DataDownloader;
CoreInterface m_CoreInterface; CoreInterface m_CoreInterface;
QString m_standardOutput;
SslCertificate m_SslCertificate; SslCertificate m_SslCertificate;
}; };

View File

@ -108,12 +108,12 @@ void PluginWizardPage::finished()
void PluginWizardPage::generateCertificate() void PluginWizardPage::generateCertificate()
{ {
connect(m_pSslCertificate, connect(m_pSslCertificate,
SIGNAL(generateCertificateFinished()), SIGNAL(generateFinished()),
this, this,
SLOT(finished())); SLOT(finished()));
connect(m_pSslCertificate, connect(m_pSslCertificate,
SIGNAL(generateCertificateFinished()), SIGNAL(generateFinished()),
m_pThread, m_pThread,
SLOT(quit())); SLOT(quit()));

View File

@ -1,5 +1,21 @@
#ifndef SSLCERTIFICATE_H /*
#define SSLCERTIFICATE_H * synergy -- mouse and keyboard sharing utility
* Copyright (C) 2015 Synergy Si Ltd.
*
* This package is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* found in the file COPYING that should have accompanied this file.
*
* This package is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "CoreInterface.h" #include "CoreInterface.h"
@ -18,19 +34,14 @@ public slots:
signals: signals:
void error(QString e); void error(QString e);
void info(QString i); void info(QString i);
void generateCertificateFinished(); void generateFinished();
private: private:
bool checkOpenSslBinary(); bool runTool(const QStringList& args);
bool runProgram( void generateFingerprint(const QString& certificateFilename);
const QString& program,
const QStringList& args,
const QStringList& env);
private: private:
QString m_ProfileDir; QString m_ProfileDir;
QString m_standardOutput; QString m_ToolOutput;
CoreInterface m_CoreInterface; CoreInterface m_CoreInterface;
}; };
#endif // SSLCERTIFICATE_H