Use std::make_unique
This commit is contained in:
@@ -222,7 +222,7 @@ void DeviceView::SetApplication(Application *app) {
|
||||
|
||||
properties_dialog_->SetDeviceManager(app_->device_manager());
|
||||
|
||||
organize_dialog_.reset(new OrganizeDialog(app_->task_manager(), nullptr, this));
|
||||
organize_dialog_ = std::make_unique<OrganizeDialog>(app_->task_manager(), nullptr, this);
|
||||
organize_dialog_->SetDestinationModel(app_->collection_model()->directory_model());
|
||||
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
#include <QObject>
|
||||
#include <QUrl>
|
||||
#include <memory>
|
||||
|
||||
#include "core/taskmanager.h"
|
||||
#include "core/song.h"
|
||||
@@ -61,7 +62,7 @@ void MtpLoader::LoadDatabase() {
|
||||
|
||||
bool MtpLoader::TryLoad() {
|
||||
|
||||
connection_.reset(new MtpConnection(url_));
|
||||
connection_ = std::make_unique<MtpConnection>(url_);
|
||||
|
||||
if (!connection_ || !connection_->is_valid()) {
|
||||
emit Error(tr("Error connecting MTP device %1").arg(url_.toString()));
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <dbus/objectmanager.h>
|
||||
#include <dbus/udisks2block.h>
|
||||
#include <dbus/udisks2drive.h>
|
||||
@@ -179,7 +181,7 @@ void Udisks2Lister::UpdateDeviceFreeSpace(const QString &id) {
|
||||
|
||||
bool Udisks2Lister::Init() {
|
||||
|
||||
udisks2_interface_.reset(new OrgFreedesktopDBusObjectManagerInterface(udisks2_service_, "/org/freedesktop/UDisks2", QDBusConnection::systemBus()));
|
||||
udisks2_interface_ = std::make_unique<OrgFreedesktopDBusObjectManagerInterface>(udisks2_service_, "/org/freedesktop/UDisks2", QDBusConnection::systemBus());
|
||||
|
||||
QDBusPendingReply<ManagedObjectList> reply = udisks2_interface_->GetManagedObjects();
|
||||
reply.waitForFinished();
|
||||
|
||||
Reference in New Issue
Block a user