fixed icon in To column of Sent box

This commit is contained in:
csoler 2023-08-06 23:12:06 +02:00
parent 3fa0b8f6d4
commit a382d58b68
3 changed files with 26 additions and 10 deletions

View File

@ -193,17 +193,21 @@ void GxsIdTreeItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem
QStyleOptionViewItem ownOption (option);
initStyleOption(&ownOption, index);
RsGxsId id(index.data(Qt::UserRole).toString().toStdString());
QString cmt;
QString dt = index.data(Qt::UserRole).toString();
RsGxsId id(index.data(Qt::UserRole).toString().toStdString());
if(id.isNull())
if(dt == "")
ownOption.icon = FilesDefs::getIconFromQtResourcePath(":/icons/svg/people2.svg");
else if(id.isNull())
{
if (ownOption.icon.isNull())
ownOption.icon = FilesDefs::getIconFromQtResourcePath(":/icons/notification.svg");
}
else
{
if (ownOption.icon.isNull())
ownOption.icon = FilesDefs::getIconFromQtResourcePath(":/icons/notification.svg");
}
else
{
if(! computeNameIconAndComment(id,ownOption.text,ownOption.icon,cmt))
QString cmt;
if(! computeNameIconAndComment(id,ownOption.text,ownOption.icon,cmt))
{
if(mReloadPeriod > 3)
{

View File

@ -15,6 +15,7 @@
<file>icons/svg/display_options.svg</file>
<file>icons/svg/listlayout.svg</file>
<file>icons/svg/gridlayout.svg</file>
<file>icons/svg/people2.svg</file>
<file>icons/stars/star0.png</file>
<file>icons/stars/star1.png</file>
<file>icons/stars/star2.png</file>

View File

@ -579,7 +579,18 @@ QVariant RsMessageModel::userRole(const Rs::Msgs::MsgInfoSummary& fmpe,int col)
{
case COLUMN_THREAD_AUTHOR: return QVariant(QString::fromStdString(fmpe.from.toStdString()));
case COLUMN_THREAD_MSGID: return QVariant(QString::fromStdString(fmpe.msgId));
case COLUMN_THREAD_TO: return QVariant(QString::fromStdString(fmpe.to.toStdString()));
case COLUMN_THREAD_TO:
{
// First check if the .to field is filled.
if(!fmpe.to.toStdString().empty())
return QVariant(QString::fromStdString(fmpe.to.toStdString()));
// In the Send box, .to is never filled. In this case we look into destinations.
if(fmpe.destinations.size()==1)
return QVariant(QString::fromStdString((*fmpe.destinations.begin()).toStdString()));
}
default:
return QVariant();
}