|
wiRedPanda
Logic Circuit Simulator
|
Manages the list of recently opened .panda files. More...
#include <RecentFiles.h>
Public Member Functions | |
| void | addRecentFile (const QString &filePath) |
| Prepends filePath to the recent-files list and saves it. | |
| RecentFiles (QObject *parent=nullptr) | |
| Constructs the recent-files manager with parent. | |
| QStringList | recentFiles () |
| Returns the current list of recent file paths. | |
| void | recentFilesUpdated () |
| Emitted whenever the recent-files list changes (add or file deleted). | |
Static Public Attributes | |
| static constexpr int | maxFiles = 10 |
Manages the list of recently opened .panda files.
Files are persisted to QSettings and watched with QFileSystemWatcher so that deleted files are automatically removed from the list. A maximum of maxFiles entries is kept.
Definition at line 21 of file RecentFiles.h.
|
explicit |
Constructs the recent-files manager with parent.
Definition at line 14 of file RecentFiles.cpp.
References Settings::recentFiles(), and recentFilesUpdated().
| void RecentFiles::addRecentFile | ( | const QString & | filePath | ) |
Prepends filePath to the recent-files list and saves it.
| filePath | Absolute path of the file just opened or saved. |
Definition at line 37 of file RecentFiles.cpp.
References maxFiles, qCDebug, and recentFilesUpdated().
| QStringList RecentFiles::recentFiles | ( | ) |
Returns the current list of recent file paths.
Definition at line 63 of file RecentFiles.cpp.
| void RecentFiles::recentFilesUpdated | ( | ) |
Emitted whenever the recent-files list changes (add or file deleted).
Referenced by addRecentFile(), and RecentFiles().
|
staticconstexpr |
Definition at line 31 of file RecentFiles.h.
Referenced by addRecentFile().