Commit 9241dd22 authored by luyikei's avatar luyikei Committed by Hugo Beauzée-Luyssen
Browse files

MediaLibraryModel: Expose media id

parent e2513da8
......@@ -114,6 +114,8 @@ QVariant MediaLibraryModel::data( const QModelIndex &index, int role ) const
return QVariant( QString::fromStdString( m->thumbnail() ) );
case Roles::Duration:
return QVariant::fromValue( m->duration() );
case Roles::Id:
return QVariant::fromValue( m->id() );
case Qt::UserRole:
return QVariant::fromValue( m );
default:
......@@ -129,7 +131,8 @@ MediaLibraryModel::roleNames() const
return {
{ Roles::Title, "title" },
{ Roles::ThumbnailPath, "thumbnailPath" },
{ Roles::Duration, "duration" }
{ Roles::Duration, "duration" },
{ Roles::Id, "id" }
};
}
......
......@@ -41,6 +41,7 @@ public:
Title = Qt::UserRole + 1,
ThumbnailPath,
Duration,
Id,
};
explicit MediaLibraryModel( medialibrary::IMediaLibrary& ml, medialibrary::IMedia::Type type,
......
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