1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

refactor(profile): small style corrections

This commit is contained in:
sudden6 2018-07-06 12:39:58 +02:00
parent 24e7c4efd4
commit 8e5598572a
No known key found for this signature in database
GPG Key ID: 279509B499E032B9

View File

@ -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();