mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 06:57:24 -06:00
Merge pull request #10302 from Chocobo1/uptr
Replace QScopedPointer with std::unqiue_ptr
This commit is contained in:
@@ -29,8 +29,6 @@
|
||||
|
||||
#include "profile.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
#include "private/profile_p.h"
|
||||
|
||||
Profile *Profile::m_instance = nullptr;
|
||||
@@ -50,14 +48,14 @@ Profile::~Profile() = default;
|
||||
void Profile::initialize(const QString &rootProfilePath, const QString &configurationName,
|
||||
bool convertPathsToProfileRelative)
|
||||
{
|
||||
QScopedPointer<Private::Profile> profile(rootProfilePath.isEmpty()
|
||||
std::unique_ptr<Private::Profile> profile(rootProfilePath.isEmpty()
|
||||
? static_cast<Private::Profile *>(new Private::DefaultProfile(configurationName))
|
||||
: static_cast<Private::Profile *>(new Private::CustomProfile(rootProfilePath, configurationName)));
|
||||
|
||||
QScopedPointer<Private::PathConverter> converter(convertPathsToProfileRelative
|
||||
std::unique_ptr<Private::PathConverter> converter(convertPathsToProfileRelative
|
||||
? static_cast<Private::PathConverter *>(new Private::Converter(profile->baseDirectory()))
|
||||
: static_cast<Private::PathConverter *>(new Private::NoConvertConverter()));
|
||||
m_instance = new Profile(profile.take(), converter.take());
|
||||
m_instance = new Profile(profile.release(), converter.release());
|
||||
}
|
||||
|
||||
const Profile &Profile::instance()
|
||||
|
||||
Reference in New Issue
Block a user