Skip to content
Snippets Groups Projects
Commit e87e0d97 authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

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
parent f2ba34ca
No related branches found
No related tags found
No related merge requests found
......@@ -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())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment