21RecentFiles::RecentFiles(
const int maxEntries)
24 m_maxEntries(maxEntries)
26 m_timer.setSingleShot(
true);
27 m_timer.setInterval(3 * 60 * 1000);
28 connect(&m_timer, &QTimer::timeout,
29 this, &RecentFiles::closeGroup);
52void RecentFiles::addFiles(
const QStringList &names)
54 if (m_strLists.isEmpty() || names != m_strLists.first()) {
55 if (m_groupOpen && !m_clone1st)
57 m_strLists.removeFirst();
63 QList<QStringList> sortedLists = m_strLists;
64 for (
int i = 0; i < sortedLists.size(); ++i)
65 sortedLists[i].sort();
66 QStringList sortedNames = names;
69 int index = sortedLists.indexOf(sortedNames);
71 m_strLists.removeAt(index);
74 if (m_strLists.size() >= m_maxEntries)
75 m_strLists.removeLast();
78 m_strLists.prepend(names);