Skip to content
Permalink
Browse files

Pass QString by const ref

  • Loading branch information
nyalldawson committed Aug 31, 2017
1 parent 7ba1b17 commit 15a48df6449651e204cd73b47538a5672e693795
@@ -34,7 +34,7 @@ class QgsUserProfileManager : QObject
User profile manager used to manage user profiles for the instance of QGIS.
%End

static QString resolveProfilesFolder( const QString &basePath = QString() );
static QString resolveProfilesFolder( const QString &basePath = QString() );
%Docstring
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.
@@ -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::
@@ -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 );
@@ -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.
* \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.
@@ -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.

0 comments on commit 15a48df

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