mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-06 07:45:51 +02:00
qrcode: fix account qr code generation
The current account id is passed to the qr image provider but is interpreted as a model index. Change-Id: I5e2a94d5d02d07daa4826315a5d76925e80f033e Gitlab: #490
This commit is contained in:
parent
f2ba34ca51
commit
e87e0d97e0
1 changed files with 7 additions and 8 deletions
|
@ -78,15 +78,14 @@ public:
|
||||||
} else {
|
} else {
|
||||||
if (indexPair.second.isEmpty())
|
if (indexPair.second.isEmpty())
|
||||||
return QImage();
|
return QImage();
|
||||||
|
auto accountId = indexPair.second;
|
||||||
auto accountList = lrcInstance_->accountModel().getAccountList();
|
try {
|
||||||
auto accountIndex = indexPair.second.toInt();
|
auto& accountInfo = lrcInstance_->getAccountInfo(accountId);
|
||||||
if (accountList.size() <= accountIndex)
|
|
||||||
return QImage();
|
|
||||||
|
|
||||||
auto& accountInfo = lrcInstance_->accountModel().getAccountInfo(
|
|
||||||
accountList.at(accountIndex));
|
|
||||||
uri = accountInfo.profileInfo.uri;
|
uri = accountInfo.profileInfo.uri;
|
||||||
|
} catch (const std::out_of_range&) {
|
||||||
|
qWarning() << "Couldn't get account info for id:" << accountId;
|
||||||
|
return QImage();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!requestedSize.isEmpty())
|
if (!requestedSize.isEmpty())
|
||||||
|
|
Loading…
Add table
Reference in a new issue