![]() |
Fréchet View
1.6.0
A Tool for Exploring Fréchet Distance Algorithms
|
keeps track of recently used files.
This list appears in the File / Open Recent menu. It is stored to disk as part of the application preferences.
Definition at line 48 of file filehistory.h.
#include <filehistory.h>
Inherits QObject.
Public Slots | |
| void | onMenuSelected () |
| called when an item from the Open Recent menu is selected More... | |
Signals | |
| void | open (QString) |
| raised when a file is selected from the "Open Recent" menu More... | |
Public Member Functions | |
| FileHistory () | |
| empty constructor More... | |
| void | init (QString agroup) |
| initialize file list and menu More... | |
| void | restore (QSettings &settings) |
| read settings from application preferences More... | |
| size_t | insert (QString path, QDateTime date=QDateTime::currentDateTime()) |
| insert a new file into the list More... | |
| size_t | lastId () const |
| QString | lastFile () const |
| void | attachMenu (QAction *recent) |
| attach sub-menu More... | |
| void | beginFile (QSettings &settings, size_t id, bool forWrite=false) |
| begin reading or updating file specific settings More... | |
| void | endFile (QSettings &settings) |
| end updating file specific settings More... | |
Private Member Functions | |
| int | indexOf (QString path) |
| find file by name More... | |
| int | indexOf (size_t id) |
| find file by ID More... | |
| QAction * | createMenuItem (const FileEntry &entry, int position) |
| create a new menu item in File/Open Recent More... | |
| void | moveMenuItem (int from, int to) |
| move a menu item More... | |
Private Attributes | |
| QList< FileEntry > | files |
| list of file IDs; sorted by LRU More... | |
| QString | groupName |
| group identifier if preferences More... | |
| size_t | next_id |
| next identifier More... | |
| QMenu * | menu |
| pointer to File/Open Recent menu More... | |
| FileHistory::FileHistory | ( | ) |
empty constructor
Definition at line 43 of file filehistory.cpp.
| void FileHistory::attachMenu | ( | QAction * | recent | ) |
attach sub-menu
| recent | QAction that holds the File/Open Recent menu |
Definition at line 101 of file filehistory.cpp.
| void FileHistory::beginFile | ( | QSettings & | settings, |
| size_t | id, | ||
| bool | forWrite = false |
||
| ) |
begin reading or updating file specific settings
| settings | application preferences |
| id | file identifier (as issued by insert()) |
| forWrite | if true, file settings will be updated |
Definition at line 107 of file filehistory.cpp.
|
private |
create a new menu item in File/Open Recent
| entry | an entry in file history |
| position | index in menu |
Definition at line 153 of file filehistory.cpp.
| void FileHistory::endFile | ( | QSettings & | settings | ) |
end updating file specific settings
| settings | application preferences |
Definition at line 128 of file filehistory.cpp.
|
private |
find file by name
| path | complete file name and path |
Definition at line 170 of file filehistory.cpp.
|
private |
find file by ID
| id | file ID |
Definition at line 145 of file filehistory.cpp.
| void FileHistory::init | ( | QString | agroup | ) |
initialize file list and menu
| agroup | group identifier in preferences |
Definition at line 47 of file filehistory.cpp.
| size_t FileHistory::insert | ( | QString | path, |
| QDateTime | date = QDateTime::currentDateTime() |
||
| ) |
insert a new file into the list
| path | absolute file path |
| date | last-used date (defaults to current date) |
Definition at line 23 of file filehistory.cpp.
| QString FileHistory::lastFile | ( | ) | const |
Definition at line 94 of file filehistory.cpp.
| size_t FileHistory::lastId | ( | ) | const |
Definition at line 86 of file filehistory.cpp.
|
private |
move a menu item
| from | old index |
| to | new index |
Definition at line 165 of file filehistory.cpp.
|
slot |
called when an item from the Open Recent menu is selected
Definition at line 134 of file filehistory.cpp.
|
signal |
raised when a file is selected from the "Open Recent" menu
| void FileHistory::restore | ( | QSettings & | settings | ) |
read settings from application preferences
| settings | application preferences |
Definition at line 53 of file filehistory.cpp.
|
private |
list of file IDs; sorted by LRU
Definition at line 53 of file filehistory.h.
|
private |
group identifier if preferences
Definition at line 55 of file filehistory.h.
|
private |
pointer to File/Open Recent menu
Definition at line 59 of file filehistory.h.
|
private |
next identifier
Definition at line 57 of file filehistory.h.