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

@ -58,7 +58,7 @@ class QgsUserProfileManager : QObject
:rtype: QgsUserProfile
%End
void setRootLocation( QString rootProfileLocation );
void setRootLocation( const QString &rootProfileLocation );
%Docstring
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.
@ -134,7 +134,7 @@ class QgsUserProfileManager : QObject
:rtype: QgsError
%End
QgsError deleteProfile( const QString name );
QgsError deleteProfile( const QString &name );
%Docstring
Deletes a profile from the root profiles folder.
.. note::

View File

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

View File

@ -73,7 +73,7 @@ class CORE_EXPORT QgsUserProfileManager : public QObject
* 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.
*/
void setRootLocation( QString rootProfileLocation );
void setRootLocation( const QString &rootProfileLocation );
/**
* 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.
* \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.