Commit 93d32af3 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Limit the number of history

parent 3980b488
Pipeline #98061 canceled with stage
......@@ -42,6 +42,9 @@ QVariant CollectionSwitcherModel::data(const QModelIndex &index, int role) const
void CollectionSwitcherModel::addHistory(const Akonadi::Collection &currentCol, const QString &fullPath)
{
if (mCollectionsInfo.count() > 10) {
mCollectionsInfo.takeFirst();
}
mCollectionsInfo.append({currentCol, fullPath});
Q_EMIT dataChanged(createIndex(0, 0), createIndex(mCollectionsInfo.size() - 1, 1), {});
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment