From 8e5598572abc4a481267aa3855e06394a0b7b7b9 Mon Sep 17 00:00:00 2001 From: sudden6 Date: Fri, 6 Jul 2018 12:39:58 +0200 Subject: [PATCH] refactor(profile): small style corrections --- src/persistence/profile.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/persistence/profile.cpp b/src/persistence/profile.cpp index f5dcf2454..e6a150839 100644 --- a/src/persistence/profile.cpp +++ b/src/persistence/profile.cpp @@ -552,7 +552,7 @@ void Profile::onRequestSent(const ToxPk& friendPk, const QString& message) */ void Profile::saveAvatar(const ToxPk& owner, const QByteArray& avatar) { - bool needEncrypt = encrypted && !avatar.isEmpty(); + const bool needEncrypt = encrypted && !avatar.isEmpty(); const QByteArray& pic = needEncrypt ? passkey->encrypt(avatar) : avatar; QString path = avatarPath(owner); @@ -756,10 +756,9 @@ void Profile::restartCore() // TODO(sudden6): there's a potential race condition between unlocking the core loop // and killing the core const QByteArray& savedata = core->getToxSaveData(); - // save to disk just in case - bool saved = saveToxSave(savedata); - if (saved) { + // save to disk just in case + if (saveToxSave(savedata)) { qDebug() << "Restarting Core"; initCore(savedata, Settings::getInstance()); core->start();