diff --git a/src/core/qgsuserprofilemanager.cpp b/src/core/qgsuserprofilemanager.cpp index 0e69be28dc99..a09a86db4f1f 100644 --- a/src/core/qgsuserprofilemanager.cpp +++ b/src/core/qgsuserprofilemanager.cpp @@ -71,7 +71,7 @@ void QgsUserProfileManager::setRootLocation( QString rootProfileLocation ) { mWatcher->addPath( mRootProfilePath ); } - mSettings = new QSettings( settingsFile(), QSettings::IniFormat ); + mSettings.reset( new QSettings( settingsFile(), QSettings::IniFormat ) ); } bool QgsUserProfileManager::rootLocationIsSet() const @@ -172,7 +172,7 @@ QgsError QgsUserProfileManager::deleteProfile( const QString name ) return error; } -QString QgsUserProfileManager::settingsFile() +QString QgsUserProfileManager::settingsFile() const { return mRootProfilePath + QDir::separator() + "profiles.ini"; } diff --git a/src/core/qgsuserprofilemanager.h b/src/core/qgsuserprofilemanager.h index d991d635dde8..76dabb308b9d 100644 --- a/src/core/qgsuserprofilemanager.h +++ b/src/core/qgsuserprofilemanager.h @@ -179,9 +179,9 @@ class CORE_EXPORT QgsUserProfileManager : public QObject std::unique_ptr mUserProfile; - QString settingsFile(); + QString settingsFile() const; - QSettings *mSettings = nullptr; + std::unique_ptr< QSettings > mSettings; }; #endif // QGSUSERPROFILEMANAGER_H