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);
if (!file.open(QIODevice::WriteOnly)) {
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_PluginDir)
.arg(file.errorString()));

View File

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

View File

@ -108,12 +108,12 @@ void PluginWizardPage::finished()
void PluginWizardPage::generateCertificate()
{
connect(m_pSslCertificate,
SIGNAL(generateCertificateFinished()),
SIGNAL(generateFinished()),
this,
SLOT(finished()));
connect(m_pSslCertificate,
SIGNAL(generateCertificateFinished()),
SIGNAL(generateFinished()),
m_pThread,
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"
@ -18,19 +34,14 @@ public slots:
signals:
void error(QString e);
void info(QString i);
void generateCertificateFinished();
void generateFinished();
private:
bool checkOpenSslBinary();
bool runProgram(
const QString& program,
const QStringList& args,
const QStringList& env);
bool runTool(const QStringList& args);
void generateFingerprint(const QString& certificateFilename);
private:
QString m_ProfileDir;
QString m_standardOutput;
QString m_ToolOutput;
CoreInterface m_CoreInterface;
};
#endif // SSLCERTIFICATE_H