wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
RecentFiles.h
Go to the documentation of this file.
1// Copyright 2015 - 2026, GIBIS-UNIFESP and the wiRedPanda contributors
2// SPDX-License-Identifier: GPL-3.0-or-later
3
7
8#pragma once
9
10#include <QFileSystemWatcher>
11#include <QObject>
12
21class RecentFiles : public QObject
22{
23 Q_OBJECT
24
25public:
26 // --- Lifecycle ---
27
29 explicit RecentFiles(QObject *parent = nullptr);
30
31 static constexpr int maxFiles = 10;
32
33 // --- Access ---
34
39 QStringList recentFiles();
40
45 void addRecentFile(const QString &filePath);
46
47signals:
50
51private:
52 // --- Helpers ---
53
54 void saveRecentFiles();
55
56 // --- Members ---
57
58 QStringList m_files;
59 QFileSystemWatcher m_fileWatcher;
60};
static constexpr int maxFiles
Definition RecentFiles.h:31
void recentFilesUpdated()
Emitted whenever the recent-files list changes (add or file deleted).
QStringList recentFiles()
Returns the current list of recent file paths.
RecentFiles(QObject *parent=nullptr)
Constructs the recent-files manager with parent.
void addRecentFile(const QString &filePath)
Prepends filePath to the recent-files list and saves it.