MCPcopy Create free account
hub / github.com/Martchus/syncthingtray / ensureWithinLimit

Method ensureWithinLimit

syncthingmodel/syncthingrecentchangesmodel.cpp:243–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

241}
242
243void SyncthingRecentChangesModel::ensureWithinLimit()
244{
245 const auto maxRows = m_maxRows >= 0 ? m_maxRows : m_connection.diskEventLimit();
246 const auto rowsToDelete = static_cast<int>(m_changes.size()) - maxRows;
247 if (rowsToDelete <= 0) {
248 return;
249 }
250 beginRemoveRows(QModelIndex(), maxRows, static_cast<int>(m_changes.size()) - 1);
251 m_changes.erase(m_changes.begin() + maxRows, m_changes.end());
252 endRemoveRows();
253}
254
255} // namespace Data

Callers

nothing calls this directly

Calls 2

diskEventLimitMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected