some further thinking of info widget

This commit is contained in:
Blue 2023-02-21 23:27:28 +03:00
parent e4a2728ef8
commit ec362cef55
Signed by untrusted user: blue
GPG key ID: 9B203B252A63EE38
5 changed files with 64 additions and 48 deletions

View file

@ -422,7 +422,7 @@ void Squawk::responseInfo(const Shared::Info& info) {
void Squawk::onInfoClosed() {
UI::Info* info = static_cast<UI::Info*>(sender());
std::map<QString, UI::Info*>::const_iterator itr = infoWidgets.find(info->jid);
std::map<QString, UI::Info*>::const_iterator itr = infoWidgets.find(info->getJid());
if (itr == infoWidgets.end()) {
qDebug() << "Info widget has been closed but can not be found among other opened vCards, application is most probably going to crash";
return;
@ -437,12 +437,7 @@ void Squawk::onActivateInfo(const QString& account, const QString& jid) {
info = itr->second;
} else {
info = new UI::Info(jid);
// TODO need to handle it somewhere else
// if (edition) {
// card->setWindowTitle(tr("%1 account card").arg(account));
// } else {
// card->setWindowTitle(tr("%1 contact card").arg(jid));
// }
info->setWindowTitle(tr("Information about %1").arg(jid));
info->setAttribute(Qt::WA_DeleteOnClose);
infoWidgets.insert(std::make_pair(jid, info));