1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#ifndef RECENTFILES_H
5#define RECENTFILES_H
6
7#include <QString>
8#include <QStringList>
9#include <QTimer>
10
11QT_BEGIN_NAMESPACE
12
13class RecentFiles : public QObject
14{
15 Q_OBJECT
16
17public:
18 explicit RecentFiles(const int maxEntries);
19
20 bool isEmpty() { return m_strLists.isEmpty(); }
21 void addFiles(const QStringList &names);
22 QString lastOpenedFile() const {
23 if (m_strLists.isEmpty() || m_strLists.first().isEmpty())
24 return QString();
25 return m_strLists.at(i: 0).at(i: 0);
26 }
27 const QList<QStringList>& filesLists() const { return m_strLists; }
28
29 void readConfig();
30 void writeConfig() const;
31
32public slots:
33 void closeGroup();
34
35private:
36 bool m_groupOpen;
37 bool m_clone1st;
38 int m_maxEntries;
39 QList<QStringList> m_strLists;
40 QTimer m_timer;
41};
42
43QT_END_NAMESPACE
44
45#endif // RECENTFILES_H
46

source code of qttools/src/linguist/linguist/recentfiles.h