mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-07 08:35:16 -04:00
Removed not needed class GroupTreeWidgetItem.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3951 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
ff57befb1f
commit
13ab90e14b
2 changed files with 1 additions and 45 deletions
|
@ -372,7 +372,7 @@ void GroupTreeWidget::calculateScore(QTreeWidgetItem *item)
|
|||
}
|
||||
}
|
||||
|
||||
item->setData(COLUMN_DATA, ROLE_SEARCH_SCORE, score);
|
||||
item->setData(COLUMN_DATA, ROLE_SEARCH_SCORE, -score); // negative for correct sorting
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -448,35 +448,3 @@ void GroupTreeWidget::sort()
|
|||
{
|
||||
resort(NULL);
|
||||
}
|
||||
|
||||
GroupTreeWidgetItem::GroupTreeWidgetItem() : QTreeWidgetItem()
|
||||
{
|
||||
}
|
||||
|
||||
bool GroupTreeWidgetItem::operator<(const QTreeWidgetItem& other) const
|
||||
{
|
||||
QDateTime otherChanTs = other.data(COLUMN_DATA, ROLE_LASTPOST).toDateTime();
|
||||
QDateTime thisChanTs = this->data(COLUMN_DATA, ROLE_LASTPOST).toDateTime();
|
||||
|
||||
uint32_t otherCount = other.data(COLUMN_DATA, ROLE_SEARCH_SCORE).toUInt();
|
||||
uint32_t thisCount = this->data(COLUMN_DATA, ROLE_SEARCH_SCORE).toUInt();
|
||||
|
||||
/* If counts are equal then determine by who has the most recent post */
|
||||
if (otherCount == thisCount){
|
||||
if (thisChanTs < otherChanTs) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/* Choose the item where the string occurs the most */
|
||||
if (thisCount < otherCount) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (thisChanTs < otherChanTs) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Compare name */
|
||||
return text(COLUMN_NAME) < other.text(COLUMN_NAME);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue