refactor: Mainwindow localFingerPrintDb => localFingerprintDb
This commit is contained in:
parent
9294f2a026
commit
ad79ba907d
2 changed files with 12 additions and 7 deletions
|
|
@ -156,13 +156,13 @@ MainWindow::MainWindow(ConfigScopes &configScopes, AppConfig &appConfig)
|
||||||
|
|
||||||
// Force generation of SHA256 for the localhost
|
// Force generation of SHA256 for the localhost
|
||||||
if (m_appConfig.tlsEnabled()) {
|
if (m_appConfig.tlsEnabled()) {
|
||||||
if (!QFile::exists(localFingerPrintDb())) {
|
if (!QFile::exists(localFingerprintDb())) {
|
||||||
regenerateLocalFingerprints();
|
regenerateLocalFingerprints();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
deskflow::FingerprintDatabase db;
|
deskflow::FingerprintDatabase db;
|
||||||
db.read(localFingerPrintDb().toStdString());
|
db.read(localFingerprintDb().toStdString());
|
||||||
if (db.fingerprints().size() != kTlsDbSize) {
|
if (db.fingerprints().size() != kTlsDbSize) {
|
||||||
regenerateLocalFingerprints();
|
regenerateLocalFingerprints();
|
||||||
}
|
}
|
||||||
|
|
@ -482,14 +482,14 @@ void MainWindow::updateSize()
|
||||||
|
|
||||||
void MainWindow::showMyFingerprint()
|
void MainWindow::showMyFingerprint()
|
||||||
{
|
{
|
||||||
if (!QFile::exists(localFingerPrintDb())) {
|
if (!QFile::exists(localFingerprintDb())) {
|
||||||
if (regenerateLocalFingerprints())
|
if (regenerateLocalFingerprints())
|
||||||
showMyFingerprint();
|
showMyFingerprint();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
deskflow::FingerprintDatabase db;
|
deskflow::FingerprintDatabase db;
|
||||||
db.read(localFingerPrintDb().toStdString());
|
db.read(localFingerprintDb().toStdString());
|
||||||
if (db.fingerprints().size() != kTlsDbSize) {
|
if (db.fingerprints().size() != kTlsDbSize) {
|
||||||
if (regenerateLocalFingerprints())
|
if (regenerateLocalFingerprints())
|
||||||
showMyFingerprint();
|
showMyFingerprint();
|
||||||
|
|
@ -950,7 +950,7 @@ QString MainWindow::getIPAddresses() const
|
||||||
|
|
||||||
void MainWindow::updateLocalFingerprint()
|
void MainWindow::updateLocalFingerprint()
|
||||||
{
|
{
|
||||||
ui->lblMyFingerprint->setVisible(m_appConfig.tlsEnabled() && QFile::exists(localFingerPrintDb()));
|
ui->lblMyFingerprint->setVisible(m_appConfig.tlsEnabled() && QFile::exists(localFingerprintDb()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::autoAddScreen(const QString name)
|
void MainWindow::autoAddScreen(const QString name)
|
||||||
|
|
@ -1071,7 +1071,7 @@ QString MainWindow::getTlsPath()
|
||||||
return QStringLiteral("%1/%2").arg(coreTool.getProfileDir(), kSslDir);
|
return QStringLiteral("%1/%2").arg(coreTool.getProfileDir(), kSslDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MainWindow::localFingerPrintDb()
|
QString MainWindow::localFingerprintDb()
|
||||||
{
|
{
|
||||||
return QStringLiteral("%1/%2").arg(getTlsPath(), kFingerprintLocalFilename);
|
return QStringLiteral("%1/%2").arg(getTlsPath(), kFingerprintLocalFilename);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,12 @@ private:
|
||||||
void showAndActivate();
|
void showAndActivate();
|
||||||
|
|
||||||
QString getTlsPath();
|
QString getTlsPath();
|
||||||
QString localFingerPrintDb();
|
|
||||||
|
/**
|
||||||
|
* @brief localFingerprintDb
|
||||||
|
* @return The path to the local fingerprint file
|
||||||
|
*/
|
||||||
|
QString localFingerprintDb();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief trustedFingerprintDb get the fingerprintDb for the trusted clients or trusted servers.
|
* @brief trustedFingerprintDb get the fingerprintDb for the trusted clients or trusted servers.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue