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

fix(profileform): Fixed segfault on logut

This commit is contained in:
Diadlo 2016-04-08 02:06:39 +03:00 committed by Polshakov Dmitry
parent 8f4b6869f1
commit 2e9295f420

View File

@ -483,24 +483,27 @@ void ProfileForm::onRegisterButtonClicked()
Toxme::ExecCode code = Toxme::ExecCode::Ok; Toxme::ExecCode code = Toxme::ExecCode::Ok;
QString response = Toxme::createAddress(code, server, id, name, privacy, bio); QString response = Toxme::createAddress(code, server, id, name, privacy, bio);
switch (code) { if (Core::getInstance())
case Toxme::Updated: {
QMessageBox::information(this, tr("Done!"), tr("Account %1@%2 updated successfully").arg(name, server), "Ok"); switch (code) {
Settings::getInstance().setToxme(name, server, bio, privacy); case Toxme::Updated:
showExistenToxme(); QMessageBox::information(this, tr("Done!"), tr("Account %1@%2 updated successfully").arg(name, server), "Ok");
break; Settings::getInstance().setToxme(name, server, bio, privacy);
case Toxme::Ok: showExistenToxme();
QMessageBox::information(this, tr("Done!"), tr("Successfully added %1@%2 to the database. Save your password").arg(name, server), "Ok"); break;
Settings::getInstance().setToxme(name, server, bio, privacy, response); case Toxme::Ok:
showExistenToxme(); QMessageBox::information(this, tr("Done!"), tr("Successfully added %1@%2 to the database. Save your password").arg(name, server), "Ok");
break; Settings::getInstance().setToxme(name, server, bio, privacy, response);
default: showExistenToxme();
QString errorMessage = Toxme::getErrorMessage(code); break;
QMessageBox::warning(this, tr("Toxme error"), errorMessage, "Ok"); default:
} QString errorMessage = Toxme::getErrorMessage(code);
QMessageBox::warning(this, tr("Toxme error"), errorMessage, "Ok");
}
bodyUI->toxmeRegisterButton->setEnabled(true); bodyUI->toxmeRegisterButton->setEnabled(true);
bodyUI->toxmeUpdateButton->setEnabled(true); bodyUI->toxmeUpdateButton->setEnabled(true);
bodyUI->toxmeRegisterButton->setText(tr("Register")); bodyUI->toxmeRegisterButton->setText(tr("Register"));
bodyUI->toxmeUpdateButton->setText(tr("Update")); bodyUI->toxmeUpdateButton->setText(tr("Update"));
}
} }