mirror of
https://github.com/RetroShare/RetroShare.git
synced 2026-01-05 10:35:57 -05:00
Remove recursive singleShot calls on feed items, that were creating thousands of timers and causing massive cpu overhead
This commit is contained in:
parent
ed449abb5e
commit
dfa9e39612
6 changed files with 20 additions and 16 deletions
|
|
@ -67,6 +67,11 @@ ChatMsgItem::ChatMsgItem(FeedHolder *parent, uint32_t feedId, const RsPeerId &pe
|
|||
updateItemStatic();
|
||||
updateItem();
|
||||
insertChat(message);
|
||||
|
||||
m_updateTimer = new QTimer(this);
|
||||
m_updateTimer->setSingleShot(false);
|
||||
connect(m_updateTimer, SIGNAL(timeout()), this, SLOT(updateItem()));
|
||||
m_updateTimer->start(1000);
|
||||
}
|
||||
|
||||
void ChatMsgItem::updateItemStatic()
|
||||
|
|
@ -122,11 +127,6 @@ void ChatMsgItem::updateItem()
|
|||
msgButton->setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
/* slow Tick */
|
||||
int msec_rate = 10129;
|
||||
|
||||
QTimer::singleShot( msec_rate, this, SLOT(updateItem( void ) ));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ private:
|
|||
void insertChat(const std::string &message);
|
||||
|
||||
RsPeerId mPeerId;
|
||||
QTimer *m_updateTimer;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -76,6 +76,11 @@ void SecurityIpItem::setup()
|
|||
|
||||
updateItemStatic();
|
||||
updateItem();
|
||||
|
||||
m_updateTimer = new QTimer(this);
|
||||
m_updateTimer->setSingleShot(false);
|
||||
connect(m_updateTimer, SIGNAL(timeout()), this, SLOT(updateItem()));
|
||||
m_updateTimer->start(1000);
|
||||
}
|
||||
|
||||
uint64_t SecurityIpItem::uniqueIdentifier() const
|
||||
|
|
@ -178,11 +183,6 @@ void SecurityIpItem::updateItem()
|
|||
ui->peerDetailsButton->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
/* slow Tick */
|
||||
int msec_rate = 10129;
|
||||
|
||||
QTimer::singleShot( msec_rate, this, SLOT(updateItem(void)));
|
||||
}
|
||||
|
||||
void SecurityIpItem::toggle()
|
||||
|
|
|
|||
|
|
@ -60,12 +60,13 @@ private slots:
|
|||
void banIpListChanged(const QString &ipAddress);
|
||||
|
||||
private:
|
||||
RsFeedTypeFlags mType;
|
||||
RsFeedTypeFlags mType;
|
||||
RsPeerId mSslId;
|
||||
std::string mIpAddr;
|
||||
std::string mIpAddrReported;
|
||||
uint32_t mResult;
|
||||
bool mIsTest;
|
||||
QTimer *m_updateTimer;
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::SecurityIpItem *ui;
|
||||
|
|
|
|||
|
|
@ -93,6 +93,11 @@ SecurityItem::SecurityItem(FeedHolder *parent, uint32_t feedId, const RsPgpId &g
|
|||
|
||||
updateItemStatic();
|
||||
updateItem();
|
||||
|
||||
m_updateTimer = new QTimer(this);
|
||||
m_updateTimer->setSingleShot(false);
|
||||
connect(m_updateTimer, &QTimer::timeout, this, &SecurityItem::updateItem);
|
||||
m_updateTimer->start(1000);
|
||||
}
|
||||
|
||||
SecurityItem::~SecurityItem()
|
||||
|
|
@ -303,10 +308,6 @@ void SecurityItem::updateItem()
|
|||
//quickmsgButton->show();
|
||||
}
|
||||
|
||||
/* slow Tick */
|
||||
int msec_rate = 10129;
|
||||
|
||||
QTimer::singleShot( msec_rate, this, SLOT(updateItem( void ) ));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -66,8 +66,9 @@ private:
|
|||
RsPeerId mSslId;
|
||||
std::string mSslCn;
|
||||
std::string mIP;
|
||||
RsFeedTypeFlags mType;
|
||||
RsFeedTypeFlags mType;
|
||||
bool mIsHome;
|
||||
QTimer *m_updateTimer;
|
||||
|
||||
RsEventsHandlerId_t mEventHandlerId;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue