8 namespace frechet {
namespace app {
30 QDateTime adate = QDateTime::currentDateTime());
73 void init(QString agroup);
78 void restore(QSettings& settings);
86 size_t insert(QString path, QDateTime date = QDateTime::currentDateTime());
107 void beginFile(QSettings& settings,
size_t id,
bool forWrite=
false);
112 void endFile(QSettings& settings);
142 #endif // FILEHISTORY_H void onMenuSelected()
called when an item from the Open Recent menu is selected
bool operator<(const FileEntry &that) const
compare files by their last-used date
QString groupName
group identifier if preferences
void restore(QSettings &settings)
read settings from application preferences
void attachMenu(QAction *recent)
attach sub-menu
global definitions for all algorithms.
int indexOf(QString path)
find file by name
QAction * createMenuItem(const FileEntry &entry, int position)
create a new menu item in File/Open Recent
QString path
absolute path to file
FileEntry(QString apath, size_t id, QDateTime adate=QDateTime::currentDateTime())
default constructor
size_t next_id
next identifier
an entry in the recently opened file list
void open(QString)
raised when a file is selected from the "Open Recent" menu
void beginFile(QSettings &settings, size_t id, bool forWrite=false)
begin reading or updating file specific settings
keeps track of recently used files.
size_t id
unique identifier issued by FileHistory
QDateTime used
time when the file was last used
FileHistory()
empty constructor
void endFile(QSettings &settings)
end updating file specific settings
QMenu * menu
pointer to File/Open Recent menu
QList< FileEntry > files
list of file IDs; sorted by LRU
void moveMenuItem(int from, int to)
move a menu item
size_t insert(QString path, QDateTime date=QDateTime::currentDateTime())
insert a new file into the list
void init(QString agroup)
initialize file list and menu