mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-25 10:15:43 +08:00
[Performance] reduce number of status message updates
This commit is contained in:
committed by
Mat Sutcliffe
parent
9d53696417
commit
42eaeac1b9
@@ -99,11 +99,9 @@ namespace BlackGui
|
|||||||
void CStatusMessagesDetail::deferredUpdate()
|
void CStatusMessagesDetail::deferredUpdate()
|
||||||
{
|
{
|
||||||
if (m_pending.isEmpty()) { return; }
|
if (m_pending.isEmpty()) { return; }
|
||||||
const CStatusMessageList add(m_pending);
|
|
||||||
m_pending.clear();
|
|
||||||
|
|
||||||
CStatusMessageList newMsgs(ui->tvp_StatusMessages->container());
|
CStatusMessageList newMsgs(ui->tvp_StatusMessages->container());
|
||||||
newMsgs.push_front(add); // default in many cases, latest first
|
newMsgs.push_front(m_pending); // default in many cases, latest first
|
||||||
|
m_pending.clear();
|
||||||
|
|
||||||
// cleanup outdated: do not remove every time, but when a threshold is reached
|
// cleanup outdated: do not remove every time, but when a threshold is reached
|
||||||
if (m_maxLogMessages < 0)
|
if (m_maxLogMessages < 0)
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ namespace BlackGui
|
|||||||
QScopedPointer<Ui::CStatusMessagesDetail> ui;
|
QScopedPointer<Ui::CStatusMessagesDetail> ui;
|
||||||
int m_maxLogMessages = -1;
|
int m_maxLogMessages = -1;
|
||||||
BlackMisc::CStatusMessageList m_pending; //!< pending messages which will be added with next CStatusMessagesDetail::deferredUpdate
|
BlackMisc::CStatusMessageList m_pending; //!< pending messages which will be added with next CStatusMessagesDetail::deferredUpdate
|
||||||
BlackMisc::CDigestSignal m_dsDeferredUpdate { this, &CStatusMessagesDetail::deferredUpdate, 2000, 10 };
|
BlackMisc::CDigestSignal m_dsDeferredUpdate { this, &CStatusMessagesDetail::deferredUpdate, 2000, 25 };
|
||||||
|
|
||||||
//! Do not update each message, but deferred
|
//! Do not update each message, but deferred
|
||||||
void deferredUpdate();
|
void deferredUpdate();
|
||||||
|
|||||||
Reference in New Issue
Block a user