mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-06 15:55:48 +02:00
accountwizard: remove some useless parameters
Change-Id: I19a26ef9ea3d58565ca2e62f1b75ff8c119abdee GitLab: #847
This commit is contained in:
parent
f377f25793
commit
c99d4967c6
3 changed files with 40 additions and 46 deletions
|
@ -97,16 +97,14 @@ AccountAdapter::connectFailure()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AccountAdapter::createJamiAccount(QString registeredName,
|
AccountAdapter::createJamiAccount(const QVariantMap& settings)
|
||||||
const QVariantMap& settings,
|
|
||||||
bool isCreating)
|
|
||||||
{
|
{
|
||||||
|
auto registeredName = settings["registeredName"].toString();
|
||||||
Utils::oneShotConnect(
|
Utils::oneShotConnect(
|
||||||
&lrcInstance_->accountModel(),
|
&lrcInstance_->accountModel(),
|
||||||
&lrc::api::AccountModel::accountAdded,
|
&lrc::api::AccountModel::accountAdded,
|
||||||
[this, registeredName, settings, isCreating](const QString& accountId) {
|
[this, registeredName, settings](const QString& accountId) {
|
||||||
lrcInstance_->accountModel().setAvatar(accountId, settings["avatar"].toString());
|
lrcInstance_->accountModel().setAvatar(accountId, settings["avatar"].toString());
|
||||||
|
|
||||||
Utils::oneShotConnect(&lrcInstance_->accountModel(),
|
Utils::oneShotConnect(&lrcInstance_->accountModel(),
|
||||||
&lrc::api::AccountModel::accountDetailsChanged,
|
&lrc::api::AccountModel::accountDetailsChanged,
|
||||||
[this](const QString& accountId) {
|
[this](const QString& accountId) {
|
||||||
|
@ -127,6 +125,7 @@ AccountAdapter::createJamiAccount(QString registeredName,
|
||||||
registeredNameSavedConnection_
|
registeredNameSavedConnection_
|
||||||
= connect(&lrcInstance_->accountModel(),
|
= connect(&lrcInstance_->accountModel(),
|
||||||
&lrc::api::AccountModel::profileUpdated,
|
&lrc::api::AccountModel::profileUpdated,
|
||||||
|
this,
|
||||||
[this, addedAccountId = accountId](const QString& accountId) {
|
[this, addedAccountId = accountId](const QString& accountId) {
|
||||||
if (addedAccountId == accountId) {
|
if (addedAccountId == accountId) {
|
||||||
Q_EMIT lrcInstance_->accountListChanged();
|
Q_EMIT lrcInstance_->accountListChanged();
|
||||||
|
|
|
@ -56,9 +56,7 @@ public:
|
||||||
Q_INVOKABLE void changeAccount(int row);
|
Q_INVOKABLE void changeAccount(int row);
|
||||||
|
|
||||||
// Create normal Jami account, SIP account and JAMS accounts.
|
// Create normal Jami account, SIP account and JAMS accounts.
|
||||||
Q_INVOKABLE void createJamiAccount(QString registeredName,
|
Q_INVOKABLE void createJamiAccount(const QVariantMap& settings);
|
||||||
const QVariantMap& settings,
|
|
||||||
bool isCreating);
|
|
||||||
Q_INVOKABLE void createSIPAccount(const QVariantMap& settings);
|
Q_INVOKABLE void createSIPAccount(const QVariantMap& settings);
|
||||||
Q_INVOKABLE void createJAMSAccount(const QVariantMap& settings);
|
Q_INVOKABLE void createJAMSAccount(const QVariantMap& settings);
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,10 @@ WizardViewStepModel::WizardViewStepModel(LRCInstance* lrcInstance,
|
||||||
{
|
{
|
||||||
reset();
|
reset();
|
||||||
|
|
||||||
connect(accountAdapter_, &AccountAdapter::accountAdded, [this](QString accountId, int index) {
|
connect(accountAdapter_,
|
||||||
|
&AccountAdapter::accountAdded,
|
||||||
|
this,
|
||||||
|
[this](QString accountId, int index) {
|
||||||
accountAdapter_->changeAccount(index);
|
accountAdapter_->changeAccount(index);
|
||||||
|
|
||||||
auto accountCreationOption = get_accountCreationOption();
|
auto accountCreationOption = get_accountCreationOption();
|
||||||
|
@ -64,20 +67,17 @@ void
|
||||||
WizardViewStepModel::nextStep()
|
WizardViewStepModel::nextStep()
|
||||||
{
|
{
|
||||||
auto accountCreationOption = get_accountCreationOption();
|
auto accountCreationOption = get_accountCreationOption();
|
||||||
if (accountCreationOption == AccountCreationOption::None)
|
if (get_mainStep() == MainSteps::Initial
|
||||||
|
|| accountCreationOption == AccountCreationOption::None) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (get_mainStep()) {
|
switch (accountCreationOption) {
|
||||||
case MainSteps::NameRegistration:
|
|
||||||
case MainSteps::AccountCreation: {
|
|
||||||
switch (get_accountCreationOption()) {
|
|
||||||
case AccountCreationOption::CreateJamiAccount:
|
case AccountCreationOption::CreateJamiAccount:
|
||||||
case AccountCreationOption::CreateRendezVous:
|
case AccountCreationOption::CreateRendezVous:
|
||||||
case AccountCreationOption::ImportFromBackup:
|
case AccountCreationOption::ImportFromBackup:
|
||||||
case AccountCreationOption::ImportFromDevice: {
|
case AccountCreationOption::ImportFromDevice: {
|
||||||
accountAdapter_->createJamiAccount(get_accountCreationInfo()["registeredName"].toString(),
|
accountAdapter_->createJamiAccount(get_accountCreationInfo());
|
||||||
get_accountCreationInfo(),
|
|
||||||
false);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AccountCreationOption::ConnectToAccountManager: {
|
case AccountCreationOption::ConnectToAccountManager: {
|
||||||
|
@ -88,11 +88,8 @@ WizardViewStepModel::nextStep()
|
||||||
accountAdapter_->createSIPAccount(get_accountCreationInfo());
|
accountAdapter_->createSIPAccount(get_accountCreationInfo());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue