Skip to content

Commit 15a48df

Browse files
committed
Pass QString by const ref
1 parent 7ba1b17 commit 15a48df

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

python/core/qgsuserprofilemanager.sip

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class QgsUserProfileManager : QObject
3434
User profile manager used to manage user profiles for the instance of QGIS.
3535
%End
3636

37-
static QString resolveProfilesFolder( const QString &basePath = QString() );
37+
static QString resolveProfilesFolder( const QString &basePath = QString() );
3838
%Docstring
3939
Resolves the profiles folder for the given path. Path will have \\profiles appended to the path
4040
\param basePath The base path to resolve the path from to append the \\profiles folder to.
@@ -58,7 +58,7 @@ class QgsUserProfileManager : QObject
5858
:rtype: QgsUserProfile
5959
%End
6060

61-
void setRootLocation( QString rootProfileLocation );
61+
void setRootLocation( const QString &rootProfileLocation );
6262
%Docstring
6363
Set the root profile location for the profile manager. All profiles are loaded from this
6464
location. Will also contain a profiles.ini for holding profile settings.
@@ -134,7 +134,7 @@ class QgsUserProfileManager : QObject
134134
:rtype: QgsError
135135
%End
136136

137-
QgsError deleteProfile( const QString name );
137+
QgsError deleteProfile( const QString &name );
138138
%Docstring
139139
Deletes a profile from the root profiles folder.
140140
.. note::

src/core/qgsuserprofilemanager.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ QgsUserProfile *QgsUserProfileManager::getProfile( const QString &defaultProfile
5858
return profile;
5959
}
6060

61-
void QgsUserProfileManager::setRootLocation( QString rootProfileLocation )
61+
void QgsUserProfileManager::setRootLocation( const QString &rootProfileLocation )
6262
{
6363
mRootProfilePath = rootProfileLocation;
6464

@@ -115,7 +115,7 @@ bool QgsUserProfileManager::profileExists( const QString &name ) const
115115
return allProfiles().contains( name );
116116
}
117117

118-
QgsUserProfile *QgsUserProfileManager::profileForName( const QString name ) const
118+
QgsUserProfile *QgsUserProfileManager::profileForName( const QString &name ) const
119119
{
120120
QString profilePath = mRootProfilePath + QDir::separator() + name;
121121
return new QgsUserProfile( profilePath );
@@ -154,7 +154,7 @@ QgsError QgsUserProfileManager::createUserProfile( const QString &name )
154154
return error;
155155
}
156156

157-
QgsError QgsUserProfileManager::deleteProfile( const QString name )
157+
QgsError QgsUserProfileManager::deleteProfile( const QString &name )
158158
{
159159
QgsError error;
160160
QDir folder( mRootProfilePath + QDir::separator() + name );

src/core/qgsuserprofilemanager.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class CORE_EXPORT QgsUserProfileManager : public QObject
5353
* \param basePath The base path to resolve the path from to append the \\profiles folder to.
5454
* \return The root path to store user profiles.
5555
*/
56-
static QString resolveProfilesFolder( const QString &basePath = QString() );
56+
static QString resolveProfilesFolder( const QString &basePath = QString() );
5757

5858
/**
5959
* Return the profile from the given root profile location.
@@ -73,7 +73,7 @@ class CORE_EXPORT QgsUserProfileManager : public QObject
7373
* location. Will also contain a profiles.ini for holding profile settings.
7474
* \param rootProfileLocation Path to the top level profile folder which contains folders for each profile.
7575
*/
76-
void setRootLocation( QString rootProfileLocation );
76+
void setRootLocation( const QString &rootProfileLocation );
7777

7878
/**
7979
* Returns the path to the root profiles location.
@@ -141,7 +141,7 @@ class CORE_EXPORT QgsUserProfileManager : public QObject
141141
* \param name The name of the profile to delete.
142142
* \return A QgsError with a message if the profile failed to be deleted.
143143
*/
144-
QgsError deleteProfile( const QString name );
144+
QgsError deleteProfile( const QString &name );
145145

146146
/**
147147
* The currently active user profile.

0 commit comments

Comments
 (0)