Add nick name in settings
diff --git a/src/settingdialog.cpp b/src/settingdialog.cpp
index a8dca16..ed9a1bd 100644
--- a/src/settingdialog.cpp
+++ b/src/settingdialog.cpp
@@ -29,21 +29,28 @@
}
void
-SettingDialog::setIdentity(const std::string& identity)
+SettingDialog::setIdentity(const std::string& identity,
+ const std::string& nickName)
{
m_identity = identity;
- ui->identityLine->setText(QString::fromUtf8(m_identity.c_str()));
+ ui->identityLine->setText(QString::fromStdString(m_identity));
+ m_nickName = nickName;
+ ui->nickLine->setText(QString::fromStdString(m_nickName));
}
void
SettingDialog::onOkClicked()
{
- QString text = ui->identityLine->text();
- string identity = text.toUtf8().constData();
- if(identity != m_identity)
+ QString qIdentity = ui->identityLine->text();
+ string identity = qIdentity.toStdString();
+ QString qNick = ui->nickLine->text();
+ string nick = qNick.toStdString();
+
+ if(identity != m_identity || nick != m_nickName)
{
m_identity = identity;
- emit identitySet(text);
+ m_nickName = nick;
+ emit identitySet(qIdentity, qNick);
}
this->close();
}