mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
added comment in the post sorting code
This commit is contained in:
parent
69c6860d8d
commit
d856566c69
@ -1224,11 +1224,11 @@ public:
|
|||||||
|
|
||||||
bool operator<(const QTreeWidgetItem& other) const
|
bool operator<(const QTreeWidgetItem& other) const
|
||||||
{
|
{
|
||||||
bool date_left = data(COLUMN_THREAD_DATE,ROLE_THREAD_SORT).toUInt(); // this is used by the sorting model to put all posts on top
|
bool date_left = data(COLUMN_THREAD_DATE,ROLE_THREAD_SORT).toUInt(); // this is used by the sorting model to put all pinned posts on top
|
||||||
bool date_right = other.data(COLUMN_THREAD_DATE,ROLE_THREAD_SORT).toUInt(); // this is used by the sorting model to put all posts on top
|
bool date_right = other.data(COLUMN_THREAD_DATE,ROLE_THREAD_SORT).toUInt();
|
||||||
|
|
||||||
if(date_left ^ date_right)
|
if(date_left ^ date_right)
|
||||||
return (m_header->sortIndicatorOrder()==Qt::AscendingOrder)?date_right:date_left ;
|
return (m_header->sortIndicatorOrder()==Qt::AscendingOrder)?date_right:date_left ; // always put pinned posts on top
|
||||||
|
|
||||||
return GxsIdRSTreeWidgetItem::operator<(other);
|
return GxsIdRSTreeWidgetItem::operator<(other);
|
||||||
}
|
}
|
||||||
@ -1250,6 +1250,8 @@ QTreeWidgetItem *GxsForumThreadWidget::convertMsgToThreadWidget(const RsGxsForum
|
|||||||
|
|
||||||
redacted = (reputation_level == RsReputations::REPUTATION_LOCALLY_NEGATIVE);
|
redacted = (reputation_level == RsReputations::REPUTATION_LOCALLY_NEGATIVE);
|
||||||
|
|
||||||
|
// We use a specific item model for forums in order to handle the post pinning.
|
||||||
|
|
||||||
GxsIdRSTreeWidgetItem *item = new ForumThreadItem(ui->threadTreeWidget->header(),mThreadCompareRole,GxsIdDetails::ICON_TYPE_AVATAR );
|
GxsIdRSTreeWidgetItem *item = new ForumThreadItem(ui->threadTreeWidget->header(),mThreadCompareRole,GxsIdDetails::ICON_TYPE_AVATAR );
|
||||||
item->moveToThread(ui->threadTreeWidget->thread());
|
item->moveToThread(ui->threadTreeWidget->thread());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user