fixed bug in post pinning

This commit is contained in:
csoler 2018-12-02 22:41:48 +01:00
parent 24896bc596
commit 60e5595618
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C
2 changed files with 2 additions and 5 deletions

View File

@ -532,9 +532,6 @@ QVariant RsGxsForumModel::toolTipRole(const ForumModelPostEntry& fmpe,int column
QVariant RsGxsForumModel::pinnedRole(const ForumModelPostEntry& fmpe,int column) const
{
if(column != COLUMN_THREAD_DATE)
return QVariant();
if(fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_PINNED)
return QVariant(true);
else

View File

@ -276,8 +276,8 @@ public:
bool lessThan(const QModelIndex& left, const QModelIndex& right) const override
{
bool left_is_not_pinned = ! left.data(ROLE_THREAD_PINNED).toBool();
bool right_is_not_pinned = !right.data(ROLE_THREAD_PINNED).toBool();
bool left_is_not_pinned = ! left.data(RsGxsForumModel::ThreadPinnedRole).toBool();
bool right_is_not_pinned = !right.data(RsGxsForumModel::ThreadPinnedRole).toBool();
#ifdef DEBUG_PINNED_POST_SORTING
std::cerr << "Comparing item date \"" << data(RsGxsForumModel::COLUMN_THREAD_DATE,Qt::DisplayRole).toString().toStdString() << "\" ("
<< data(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_SORT).toUInt() << ", \"" << data(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_SORT).toString().toStdString() << "\" --> " << left_is_not_pinned << ") to \""