Commit 4d23e33e authored by Andreas Traczyk's avatar Andreas Traczyk

wizard: connect accountAdded signal before creating account

Change-Id: I31bc2a79fe75f7819d36005bae5d2484f0bfc018
parent f1dc5137
......@@ -410,16 +410,6 @@ NewWizardWidget::createRingAccount(const QString &displayName,
const QString &pin,
const QString &archivePath)
{
QtConcurrent::run(
[=] {
LRCInstance::accountModel().createNewAccount(
lrc::api::profile::Type::RING,
displayName.toStdString(),
archivePath.toStdString(),
password.toStdString(),
pin.toStdString()
);
});
QMetaObject::Connection* const connection = new QMetaObject::Connection;
*connection = connect(&LRCInstance::accountModel(), &lrc::api::NewAccountModel::accountAdded,
[this, connection](const std::string& accountId) {
......@@ -447,6 +437,16 @@ NewWizardWidget::createRingAccount(const QString &displayName,
delete connection;
}
});
QtConcurrent::run(
[=] {
LRCInstance::accountModel().createNewAccount(
lrc::api::profile::Type::RING,
displayName.toStdString(),
archivePath.toStdString(),
password.toStdString(),
pin.toStdString()
);
});
changePage(ui->spinnerPage);
repaint();
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment