refactor: narrow use of stdString in mainwindow
This commit is contained in:
parent
79dc858446
commit
8d0491f1ad
1 changed files with 8 additions and 8 deletions
|
|
@ -160,14 +160,14 @@ 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()) {
|
||||||
auto localPath = QStringLiteral("%1/%2").arg(getTlsPath(), kFingerprintLocalFilename).toStdString();
|
auto localPath = QStringLiteral("%1/%2").arg(getTlsPath(), kFingerprintLocalFilename);
|
||||||
if (!QFile::exists(QString::fromStdString(localPath))) {
|
if (!QFile::exists(localPath)) {
|
||||||
regenerateLocalFingerprints();
|
regenerateLocalFingerprints();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
deskflow::FingerprintDatabase db;
|
deskflow::FingerprintDatabase db;
|
||||||
db.read(localPath);
|
db.read(localPath.toStdString());
|
||||||
if (db.fingerprints().size() != kTlsDbSize) {
|
if (db.fingerprints().size() != kTlsDbSize) {
|
||||||
regenerateLocalFingerprints();
|
regenerateLocalFingerprints();
|
||||||
}
|
}
|
||||||
|
|
@ -486,15 +486,15 @@ void MainWindow::updateSize()
|
||||||
|
|
||||||
void MainWindow::showMyFingerprint()
|
void MainWindow::showMyFingerprint()
|
||||||
{
|
{
|
||||||
auto localPath = QStringLiteral("%1/%2").arg(getTlsPath(), kFingerprintLocalFilename).toStdString();
|
auto localPath = QStringLiteral("%1/%2").arg(getTlsPath(), kFingerprintLocalFilename);
|
||||||
if (!QFile::exists(QString::fromStdString(localPath))) {
|
if (!QFile::exists(localPath)) {
|
||||||
if (regenerateLocalFingerprints())
|
if (regenerateLocalFingerprints())
|
||||||
showMyFingerprint();
|
showMyFingerprint();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
deskflow::FingerprintDatabase db;
|
deskflow::FingerprintDatabase db;
|
||||||
db.read(localPath);
|
db.read(localPath.toStdString());
|
||||||
if (db.fingerprints().size() != kTlsDbSize) {
|
if (db.fingerprints().size() != kTlsDbSize) {
|
||||||
if (regenerateLocalFingerprints())
|
if (regenerateLocalFingerprints())
|
||||||
showMyFingerprint();
|
showMyFingerprint();
|
||||||
|
|
@ -954,8 +954,8 @@ void MainWindow::updateLocalFingerprint()
|
||||||
{
|
{
|
||||||
bool fingerprintExists = false;
|
bool fingerprintExists = false;
|
||||||
try {
|
try {
|
||||||
auto localPath = QStringLiteral("%1/%2").arg(getTlsPath(), kFingerprintLocalFilename).toStdString();
|
auto localPath = QStringLiteral("%1/%2").arg(getTlsPath(), kFingerprintLocalFilename);
|
||||||
fingerprintExists = QFile::exists(QString::fromStdString(localPath));
|
fingerprintExists = QFile::exists(localPath);
|
||||||
} catch (const std::exception &e) {
|
} catch (const std::exception &e) {
|
||||||
qDebug() << e.what();
|
qDebug() << e.what();
|
||||||
qFatal() << "failed to check if fingerprint exists";
|
qFatal() << "failed to check if fingerprint exists";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue