Application: Use shared pointers

Fixes #1239
This commit is contained in:
Jonas Kvinge
2023-07-21 05:55:24 +02:00
parent d6b53f78ab
commit 2e61235403
316 changed files with 2170 additions and 1643 deletions

View File

@@ -19,9 +19,9 @@
#include "config.h"
#include <memory>
#include <functional>
#include <chrono>
#include <memory>
#include <QObject>
#include <QStandardPaths>
@@ -41,6 +41,7 @@
#include "scrobblercache.h"
#include "scrobblercacheitem.h"
using std::make_shared;
using namespace std::chrono_literals;
ScrobblerCache::ScrobblerCache(const QString &filename, QObject *parent)
@@ -182,7 +183,7 @@ void ScrobblerCache::ReadCache() {
metadata.musicbrainz_work_id = json_obj_track["musicbrainz_work_id"].toString();
}
ScrobblerCacheItemPtr cache_item = std::make_shared<ScrobblerCacheItem>(metadata, timestamp);
ScrobblerCacheItemPtr cache_item = make_shared<ScrobblerCacheItem>(metadata, timestamp);
scrobbler_cache_ << cache_item;
}
@@ -248,7 +249,7 @@ void ScrobblerCache::WriteCache() {
ScrobblerCacheItemPtr ScrobblerCache::Add(const Song &song, const quint64 timestamp) {
ScrobblerCacheItemPtr cache_item = std::make_shared<ScrobblerCacheItem>(ScrobbleMetadata(song), timestamp);
ScrobblerCacheItemPtr cache_item = make_shared<ScrobblerCacheItem>(ScrobbleMetadata(song), timestamp);
scrobbler_cache_ << cache_item;