MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / clearAll

Method clearAll

app/src/DataModel/NotificationCenter.cpp:278–294  ·  view source on GitHub ↗

* @brief Drops all events and resets unread count. */

Source from the content-addressed store, hash-verified

276 * @brief Drops all events and resets unread count.
277 */
278void DataModel::NotificationCenter::clearAll()
279{
280 if (m_history.empty() && m_unreadCount == 0)
281 return;
282
283 m_history.clear();
284 m_lastSeen.clear();
285 m_channelCounts.clear();
286
287 const bool hadUnread = m_unreadCount > 0;
288 m_unreadCount = 0;
289
290 Q_EMIT historyCleared();
291 Q_EMIT channelsChanged();
292 if (hadUnread)
293 Q_EMIT unreadCountChanged();
294}
295
296/**
297 * @brief Clears the unread badge counter without touching history.

Callers

nothing calls this directly

Calls 2

emptyMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected