mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-09 19:38:45 -05:00
fixed icon in To column of Sent box
This commit is contained in:
parent
3fa0b8f6d4
commit
a382d58b68
@ -193,17 +193,21 @@ void GxsIdTreeItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem
|
|||||||
QStyleOptionViewItem ownOption (option);
|
QStyleOptionViewItem ownOption (option);
|
||||||
initStyleOption(&ownOption, index);
|
initStyleOption(&ownOption, index);
|
||||||
|
|
||||||
RsGxsId id(index.data(Qt::UserRole).toString().toStdString());
|
QString dt = index.data(Qt::UserRole).toString();
|
||||||
QString cmt;
|
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())
|
QString cmt;
|
||||||
ownOption.icon = FilesDefs::getIconFromQtResourcePath(":/icons/notification.svg");
|
|
||||||
}
|
if(! computeNameIconAndComment(id,ownOption.text,ownOption.icon,cmt))
|
||||||
else
|
|
||||||
{
|
|
||||||
if(! computeNameIconAndComment(id,ownOption.text,ownOption.icon,cmt))
|
|
||||||
{
|
{
|
||||||
if(mReloadPeriod > 3)
|
if(mReloadPeriod > 3)
|
||||||
{
|
{
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
<file>icons/svg/display_options.svg</file>
|
<file>icons/svg/display_options.svg</file>
|
||||||
<file>icons/svg/listlayout.svg</file>
|
<file>icons/svg/listlayout.svg</file>
|
||||||
<file>icons/svg/gridlayout.svg</file>
|
<file>icons/svg/gridlayout.svg</file>
|
||||||
|
<file>icons/svg/people2.svg</file>
|
||||||
<file>icons/stars/star0.png</file>
|
<file>icons/stars/star0.png</file>
|
||||||
<file>icons/stars/star1.png</file>
|
<file>icons/stars/star1.png</file>
|
||||||
<file>icons/stars/star2.png</file>
|
<file>icons/stars/star2.png</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_AUTHOR: return QVariant(QString::fromStdString(fmpe.from.toStdString()));
|
||||||
case COLUMN_THREAD_MSGID: return QVariant(QString::fromStdString(fmpe.msgId));
|
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:
|
default:
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user