Public Types | Signals | Public Member Functions | List of all members
pqRecentlyUsedResourcesList Class Reference

manages recently used resources More...

#include <pqRecentlyUsedResourcesList.h>

Inherits QObject.

Public Types

typedef QList< pqServerResourceListT
 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...
 

Detailed Description

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.

pqServerResource resource = server->getResource();
resource.setPath(...);
resource.addData("foo1", "bar1");
resource.addData("foo2", "bar2");
core->recentlyUsedResources().add(resource);

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.

See also
pqServerResource, pqRecentlyUsedResourcesList, pqRecentlyUsedResourceLoaderInterface

Definition at line 48 of file pqRecentlyUsedResourcesList.h.

Member Typedef Documentation

◆ ListT

convenience typedef.

Definition at line 60 of file pqRecentlyUsedResourcesList.h.

Constructor & Destructor Documentation

◆ pqRecentlyUsedResourcesList()

pqRecentlyUsedResourcesList::pqRecentlyUsedResourcesList ( QObject *  parent = nullptr)

◆ ~pqRecentlyUsedResourcesList()

pqRecentlyUsedResourcesList::~pqRecentlyUsedResourcesList ( )
override

Member Function Documentation

◆ add()

void pqRecentlyUsedResourcesList::add ( const pqServerResource resource)

Add a resource to the collection.

Moves the resource to the beginning of the list.

◆ list()

const QList<pqServerResource>& pqRecentlyUsedResourcesList::list ( ) const
inline

Returns the contents of the collection ordered from most-recently-used to least-recently-used.

Definition at line 72 of file pqRecentlyUsedResourcesList.h.

◆ load()

void pqRecentlyUsedResourcesList::load ( pqSettings )

Load the collection (from local user preferences)

◆ save()

void pqRecentlyUsedResourcesList::save ( pqSettings ) const

Save the collection (to local user preferences)

◆ changed

void pqRecentlyUsedResourcesList::changed ( )
signal

Signal emitted whenever the collection is changed i.e.

new items are added or removed.


The documentation for this class was generated from the following file:
pqServer::getResource
const pqServerResource & getResource()
pqActiveObjects::instance
static pqActiveObjects & instance()
Provides access to the singleton.
pqActiveObjects::activeServer
pqServer * activeServer() const
Returns the active server.
Definition: pqActiveObjects.h:76
pqServer
pqServer (should be renamed to pqSession) is a pqServerManagerModelItem subclass that represents a vt...
Definition: pqServer.h:35
pqServerResource
pqServerResource encapsulates a resource in ParaView.
Definition: pqServerResource.h:73
pqApplicationCore::recentlyUsedResources
pqRecentlyUsedResourcesList & recentlyUsedResources()
Returns the set of recently-used resources i.e.
pqServerResource::addData
void addData(const QString &key, const QString &value)
Add a data on this resource, with a key/value logic.
pqApplicationCore
This class is the crux of the ParaView application.
Definition: pqApplicationCore.h:60
pqApplicationCore::instance
static pqApplicationCore * instance()
pqServerResource::setPath
void setPath(const QString &)
Set the path to the resource.
pqRecentlyUsedResourcesList::add
void add(const pqServerResource &resource)
Add a resource to the collection.