Skip to content

Commit

Permalink
Add userProfileManager in QgisInterface (iface)
Browse files Browse the repository at this point in the history
Fixes #48337
  • Loading branch information
YoannQDQ committed Jan 6, 2023
1 parent 389a8ed commit f6c0bda
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
7 changes: 7 additions & 0 deletions python/gui/auto_generated/qgisinterface.sip.in
Expand Up @@ -840,6 +840,13 @@ Returns the insertion point.
This represents the current layer tree group and index where newly added map layers should be inserted into.

.. versionadded:: 3.10
%End

virtual QgsUserProfileManager *userProfileManager() = 0;
%Docstring
Returns a reference to the user profile manager

.. versionadded:: 3.30
%End

public slots: // TODO: do these functions really need to be slots?
Expand Down
5 changes: 5 additions & 0 deletions src/app/qgisappinterface.cpp
Expand Up @@ -903,3 +903,8 @@ QList<QgsMapDecoration *> QgisAppInterface::activeDecorations()
return qgis->activeDecorations();
}

QgsUserProfileManager *QgisAppInterface::userProfileManager()
{
return qgis->userProfileManager();
}

1 change: 1 addition & 0 deletions src/app/qgisappinterface.h
Expand Up @@ -308,6 +308,7 @@ class APP_EXPORT QgisAppInterface : public QgisInterface
QgsLayerTreeRegistryBridge::InsertionPoint layerTreeInsertionPoint() override;
void setGpsPanelConnection( QgsGpsConnection *connection ) override;
QList<QgsMapDecoration *> activeDecorations() override;
QgsUserProfileManager *userProfileManager() override;

private slots:

Expand Down
7 changes: 7 additions & 0 deletions src/gui/qgisinterface.h
Expand Up @@ -70,6 +70,7 @@ class QgsDevToolWidgetFactory;
class QgsGpsConnection;
class QgsApplicationExitBlockerInterface;
class QgsAbstractMapToolHandler;
class QgsUserProfileManager;

/**
* \ingroup gui
Expand Down Expand Up @@ -743,6 +744,12 @@ class GUI_EXPORT QgisInterface : public QObject
*/
virtual QgsLayerTreeRegistryBridge::InsertionPoint layerTreeInsertionPoint() = 0;

/**
* Returns a reference to the user profile manager
* \since QGIS 3.30
*/
virtual QgsUserProfileManager *userProfileManager() = 0;

public slots: // TODO: do these functions really need to be slots?

/* Exposed functions */
Expand Down

0 comments on commit f6c0bda

Please sign in to comment.