Use shared_ptr for scrobbler cache items

This commit is contained in:
Jonas Kvinge
2020-05-10 14:59:04 +02:00
parent 1b8dedb4ed
commit 139e148912
7 changed files with 53 additions and 34 deletions

View File

@@ -22,6 +22,8 @@
#include "config.h"
#include <memory>
#include <QtGlobal>
#include <QObject>
#include <QString>
@@ -33,7 +35,6 @@ class ScrobblerCacheItem : public QObject {
public:
explicit ScrobblerCacheItem(const QString &artist, const QString &album, const QString &song, const QString &albumartist, const int track, const qint64 duration, const quint64 &timestamp);
~ScrobblerCacheItem();
QString effective_albumartist() const { return albumartist_.isEmpty() || albumartist_.toLower() == Song::kVariousArtists ? artist_ : albumartist_; }
@@ -49,4 +50,10 @@ class ScrobblerCacheItem : public QObject {
};
typedef std::shared_ptr<ScrobblerCacheItem> ScrobblerCacheItemPtr;
typedef QList<ScrobblerCacheItemPtr> ScrobblerCacheItemList;
Q_DECLARE_METATYPE(ScrobblerCacheItemPtr)
Q_DECLARE_METATYPE(ScrobblerCacheItemList)
#endif // SCROBBLERCACHEITEM_H