manages recently used resources More...
#include <pqRecentlyUsedResourcesList.h>
Inherits QObject.
Public Types | |
typedef QList< pqServerResource > | ListT |
convenience typedef. More... | |
Signals | |
void | changed () |
Signal emitted whenever the collection is changed i.e. More... | |
Public Member Functions | |
pqRecentlyUsedResourcesList (QObject *parent=nullptr) | |
~pqRecentlyUsedResourcesList () override | |
void | add (const pqServerResource &resource) |
Add a resource to the collection. More... | |
const QList< pqServerResource > & | list () const |
Returns the contents of the collection ordered from most-recently-used to least-recently-used. More... | |
void | load (pqSettings &) |
Load the collection (from local user preferences) More... | |
void | save (pqSettings &) const |
Save the collection (to local user preferences) More... | |
manages recently used resources
pqRecentlyUsedResourcesList manages recently used resources, such as data files, state files, etc. When user performs an action (e.g. loading of data, loading of state file) that should be saved to the recently used resource list, simply add it using pqRecentlyUsedResourcesList::add()
. One stats with the pqServerResource
obtained from the server on which the action was performed and the can add meta-data to it, as needed e.g.
Now, applications can use pqRecentFilesMenu
(or something similar) to show these resources in some menu or other UI element.
pqRecentlyUsedResourcesList itself doesn't handle reloading the resource from the list. That is left to the application. pqRecentFilesMenu
, for example, uses implementations of pqRecentlyUsedResourceLoaderInterface
registered with the pqInterfaceTracker
to attempt to load the resource.
Definition at line 48 of file pqRecentlyUsedResourcesList.h.
typedef QList<pqServerResource> pqRecentlyUsedResourcesList::ListT |
convenience typedef.
Definition at line 60 of file pqRecentlyUsedResourcesList.h.
pqRecentlyUsedResourcesList::pqRecentlyUsedResourcesList | ( | QObject * | parent = nullptr | ) |
|
override |
void pqRecentlyUsedResourcesList::add | ( | const pqServerResource & | resource | ) |
Add a resource to the collection.
Moves the resource to the beginning of the list.
|
inline |
Returns the contents of the collection ordered from most-recently-used to least-recently-used.
Definition at line 72 of file pqRecentlyUsedResourcesList.h.
void pqRecentlyUsedResourcesList::load | ( | pqSettings & | ) |
Load the collection (from local user preferences)
void pqRecentlyUsedResourcesList::save | ( | pqSettings & | ) | const |
Save the collection (to local user preferences)
|
signal |
Signal emitted whenever the collection is changed i.e.
new items are added or removed.