moved peerStatusChanged() from notify to rsEvents

This commit is contained in:
csoler 2025-06-14 21:56:09 +02:00
parent 0ce2dd8486
commit e6cacc4d34
26 changed files with 281 additions and 187 deletions

View file

@ -132,8 +132,8 @@ public:
if(is_group_1 ^ is_group_2) // if the two are different, put the group first.
return is_group_1 ;
bool online1 = (left .data(RsFriendListModel::OnlineRole).toInt() != RS_STATUS_OFFLINE);
bool online2 = (right.data(RsFriendListModel::OnlineRole).toInt() != RS_STATUS_OFFLINE);
bool online1 = (left .data(RsFriendListModel::OnlineRole).toInt() != (int)RsStatusValue::RS_STATUS_OFFLINE);
bool online2 = (right.data(RsFriendListModel::OnlineRole).toInt() != (int)RsStatusValue::RS_STATUS_OFFLINE);
if((online1 != online2) && m_sortByState)
return (m_header->sortIndicatorOrder()==Qt::AscendingOrder)?online1:online2 ; // always put online nodes first
@ -155,7 +155,7 @@ public:
// Filter offline friends
if(!m_showOfflineNodes && (index.data(RsFriendListModel::OnlineRole).toInt() == RS_STATUS_OFFLINE))
if(!m_showOfflineNodes && (RsStatusValue(index.data(RsFriendListModel::OnlineRole).toInt()) == RsStatusValue::RS_STATUS_OFFLINE))
return false;
return index.data(RsFriendListModel::FilterRole).toString() == RsFriendListModel::FilterString ;
@ -204,7 +204,7 @@ NewFriendList::NewFriendList(QWidget */*parent*/) : /* RsAutoUpdatePage(5000,par
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> e) { handleEvent(e); }, mEventHandlerId_gssp, RsEventType::GOSSIP_DISCOVERY );
connect(NotifyQt::getInstance(), SIGNAL(peerHasNewAvatar(QString)), this, SLOT(forceUpdateDisplay()));
connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(QString,int)), this, SLOT(forceUpdateDisplay()));
// connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(QString,int)), this, SLOT(forceUpdateDisplay()));
mModel = new RsFriendListModel(ui->peerTreeWidget);
mProxyModel = new FriendListSortFilterProxyModel(ui->peerTreeWidget->header(),this);