| 241 | } |
| 242 | |
| 243 | void 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 |
nothing calls this directly
no test coverage detected