diff --git a/python/gui/auto_generated/history/qgshistoryprovider.sip.in b/python/gui/auto_generated/history/qgshistoryprovider.sip.in index f514f62dc13..4b7ab07590a 100644 --- a/python/gui/auto_generated/history/qgshistoryprovider.sip.in +++ b/python/gui/auto_generated/history/qgshistoryprovider.sip.in @@ -36,6 +36,20 @@ Abstract base class for objects which track user history (i.e. operations perfor virtual QString id() const = 0; %Docstring Returns the provider's unique id, which is used to associate existing history entries with the provider. +%End + + virtual QgsHistoryEntryNode *createNodeForEntry( const QVariantMap &entry ) /Factory/; +%Docstring +Creates a new history node for the given ``entry``. + +.. versionadded:: 3.32 +%End + + virtual void updateNodeForEntry( QgsHistoryEntryNode *node, const QVariantMap &entry ); +%Docstring +Updates an existing history ``node`` for the given ``entry``. + +.. versionadded:: 3.32 %End }; diff --git a/src/gui/history/qgshistoryprovider.cpp b/src/gui/history/qgshistoryprovider.cpp index 5b07ef5e8ea..7d3a64535e0 100644 --- a/src/gui/history/qgshistoryprovider.cpp +++ b/src/gui/history/qgshistoryprovider.cpp @@ -17,3 +17,13 @@ #include "qgshistoryprovider.h" QgsAbstractHistoryProvider::~QgsAbstractHistoryProvider() = default; + +QgsHistoryEntryNode *QgsAbstractHistoryProvider::createNodeForEntry( const QVariantMap & ) +{ + return nullptr; +} + +void QgsAbstractHistoryProvider::updateNodeForEntry( QgsHistoryEntryNode *, const QVariantMap & ) +{ + +} diff --git a/src/gui/history/qgshistoryprovider.h b/src/gui/history/qgshistoryprovider.h index 38af8dcca6d..9646193606f 100644 --- a/src/gui/history/qgshistoryprovider.h +++ b/src/gui/history/qgshistoryprovider.h @@ -52,13 +52,20 @@ class GUI_EXPORT QgsAbstractHistoryProvider */ virtual QString id() const = 0; -#if 0 - /** * Creates a new history node for the given \a entry. + * + * \since QGIS 3.32 */ - virtual QgsHistoryEntryNode *createNodeForEntry( const QVariantMap &entry ) = 0 SIP_FACTORY; -#endif + virtual QgsHistoryEntryNode *createNodeForEntry( const QVariantMap &entry ) SIP_FACTORY; + + /** + * Updates an existing history \a node for the given \a entry. + * + * \since QGIS 3.32 + */ + virtual void updateNodeForEntry( QgsHistoryEntryNode *node, const QVariantMap &entry ); + }; #endif //QGSHISTORYPROVIDER_H