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

ux: modify second id displayed in AccountListModel


Change-Id: Ie7a50eff8ef855c48485556544e0be50a252c7ce
Reviewed-by: default avatarAndreas Traczyk <andreas.traczyk@savoirfairelinux.com>
parent 1c20ef15
No related branches found
No related tags found
No related merge requests found
...@@ -112,7 +112,8 @@ AccountItemDelegate::paint(QPainter* painter, ...@@ -112,7 +112,8 @@ AccountItemDelegate::paint(QPainter* painter,
painter->drawText(rectTexts, Qt::AlignVCenter | Qt::AlignLeft, nameStr); painter->drawText(rectTexts, Qt::AlignVCenter | Qt::AlignLeft, nameStr);
} }
// Display the ID under the name // Display the secondary ID under the name
QString idStr = index.data(static_cast<int>(AccountListModel::Role::Username)).value<QString>(); QString idStr = index.data(static_cast<int>(AccountListModel::Role::Username)).value<QString>();
if (idStr != name.toString()) { if (idStr != name.toString()) {
font.setItalic(false); font.setItalic(false);
......
...@@ -62,7 +62,7 @@ QVariant AccountListModel::data(const QModelIndex &index, int role) const ...@@ -62,7 +62,7 @@ QVariant AccountListModel::data(const QModelIndex &index, int role) const
case Qt::DisplayRole: case Qt::DisplayRole:
return QVariant(QString::fromStdString(accountInfo.profileInfo.alias)); return QVariant(QString::fromStdString(accountInfo.profileInfo.alias));
case Role::Username: case Role::Username:
return QVariant(QString::fromStdString(accountInfo.profileInfo.uri)); return QVariant(QString::fromStdString(Utils::secondBestNameForAccount(accountInfo)));
case Role::Type: case Role::Type:
return QVariant(Utils::toUnderlyingValue<lrc::api::profile::Type>(accountInfo.profileInfo.type)); return QVariant(Utils::toUnderlyingValue<lrc::api::profile::Type>(accountInfo.profileInfo.type));
case Role::Status: case Role::Status:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment