mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-25 23:49:35 -05:00
removed regular update of node info in friend list model as it does not seem to be needed
This commit is contained in:
parent
5f705686fa
commit
3356509044
@ -54,7 +54,7 @@ static const uint16_t UNDEFINED_PROFILE_INDEX_VALUE = (sizeof(uintptr_t)==4)?0xf
|
||||
|
||||
const QString RsFriendListModel::FilterString("filtered");
|
||||
const uint32_t MAX_INTERNAL_DATA_UPDATE_DELAY = 300 ; // re-update the internal data every 5 mins. Should properly cover sleep/wake-up changes.
|
||||
const uint32_t MAX_NODE_UPDATE_DELAY = 1 ; // re-update the internal data every 5 mins. Should properly cover sleep/wake-up changes.
|
||||
const uint32_t MAX_NODE_UPDATE_DELAY = 10 ; // re-update the internal data every 5 mins. Should properly cover sleep/wake-up changes.
|
||||
|
||||
static const uint32_t NODE_DETAILS_UPDATE_DELAY = 5; // update each node every 5 secs.
|
||||
|
||||
@ -768,24 +768,29 @@ void RsFriendListModel::checkInternalData(bool force)
|
||||
{
|
||||
rstime_t now = time(NULL);
|
||||
|
||||
if(mLastInternalDataUpdate + MAX_INTERNAL_DATA_UPDATE_DELAY < now || force)
|
||||
if( (mLastInternalDataUpdate + MAX_INTERNAL_DATA_UPDATE_DELAY < now) || force)
|
||||
updateInternalData();
|
||||
|
||||
if(mLastNodeUpdate + MAX_NODE_UPDATE_DELAY < now)
|
||||
{
|
||||
for(uint32_t i=0;i<mLocations.size();++i)
|
||||
if(mLocations[i].last_update_ts + NODE_DETAILS_UPDATE_DELAY < now)
|
||||
{
|
||||
#ifdef DEBUG_MODEL
|
||||
std::cerr << "Updating ID " << mLocations[i].node_info.id << std::endl;
|
||||
#endif
|
||||
RsPeerId id(mLocations[i].node_info.id); // this avoids zeroing the id field when writing the node data
|
||||
rsPeers->getPeerDetails(id,mLocations[i].node_info);
|
||||
mLocations[i].last_update_ts = now;
|
||||
}
|
||||
|
||||
mLastNodeUpdate = now;
|
||||
}
|
||||
// else
|
||||
// {
|
||||
// preMods();
|
||||
//
|
||||
// if(mLastNodeUpdate + MAX_NODE_UPDATE_DELAY < now)
|
||||
// {
|
||||
// for(uint32_t i=0;i<mLocations.size();++i)
|
||||
// if(mLocations[i].last_update_ts + NODE_DETAILS_UPDATE_DELAY < now)
|
||||
// {
|
||||
//#ifdef DEBUG_MODEL
|
||||
// std::cerr << "Updating ID " << mLocations[i].node_info.id << std::endl;
|
||||
//#endif
|
||||
// RsPeerId id(mLocations[i].node_info.id); // this avoids zeroing the id field when writing the node data
|
||||
// rsPeers->getPeerDetails(id,mLocations[i].node_info);
|
||||
// mLocations[i].last_update_ts = now;
|
||||
// }
|
||||
//
|
||||
// mLastNodeUpdate = now;
|
||||
// }
|
||||
// postMods();
|
||||
// }
|
||||
}
|
||||
|
||||
const RsFriendListModel::HierarchicalGroupInformation *RsFriendListModel::getGroupInfo(const EntryIndex& e) const
|
||||
|
@ -239,11 +239,6 @@ NewFriendList::NewFriendList(QWidget */*parent*/) : /* RsAutoUpdatePage(5000,par
|
||||
connect(mActionSortByState, SIGNAL(toggled(bool)), this, SLOT(toggleSortByState(bool)));
|
||||
connect(ui->peerTreeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(peerTreeWidgetCustomPopupMenu()));
|
||||
|
||||
// Using Queued connections here is pretty important since the notifications may come from a different thread.
|
||||
|
||||
// connect(NotifyQt::getInstance(), SIGNAL(friendsChanged()) , this, SLOT(forceUpdateDisplay()),Qt::QueuedConnection);
|
||||
// connect(NotifyQt::getInstance(), SIGNAL(groupsChanged(int)) , this, SLOT(forceUpdateDisplay()),Qt::QueuedConnection);
|
||||
|
||||
connect(ui->actionShowOfflineFriends, SIGNAL(triggered(bool)), this, SLOT(setShowUnconnected(bool)));
|
||||
connect(ui->actionShowState, SIGNAL(triggered(bool)), this, SLOT(setShowState(bool)) );
|
||||
connect(ui->actionShowGroups, SIGNAL(triggered(bool)), this, SLOT(setShowGroups(bool)) );
|
||||
@ -1030,11 +1025,6 @@ void NewFriendList::forceUpdateDisplay()
|
||||
checkInternalData(true);
|
||||
}
|
||||
|
||||
// void NewFriendList::updateDisplay()
|
||||
// {
|
||||
// checkInternalData(false);
|
||||
// }
|
||||
|
||||
void NewFriendList::moveToGroup()
|
||||
{
|
||||
RsFriendListModel::RsProfileDetails pinfo;
|
||||
|
Loading…
Reference in New Issue
Block a user