Add missing SIP_FACTORY

This commit is contained in:
Nyall Dawson 2017-09-01 08:56:57 +10:00
parent 42b3e0bb10
commit 7ba1b1734b
3 changed files with 5 additions and 6 deletions

View File

@ -118,7 +118,7 @@ class QgsUserProfileManager : QObject
Set the default profile name from the current active profile. Set the default profile name from the current active profile.
%End %End
QgsUserProfile *profileForName( const QString name ) const; QgsUserProfile *profileForName( const QString &name ) const /Factory/;
%Docstring %Docstring
Return the profile found for a given name. Return the profile found for a given name.
\param name The name of the profile to return. \param name The name of the profile to return.

View File

@ -2283,13 +2283,12 @@ void QgisApp::refreshProfileMenu()
Q_FOREACH ( const QString &name, userProfileManager()->allProfiles() ) Q_FOREACH ( const QString &name, userProfileManager()->allProfiles() )
{ {
profile = userProfileManager()->profileForName( name ); std::unique_ptr< QgsUserProfile > namedProfile( userProfileManager()->profileForName( name ) );
QAction *action = new QAction( profile->icon(), profile->alias(), mConfigMenu ); QAction *action = new QAction( namedProfile->icon(), namedProfile->alias(), mConfigMenu );
action->setToolTip( profile->folder() ); action->setToolTip( namedProfile->folder() );
action->setCheckable( true ); action->setCheckable( true );
profileGroup->addAction( action ); profileGroup->addAction( action );
mConfigMenu->addAction( action ); mConfigMenu->addAction( action );
delete profile;
if ( name == activeName ) if ( name == activeName )
{ {

View File

@ -126,7 +126,7 @@ class CORE_EXPORT QgsUserProfileManager : public QObject
* \param name The name of the profile to return. * \param name The name of the profile to return.
* \return A QgsUserprofile pointing to the location of the user profile. * \return A QgsUserprofile pointing to the location of the user profile.
*/ */
QgsUserProfile *profileForName( const QString name ) const; QgsUserProfile *profileForName( const QString &name ) const SIP_FACTORY;
/** /**
* Create a user profile given by the name * Create a user profile given by the name