wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
RecentFiles Class Reference

Manages the list of recently opened .panda files. More...

#include <RecentFiles.h>

Inheritance diagram for RecentFiles:
[legend]

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

Detailed Description

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.

Constructor & Destructor Documentation

◆ RecentFiles()

RecentFiles::RecentFiles ( QObject * parent = nullptr)
explicit

Constructs the recent-files manager with parent.

Definition at line 14 of file RecentFiles.cpp.

References Settings::recentFiles(), and recentFilesUpdated().

Member Function Documentation

◆ addRecentFile()

void RecentFiles::addRecentFile ( const QString & filePath)

Prepends filePath to the recent-files list and saves it.

Parameters
filePathAbsolute path of the file just opened or saved.

Definition at line 37 of file RecentFiles.cpp.

References maxFiles, qCDebug, and recentFilesUpdated().

◆ recentFiles()

QStringList RecentFiles::recentFiles ( )

Returns the current list of recent file paths.

Returns
Paths in most-recently-used order.

Definition at line 63 of file RecentFiles.cpp.

◆ recentFilesUpdated()

void RecentFiles::recentFilesUpdated ( )

Emitted whenever the recent-files list changes (add or file deleted).

Referenced by addRecentFile(), and RecentFiles().

Member Data Documentation

◆ maxFiles

int RecentFiles::maxFiles = 10
staticconstexpr

Definition at line 31 of file RecentFiles.h.

Referenced by addRecentFile().


The documentation for this class was generated from the following files: