From 466697276ea60ea7d4e74bbaae17b8666680125f Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 2 Aug 2011 21:07:42 +0000 Subject: [PATCH] Applied patch to enable the sort of the columns star and unread in messages (from AsamK) git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4515 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/MessagesDialog.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/retroshare-gui/src/gui/MessagesDialog.cpp b/retroshare-gui/src/gui/MessagesDialog.cpp index 456591476..b890952ee 100644 --- a/retroshare-gui/src/gui/MessagesDialog.cpp +++ b/retroshare-gui/src/gui/MessagesDialog.cpp @@ -790,9 +790,11 @@ static void InitIconAndFont(QStandardItem *item[COLUMN_COUNT]) if (msgFlags & RS_MSG_STAR) { item[COLUMN_STAR]->setIcon(QIcon(IMAGE_STAR_ON)); item[COLUMN_STAR]->setText("1"); + item[COLUMN_STAR]->setData(1, ROLE_SORT); } else { item[COLUMN_STAR]->setIcon(QIcon(IMAGE_STAR_OFF)); item[COLUMN_STAR]->setText("0"); + item[COLUMN_STAR]->setData(0, ROLE_SORT); } bool isNew = msgFlags & (RS_MSG_NEW | RS_MSG_UNREAD_BY_USER); @@ -801,9 +803,11 @@ static void InitIconAndFont(QStandardItem *item[COLUMN_COUNT]) if (isNew) { item[COLUMN_UNREAD]->setIcon(QIcon(":/images/message-state-unread.png")); item[COLUMN_UNREAD]->setText("1"); + item[COLUMN_UNREAD]->setData(1, ROLE_SORT); } else { item[COLUMN_UNREAD]->setIcon(QIcon(":/images/message-state-read.png")); item[COLUMN_UNREAD]->setText("0"); + item[COLUMN_UNREAD]->setData(0, ROLE_SORT); } // set font @@ -1145,6 +1149,7 @@ void MessagesDialog::insertMessages() } } item[COLUMN_TAGS]->setText(text); + item[COLUMN_TAGS]->setData(text, ROLE_SORT); // set color QBrush Brush; // standard