Use std::make_shared
This commit is contained in:
@@ -3115,7 +3115,7 @@ void MainWindow::PlaylistDelete() {
|
|||||||
app_->player()->Next();
|
app_->player()->Next();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<MusicStorage> storage(new FilesystemMusicStorage("/"));
|
std::shared_ptr<MusicStorage> storage = std::make_shared<FilesystemMusicStorage>("/");
|
||||||
DeleteFiles *delete_files = new DeleteFiles(app_->task_manager(), storage, true);
|
DeleteFiles *delete_files = new DeleteFiles(app_->task_manager(), storage, true);
|
||||||
//QObject::connect(delete_files, &DeleteFiles::Finished, this, &MainWindow::DeleteFinished);
|
//QObject::connect(delete_files, &DeleteFiles::Finished, this, &MainWindow::DeleteFinished);
|
||||||
delete_files->Start(selected_songs);
|
delete_files->Start(selected_songs);
|
||||||
|
|||||||
@@ -809,7 +809,7 @@ std::shared_ptr<GstEnginePipeline> GstEngine::CreatePipeline() {
|
|||||||
|
|
||||||
EnsureInitialized();
|
EnsureInitialized();
|
||||||
|
|
||||||
std::shared_ptr<GstEnginePipeline> ret(new GstEnginePipeline(this));
|
std::shared_ptr<GstEnginePipeline> ret = std::make_shared<GstEnginePipeline>(this);
|
||||||
ret->set_output_device(output_, device_);
|
ret->set_output_device(output_, device_);
|
||||||
ret->set_volume_enabled(volume_control_);
|
ret->set_volume_enabled(volume_control_);
|
||||||
ret->set_stereo_balancer_enabled(stereo_balancer_enabled_);
|
ret->set_stereo_balancer_enabled(stereo_balancer_enabled_);
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ int main(int argc, char *argv[]) {
|
|||||||
QNetworkProxyFactory::setApplicationProxyFactory(NetworkProxyFactory::Instance());
|
QNetworkProxyFactory::setApplicationProxyFactory(NetworkProxyFactory::Instance());
|
||||||
|
|
||||||
// Create the tray icon and OSD
|
// Create the tray icon and OSD
|
||||||
std::shared_ptr<SystemTrayIcon> tray_icon(new SystemTrayIcon);
|
std::shared_ptr<SystemTrayIcon> tray_icon = std::make_shared<SystemTrayIcon>();
|
||||||
|
|
||||||
#if defined(Q_OS_MACOS)
|
#if defined(Q_OS_MACOS)
|
||||||
OSDMac osd(tray_icon, &app);
|
OSDMac osd(tray_icon, &app);
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ QList<PlaylistItemPtr> PlaylistBackend::GetPlaylistItems(int playlist) {
|
|||||||
if (db_->CheckErrors(q)) return QList<PlaylistItemPtr>();
|
if (db_->CheckErrors(q)) return QList<PlaylistItemPtr>();
|
||||||
|
|
||||||
// it's probable that we'll have a few songs associated with the same CUE so we're caching results of parsing CUEs
|
// it's probable that we'll have a few songs associated with the same CUE so we're caching results of parsing CUEs
|
||||||
std::shared_ptr<NewSongFromQueryState> state_ptr(new NewSongFromQueryState());
|
std::shared_ptr<NewSongFromQueryState> state_ptr = std::make_shared<NewSongFromQueryState>();
|
||||||
while (q.next()) {
|
while (q.next()) {
|
||||||
playlistitems << NewPlaylistItemFromQuery(SqlRow(q), state_ptr);
|
playlistitems << NewPlaylistItemFromQuery(SqlRow(q), state_ptr);
|
||||||
}
|
}
|
||||||
@@ -225,7 +225,7 @@ QList<Song> PlaylistBackend::GetPlaylistSongs(int playlist) {
|
|||||||
if (db_->CheckErrors(q)) return QList<Song>();
|
if (db_->CheckErrors(q)) return QList<Song>();
|
||||||
|
|
||||||
// it's probable that we'll have a few songs associated with the same CUE so we're caching results of parsing CUEs
|
// it's probable that we'll have a few songs associated with the same CUE so we're caching results of parsing CUEs
|
||||||
std::shared_ptr<NewSongFromQueryState> state_ptr(new NewSongFromQueryState());
|
std::shared_ptr<NewSongFromQueryState> state_ptr = std::make_shared<NewSongFromQueryState>();
|
||||||
while (q.next()) {
|
while (q.next()) {
|
||||||
songs << NewSongFromQuery(SqlRow(q), state_ptr);
|
songs << NewSongFromQuery(SqlRow(q), state_ptr);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ void SmartPlaylistQueryWizardPlugin::SetGenerator(PlaylistGeneratorPtr g) {
|
|||||||
|
|
||||||
PlaylistGeneratorPtr SmartPlaylistQueryWizardPlugin::CreateGenerator() const {
|
PlaylistGeneratorPtr SmartPlaylistQueryWizardPlugin::CreateGenerator() const {
|
||||||
|
|
||||||
std::shared_ptr<PlaylistQueryGenerator> gen(new PlaylistQueryGenerator);
|
std::shared_ptr<PlaylistQueryGenerator> gen = std::make_shared<PlaylistQueryGenerator>();
|
||||||
gen->Load(MakeSearch());
|
gen->Load(MakeSearch());
|
||||||
|
|
||||||
return std::static_pointer_cast<PlaylistGenerator>(gen);
|
return std::static_pointer_cast<PlaylistGenerator>(gen);
|
||||||
|
|||||||
@@ -411,7 +411,7 @@ void Transcoder::JobState::ReportError(GstMessage *msg) const {
|
|||||||
|
|
||||||
bool Transcoder::StartJob(const Job &job) {
|
bool Transcoder::StartJob(const Job &job) {
|
||||||
|
|
||||||
std::shared_ptr<JobState> state(new JobState(job, this));
|
std::shared_ptr<JobState> state = std::make_shared<JobState>(job, this);
|
||||||
|
|
||||||
emit LogLine(tr("Starting %1").arg(QDir::toNativeSeparators(job.input)));
|
emit LogLine(tr("Starting %1").arg(QDir::toNativeSeparators(job.input)));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user