Commit 8e25d6c4 authored by Matthieu Gallien's avatar Matthieu Gallien 🎵
Browse files

introduce MusicDataType to share code between data classes

parent cc176b06
......@@ -10,6 +10,8 @@
#include "elisaLib_export.h"
#include "elisautils.h"
#include <QObject>
#include <QString>
#include <QList>
......@@ -76,6 +78,22 @@ private:
public:
class MusicDataType : public DataType
{
public:
using DataType::DataType;
qulonglong databaseId() const
{
return operator[](key_type::DatabaseIdRole).toULongLong();
}
ElisaUtils::PlayListEntryType elementType() const
{
return operator[](key_type::ElementTypeRole).value<ElisaUtils::PlayListEntryType>();
}
};
class TrackDataType : public DataType
{
public:
......
......@@ -12,6 +12,7 @@
#include "config-upnp-qt.h"
#include "elisautils.h"
#include "datatypes.h"
#include <QObject>
#include <QString>
......
......@@ -9,8 +9,6 @@
#include "elisaLib_export.h"
#include "datatypes.h"
#include <QList>
#include <QUrl>
#include <QString>
......
......@@ -10,6 +10,7 @@
#include "elisaLib_export.h"
#include "elisautils.h"
#include "datatypes.h"
#include <QAbstractProxyModel>
#include <QMediaPlayer>
......
......@@ -11,6 +11,7 @@
#include "elisaLib_export.h"
#include "elisautils.h"
#include "datatypes.h"
#include <QSortFilterProxyModel>
#include <QRegularExpression>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment