Sharing: add the shareWithAdditionalInfo string in autocompletion results

Issue #6749
This commit is contained in:
Olivier Goffart 2018-10-24 12:47:41 +02:00 committed by Kevin Ottens
parent 380d7b8028
commit ec8c02dad0
No known key found for this signature in database
GPG key ID: 074BBBCB8DECC9E2

View file

@ -125,9 +125,13 @@ void ShareeModel::shareesFetched(const QJsonDocument &reply)
QSharedPointer<Sharee> ShareeModel::parseSharee(const QJsonObject &data)
{
const QString displayName = data.value("label").toString();
QString displayName = data.value("label").toString();
const QString shareWith = data.value("value").toObject().value("shareWith").toString();
Sharee::Type type = (Sharee::Type)data.value("value").toObject().value("shareType").toInt();
const QString additionalInfo = data.value("value").toObject().value("shareWithAdditionalInfo").toString();
if (!additionalInfo.isEmpty()) {
displayName = tr("%1 (%2)", "sharee (shareWithAdditionalInfo)").arg(displayName, additionalInfo);
}
return QSharedPointer<Sharee>(new Sharee(shareWith, displayName, type));
}