mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-03 14:25:38 +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 {
|
||||
if (indexPair.second.isEmpty())
|
||||
return QImage();
|
||||
|
||||
auto accountList = lrcInstance_->accountModel().getAccountList();
|
||||
auto accountIndex = indexPair.second.toInt();
|
||||
if (accountList.size() <= accountIndex)
|
||||
auto accountId = indexPair.second;
|
||||
try {
|
||||
auto& accountInfo = lrcInstance_->getAccountInfo(accountId);
|
||||
uri = accountInfo.profileInfo.uri;
|
||||
} catch (const std::out_of_range&) {
|
||||
qWarning() << "Couldn't get account info for id:" << accountId;
|
||||
return QImage();
|
||||
|
||||
auto& accountInfo = lrcInstance_->accountModel().getAccountInfo(
|
||||
accountList.at(accountIndex));
|
||||
uri = accountInfo.profileInfo.uri;
|
||||
}
|
||||
}
|
||||
|
||||
if (!requestedSize.isEmpty())
|
||||
|
|
Loading…
Add table
Reference in a new issue