QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
|
The QgsHistoryProviderRegistry is a registry for objects which track user history (i.e. More...
#include <qgshistoryproviderregistry.h>
Classes | |
class | HistoryEntryOptions |
Contains options for storing history entries. More... | |
Public Member Functions | |
QgsHistoryProviderRegistry (QObject *parent=nullptr, bool useMemoryDatabase=false) | |
Creates a new empty history provider registry. More... | |
~QgsHistoryProviderRegistry () override | |
void | addDefaultProviders () |
Adds the default history providers to the registry. More... | |
bool | addEntries (const QList< QgsHistoryEntry > &entries, QgsHistoryProviderRegistry::HistoryEntryOptions options=QgsHistoryProviderRegistry::HistoryEntryOptions()) |
Adds a list of entries to the history logs. More... | |
long long | addEntry (const QgsHistoryEntry &entry, bool &ok, QgsHistoryProviderRegistry::HistoryEntryOptions options=QgsHistoryProviderRegistry::HistoryEntryOptions()) |
Adds an entry to the history logs. More... | |
long long | addEntry (const QString &providerId, const QVariantMap &entry, bool &ok, QgsHistoryProviderRegistry::HistoryEntryOptions options=QgsHistoryProviderRegistry::HistoryEntryOptions()) |
Adds an entry to the history logs. More... | |
bool | addProvider (QgsAbstractHistoryProvider *provider) |
Adds a provider to the registry. More... | |
bool | clearHistory (Qgis::HistoryProviderBackend backend) |
Clears the history for the specified backend. More... | |
QgsHistoryEntry | entry (long long id, bool &ok, Qgis::HistoryProviderBackend backend=Qgis::HistoryProviderBackend::LocalProfile) const |
Returns the entry with matching ID, from the specified backend. More... | |
QgsAbstractHistoryProvider * | providerById (const QString &id) |
Returns the provider with matching id, or nullptr if no matching provider is registered. More... | |
QStringList | providerIds () const |
Returns a list of the registered provider IDs. More... | |
QList< QgsHistoryEntry > | queryEntries (const QDateTime &start=QDateTime(), const QDateTime &end=QDateTime(), const QString &providerId=QString(), Qgis::HistoryProviderBackends backends=Qgis::HistoryProviderBackend::LocalProfile) const |
Queries history entries which occurred between the specified start and end times. More... | |
bool | removeProvider (const QString &id) |
Removes the provider with matching id. More... | |
bool | updateEntry (long long id, const QVariantMap &entry, Qgis::HistoryProviderBackend backend=Qgis::HistoryProviderBackend::LocalProfile) |
Updates the existing entry with matching id. More... | |
Static Public Member Functions | |
static QString | userHistoryDbPath () |
Returns the path to user's local history database. More... | |
The QgsHistoryProviderRegistry is a registry for objects which track user history (i.e.
operations performed through the GUI).
QgsHistoryProviderRegistry is not usually directly created, but rather accessed through QgsGui::historyProviderRegistry().
Definition at line 89 of file qgshistoryproviderregistry.h.
QgsHistoryProviderRegistry::QgsHistoryProviderRegistry | ( | QObject * | parent = nullptr , |
bool | useMemoryDatabase = false |
||
) |
Creates a new empty history provider registry.
QgsHistoryProviderRegistry is not usually directly created, but rather accessed through QgsGui::historyProviderRegistry().
Definition at line 51 of file qgshistoryproviderregistry.cpp.
|
override |
Definition at line 76 of file qgshistoryproviderregistry.cpp.
void QgsHistoryProviderRegistry::addDefaultProviders | ( | ) |
Adds the default history providers to the registry.
Definition at line 81 of file qgshistoryproviderregistry.cpp.
bool QgsHistoryProviderRegistry::addEntries | ( | const QList< QgsHistoryEntry > & | entries, |
QgsHistoryProviderRegistry::HistoryEntryOptions | options = QgsHistoryProviderRegistry::HistoryEntryOptions() |
||
) |
Adds a list of entries to the history logs.
Definition at line 144 of file qgshistoryproviderregistry.cpp.
long long QgsHistoryProviderRegistry::addEntry | ( | const QgsHistoryEntry & | entry, |
bool & | ok, | ||
QgsHistoryProviderRegistry::HistoryEntryOptions | options = QgsHistoryProviderRegistry::HistoryEntryOptions() |
||
) |
Adds an entry to the history logs.
entry | entry to add |
ok | will be set to true if entry was successfully added |
options | options |
Definition at line 119 of file qgshistoryproviderregistry.cpp.
long long QgsHistoryProviderRegistry::addEntry | ( | const QString & | providerId, |
const QVariantMap & | entry, | ||
bool & | ok, | ||
QgsHistoryProviderRegistry::HistoryEntryOptions | options = QgsHistoryProviderRegistry::HistoryEntryOptions() |
||
) |
Adds an entry to the history logs.
The entry will be tagged with the current date/time as the timestamp.
The providerId specifies the history provider responsible for this entry. Entry options are specified via the options argument.
providerId | associated QgsAbstractHistoryProvider::id() |
entry | entry to add |
ok | will be set to true if entry was successfully added |
options | options |
Definition at line 114 of file qgshistoryproviderregistry.cpp.
bool QgsHistoryProviderRegistry::addProvider | ( | QgsAbstractHistoryProvider * | provider | ) |
Adds a provider to the registry.
Ownership of the provider is transferred to the registry.
Returns true
if the provider was successfully added.
Definition at line 86 of file qgshistoryproviderregistry.cpp.
bool QgsHistoryProviderRegistry::clearHistory | ( | Qgis::HistoryProviderBackend | backend | ) |
Clears the history for the specified backend.
Definition at line 280 of file qgshistoryproviderregistry.cpp.
QgsHistoryEntry QgsHistoryProviderRegistry::entry | ( | long long | id, |
bool & | ok, | ||
Qgis::HistoryProviderBackend | backend = Qgis::HistoryProviderBackend::LocalProfile |
||
) | const |
Returns the entry with matching ID, from the specified backend.
id | ID of entry to find |
ok | will be set to true if entry was found |
backend | associated backend |
Definition at line 158 of file qgshistoryproviderregistry.cpp.
QgsAbstractHistoryProvider * QgsHistoryProviderRegistry::providerById | ( | const QString & | id | ) |
Returns the provider with matching id, or nullptr
if no matching provider is registered.
Definition at line 95 of file qgshistoryproviderregistry.cpp.
QStringList QgsHistoryProviderRegistry::providerIds | ( | ) | const |
Returns a list of the registered provider IDs.
Definition at line 109 of file qgshistoryproviderregistry.cpp.
QList< QgsHistoryEntry > QgsHistoryProviderRegistry::queryEntries | ( | const QDateTime & | start = QDateTime() , |
const QDateTime & | end = QDateTime() , |
||
const QString & | providerId = QString() , |
||
Qgis::HistoryProviderBackends | backends = Qgis::HistoryProviderBackend::LocalProfile |
||
) | const |
Queries history entries which occurred between the specified start and end times.
The optional providerId and backends arguments can be used to filter entries.
Definition at line 223 of file qgshistoryproviderregistry.cpp.
bool QgsHistoryProviderRegistry::removeProvider | ( | const QString & | id | ) |
Removes the provider with matching id.
The provider will be deleted.
Returns true
if the provider was successfully removed.
Definition at line 100 of file qgshistoryproviderregistry.cpp.
bool QgsHistoryProviderRegistry::updateEntry | ( | long long | id, |
const QVariantMap & | entry, | ||
Qgis::HistoryProviderBackend | backend = Qgis::HistoryProviderBackend::LocalProfile |
||
) |
Updates the existing entry with matching id.
This method allows the content of an entry to be updated, e.g. to add additional properties to the content. (Such as recording the results of after a long-running operation completes).
Definition at line 200 of file qgshistoryproviderregistry.cpp.
|
static |
Returns the path to user's local history database.
Definition at line 275 of file qgshistoryproviderregistry.cpp.