2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-01 07:05:13 +00:00

Remove some more Auth() calls.

This commit is contained in:
John Preston
2019-07-24 16:00:30 +02:00
parent ff44094ded
commit 137fa0378c
59 changed files with 840 additions and 460 deletions

View File

@@ -40,8 +40,12 @@ PasscodeBox::CloudFields PasscodeBox::CloudFields::From(
return result;
}
PasscodeBox::PasscodeBox(QWidget*, bool turningOff)
: _turningOff(turningOff)
PasscodeBox::PasscodeBox(
QWidget*,
not_null<Main::Session*> session,
bool turningOff)
: _session(session)
, _turningOff(turningOff)
, _about(st::boxWidth - st::boxPadding.left() * 1.5)
, _oldPasscode(this, st::defaultInputField, tr::lng_passcode_enter_old())
, _newPasscode(this, st::defaultInputField, Global::LocalPasscode() ? tr::lng_passcode_enter_new() : tr::lng_passcode_enter_first())
@@ -51,8 +55,12 @@ PasscodeBox::PasscodeBox(QWidget*, bool turningOff)
, _recover(this, tr::lng_signin_recover(tr::now)) {
}
PasscodeBox::PasscodeBox(QWidget*, const CloudFields &fields)
: _turningOff(fields.turningOff)
PasscodeBox::PasscodeBox(
QWidget*,
not_null<Main::Session*> session,
const CloudFields &fields)
: _session(session)
, _turningOff(fields.turningOff)
, _cloudPwd(true)
, _cloudFields(fields)
, _about(st::boxWidth - st::boxPadding.left() * 1.5)
@@ -506,7 +514,7 @@ void PasscodeBox::save(bool force) {
const auto weak = make_weak(this);
cSetPasscodeBadTries(0);
Local::setPasscode(pwd.toUtf8());
Auth().localPasscodeChanged();
_session->localPasscodeChanged();
if (weak) {
closeBox();
}