Pass QString by const ref

This commit is contained in:
Nyall Dawson 2017-09-01 08:57:24 +10:00
parent 7ba1b1734b
commit 15a48df644
3 changed files with 9 additions and 9 deletions

View File

@ -34,7 +34,7 @@ class QgsUserProfileManager : QObject
User profile manager used to manage user profiles for the instance of QGIS. User profile manager used to manage user profiles for the instance of QGIS.
%End %End
static QString resolveProfilesFolder( const QString &basePath = QString() ); static QString resolveProfilesFolder( const QString &basePath = QString() );
%Docstring %Docstring
Resolves the profiles folder for the given path. Path will have \\profiles appended to the path Resolves the profiles folder for the given path. Path will have \\profiles appended to the path
\param basePath The base path to resolve the path from to append the \\profiles folder to. \param basePath The base path to resolve the path from to append the \\profiles folder to.
@ -58,7 +58,7 @@ class QgsUserProfileManager : QObject
:rtype: QgsUserProfile :rtype: QgsUserProfile
%End %End
void setRootLocation( QString rootProfileLocation ); void setRootLocation( const QString &rootProfileLocation );
%Docstring %Docstring
Set the root profile location for the profile manager. All profiles are loaded from this Set the root profile location for the profile manager. All profiles are loaded from this
location. Will also contain a profiles.ini for holding profile settings. location. Will also contain a profiles.ini for holding profile settings.
@ -134,7 +134,7 @@ class QgsUserProfileManager : QObject
:rtype: QgsError :rtype: QgsError
%End %End
QgsError deleteProfile( const QString name ); QgsError deleteProfile( const QString &name );
%Docstring %Docstring
Deletes a profile from the root profiles folder. Deletes a profile from the root profiles folder.
.. note:: .. note::

View File

@ -58,7 +58,7 @@ QgsUserProfile *QgsUserProfileManager::getProfile( const QString &defaultProfile
return profile; return profile;
} }
void QgsUserProfileManager::setRootLocation( QString rootProfileLocation ) void QgsUserProfileManager::setRootLocation( const QString &rootProfileLocation )
{ {
mRootProfilePath = rootProfileLocation; mRootProfilePath = rootProfileLocation;
@ -115,7 +115,7 @@ bool QgsUserProfileManager::profileExists( const QString &name ) const
return allProfiles().contains( name ); return allProfiles().contains( name );
} }
QgsUserProfile *QgsUserProfileManager::profileForName( const QString name ) const QgsUserProfile *QgsUserProfileManager::profileForName( const QString &name ) const
{ {
QString profilePath = mRootProfilePath + QDir::separator() + name; QString profilePath = mRootProfilePath + QDir::separator() + name;
return new QgsUserProfile( profilePath ); return new QgsUserProfile( profilePath );
@ -154,7 +154,7 @@ QgsError QgsUserProfileManager::createUserProfile( const QString &name )
return error; return error;
} }
QgsError QgsUserProfileManager::deleteProfile( const QString name ) QgsError QgsUserProfileManager::deleteProfile( const QString &name )
{ {
QgsError error; QgsError error;
QDir folder( mRootProfilePath + QDir::separator() + name ); QDir folder( mRootProfilePath + QDir::separator() + name );

View File

@ -53,7 +53,7 @@ class CORE_EXPORT QgsUserProfileManager : public QObject
* \param basePath The base path to resolve the path from to append the \\profiles folder to. * \param basePath The base path to resolve the path from to append the \\profiles folder to.
* \return The root path to store user profiles. * \return The root path to store user profiles.
*/ */
static QString resolveProfilesFolder( const QString &basePath = QString() ); static QString resolveProfilesFolder( const QString &basePath = QString() );
/** /**
* Return the profile from the given root profile location. * Return the profile from the given root profile location.
@ -73,7 +73,7 @@ class CORE_EXPORT QgsUserProfileManager : public QObject
* location. Will also contain a profiles.ini for holding profile settings. * location. Will also contain a profiles.ini for holding profile settings.
* \param rootProfileLocation Path to the top level profile folder which contains folders for each profile. * \param rootProfileLocation Path to the top level profile folder which contains folders for each profile.
*/ */
void setRootLocation( QString rootProfileLocation ); void setRootLocation( const QString &rootProfileLocation );
/** /**
* Returns the path to the root profiles location. * Returns the path to the root profiles location.
@ -141,7 +141,7 @@ class CORE_EXPORT QgsUserProfileManager : public QObject
* \param name The name of the profile to delete. * \param name The name of the profile to delete.
* \return A QgsError with a message if the profile failed to be deleted. * \return A QgsError with a message if the profile failed to be deleted.
*/ */
QgsError deleteProfile( const QString name ); QgsError deleteProfile( const QString &name );
/** /**
* The currently active user profile. * The currently active user profile.