Skip to content

Commit

Permalink
Pass QString by const ref
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Aug 31, 2017
1 parent 7ba1b17 commit 15a48df
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions python/core/qgsuserprofilemanager.sip
Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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::
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgsuserprofilemanager.cpp
Expand Up @@ -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;

Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgsuserprofilemanager.h
Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 15a48df

Please sign in to comment.