mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
refactor(startup): remove unnecessary arg. passing in loadDatabase
This commit is contained in:
parent
a7df4bfddb
commit
68d24eec64
|
@ -105,10 +105,11 @@ Profile::Profile(QString name, const QString& password, bool isNewProfile,
|
|||
, encrypted{this->passkey != nullptr}
|
||||
{
|
||||
Settings& s = Settings::getInstance();
|
||||
// TODO(kriby): Move/refactor core initialization to remove settings dependency
|
||||
// note to self: use slots/signals for this?
|
||||
initCore(toxsave, s, isNewProfile);
|
||||
|
||||
const ToxId& selfId = core->getSelfId();
|
||||
loadDatabase(selfId, password);
|
||||
loadDatabase(password);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -470,14 +471,16 @@ QByteArray Profile::loadAvatarData(const ToxPk& owner)
|
|||
return pic;
|
||||
}
|
||||
|
||||
void Profile::loadDatabase(const ToxId& id, QString password)
|
||||
void Profile::loadDatabase(QString password)
|
||||
{
|
||||
assert(core);
|
||||
|
||||
if (isRemoved) {
|
||||
qDebug() << "Can't load database of removed profile";
|
||||
return;
|
||||
}
|
||||
|
||||
QByteArray salt = id.getPublicKey().getByteArray();
|
||||
QByteArray salt = core->getSelfId().getPublicKey().getByteArray();
|
||||
if (salt.size() != TOX_PASS_SALT_LENGTH) {
|
||||
qWarning() << "Couldn't compute salt from public key" << name;
|
||||
GUI::showError(QObject::tr("Error"),
|
||||
|
|
|
@ -90,7 +90,7 @@ public slots:
|
|||
void onRequestSent(const ToxPk& friendPk, const QString& message);
|
||||
|
||||
private slots:
|
||||
void loadDatabase(const ToxId& id, QString password);
|
||||
void loadDatabase(QString password);
|
||||
void saveAvatar(const ToxPk& owner, const QByteArray& avatar);
|
||||
void removeAvatar(const ToxPk& owner);
|
||||
void onSaveToxSave();
|
||||
|
|
Loading…
Reference in New Issue
Block a user