diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-12-28 23:34:21 +0100 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-12-29 00:17:37 +0100 |
commit | f3e1941612f018f1cedc777527dca5f92500ad36 (patch) | |
tree | 6082ed7ecec2e1ef973075641140bf5e2462efbd /src | |
parent | Cleanup remaining clazy issues (diff) | |
download | nheko-f3e1941612f018f1cedc777527dca5f92500ad36.tar.xz |
Add clazy to CI
Diffstat (limited to 'src')
-rw-r--r-- | src/Cache.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/Cache.cpp b/src/Cache.cpp index 7558d548..96472f3d 100644 --- a/src/Cache.cpp +++ b/src/Cache.cpp @@ -350,7 +350,6 @@ secretName(std::string name, bool internal) void Cache::loadSecrets(std::vector<std::pair<std::string, bool>> toLoad) { - auto settings = UserSettings::instance()->qsettings(); if (toLoad.empty()) { @@ -362,7 +361,7 @@ Cache::loadSecrets(std::vector<std::pair<std::string, bool>> toLoad) if (settings->value("run_without_secure_secrets_service", false).toBool()) { for (auto &[name_, internal] : toLoad) { - auto name = secretName(name_, internal); + auto name = secretName(name_, internal); auto value = settings->value("secrets/" + name).toString(); if (value.isEmpty()) { nhlog::db()->info("Restored empty secret '{}'.", name.toStdString()); @@ -376,7 +375,6 @@ Cache::loadSecrets(std::vector<std::pair<std::string, bool>> toLoad) return; } - auto [name_, internal] = toLoad.front(); auto job = new QKeychain::ReadPasswordJob(QCoreApplication::applicationName()); @@ -438,11 +436,11 @@ Cache::storeSecret(const std::string name_, const std::string secret, bool inter auto settings = UserSettings::instance()->qsettings(); if (settings->value("run_without_secure_secrets_service", false).toBool()) { - settings->setValue("secrets/" + name, QString::fromStdString(secret)); - // if we emit the signal directly it won't be received - QTimer::singleShot(0, this, [this, name_] { emit secretChanged(name_); }); - nhlog::db()->info("Storing secret '{}' successful", name_); - return; + settings->setValue("secrets/" + name, QString::fromStdString(secret)); + // if we emit the signal directly it won't be received + QTimer::singleShot(0, this, [this, name_] { emit secretChanged(name_); }); + nhlog::db()->info("Storing secret '{}' successful", name_); + return; } auto job = new QKeychain::WritePasswordJob(QCoreApplication::applicationName()); @@ -485,10 +483,10 @@ Cache::deleteSecret(const std::string name, bool internal) auto settings = UserSettings::instance()->qsettings(); if (settings->value("run_without_secure_secrets_service", false).toBool()) { - settings->remove("secrets/" + name_); - // if we emit the signal directly it won't be received - QTimer::singleShot(0, this, [this, name] { emit secretChanged(name); }); - return; + settings->remove("secrets/" + name_); + // if we emit the signal directly it won't be received + QTimer::singleShot(0, this, [this, name] { emit secretChanged(name); }); + return; } auto job = new QKeychain::DeletePasswordJob(QCoreApplication::applicationName()); |