Skip to content
Permalink
Browse files

Make setInstance private and QgsConfigCache a friend

  • Loading branch information
elpaso committed Jun 17, 2018
1 parent 65c1ed2 commit 9c8545722dcd9992921dab3a37c313b793bab6a1
@@ -46,7 +46,6 @@ Most of the time you want to use QgsProject.instance() instead as many component

~QgsProject();


void setTitle( const QString &title );
%Docstring
Sets the project's title.
@@ -110,23 +110,14 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera
~QgsProject() override;

/**
* Set the current project instance to \a project
*
* \note this is used mainly by the server, which caches the projects and (potentially) needs to switch the current instance on every request
* \see instance()
* \since QGIS 3.2
*/
static void setInstance( QgsProject *project ) SIP_SKIP;

/**
* Sets the project's title.
* \param title new title
*
* \note Since QGIS 3.2 this is just a shortcut to setting the title in the project's metadata().
*
* \see title()
* \since QGIS 2.4
*/
* Sets the project's title.
* \param title new title
*
* \note Since QGIS 3.2 this is just a shortcut to setting the title in the project's metadata().
*
* \see title()
* \since QGIS 2.4
*/
void setTitle( const QString &title );

/**
@@ -1266,6 +1257,16 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera

static QgsProject *sProject;

/**
* Set the current project instance to \a project
*
* \note this is used mainly by the server, which caches the projects and (potentially) needs to switch the current instance on every request
* \see instance()
* \note not available in Python bindings
* \since QGIS 3.2
*/
static void setInstance( QgsProject *project ) SIP_SKIP;

/**
* Read map layers from project file.
* \param doc DOM document to parse
@@ -1371,6 +1372,9 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera
QgsProjectMetadata mMetadata;

friend class QgsProjectDirtyBlocker;

// Required by QGIS Server for switching the current project instance
friend class QgsConfigCache;
};

/**
Binary file not shown.

0 comments on commit 9c85457

Please sign in to comment.
You can’t perform that action at this time.