Commit a1ca107d authored by Matthieu Gallien's avatar Matthieu Gallien 🎵

fix issues related to radio and view details in playlist

Summary: partial removal of isRadio and duplicated code in TrackMetadataModel

Test Plan:
could not spot regressions

all automatic tests are OK except elisaqmltests that does not run due to an issue with a missing so dependency on KIO

Reviewers: #elisa, ngraham, jguidon, astippich

Reviewed By: #elisa, ngraham, astippich

Differential Revision: https://phabricator.kde.org/D23280
parent 978de1a7
......@@ -67,7 +67,7 @@ private Q_SLOTS:
QCOMPARE(dataChangedSpy.count(), 0);
QCOMPARE(beginRemovedRowsSpy.count(), 0);
QCOMPARE(endRemovedRowsSpy.count(), 0);
QCOMPARE(myModel.rowCount(), 1);
QCOMPARE(myModel.rowCount(), 2);
}
void modifyTrackInDatabase()
......@@ -107,7 +107,7 @@ private Q_SLOTS:
auto trackId = musicDb.trackIdFromFileName(QUrl::fromLocalFile(QStringLiteral("/$1")));
myModel.initializeByTrackId(trackId);
myModel.initializeById(ElisaUtils::Track, trackId);
QCOMPARE(beginResetSpy.count(), 1);
QCOMPARE(endResetSpy.count(), 1);
......@@ -116,7 +116,7 @@ private Q_SLOTS:
QCOMPARE(dataChangedSpy.count(), 0);
QCOMPARE(beginRemovedRowsSpy.count(), 0);
QCOMPARE(endRemovedRowsSpy.count(), 0);
QCOMPARE(myModel.rowCount(), 11);
QCOMPARE(myModel.rowCount(), 12);
musicDb.trackHasStartedPlaying(QUrl::fromLocalFile(QStringLiteral("/$2")), QDateTime::currentDateTime());
......@@ -127,7 +127,7 @@ private Q_SLOTS:
QCOMPARE(dataChangedSpy.count(), 0);
QCOMPARE(beginRemovedRowsSpy.count(), 0);
QCOMPARE(endRemovedRowsSpy.count(), 0);
QCOMPARE(myModel.rowCount(), 11);
QCOMPARE(myModel.rowCount(), 12);
musicDb.trackHasStartedPlaying(QUrl::fromLocalFile(QStringLiteral("/$1")), QDateTime::currentDateTime());
......@@ -138,7 +138,7 @@ private Q_SLOTS:
QCOMPARE(dataChangedSpy.count(), 0);
QCOMPARE(beginRemovedRowsSpy.count(), 0);
QCOMPARE(endRemovedRowsSpy.count(), 0);
QCOMPARE(myModel.rowCount(), 12);
QCOMPARE(myModel.rowCount(), 13);
}
};
......
......@@ -6385,7 +6385,7 @@ DatabaseInterface::TrackDataType DatabaseInterface::buildTrackDataFromDatabaseRe
}
result[TrackDataType::key_type::PlayCounter] = trackRecord.value(28);
result[TrackDataType::key_type::PlayFrequency] = trackRecord.value(29);
result[DataType::key_type::ElementTypeRole] = ElisaUtils::Track;
result[TrackDataType::key_type::ElementTypeRole] = ElisaUtils::Track;
return result;
}
......@@ -6406,7 +6406,7 @@ DatabaseInterface::TrackDataType DatabaseInterface::buildRadioDataFromDatabaseRe
result[TrackDataType::key_type::GenreRole] = trackRecord.value(4);
}
result[TrackDataType::key_type::CommentRole] = trackRecord.value(5);
result[DataType::key_type::ElementTypeRole] = ElisaUtils::Radio;
result[TrackDataType::key_type::ElementTypeRole] = ElisaUtils::Radio;
return result;
}
......@@ -6820,18 +6820,14 @@ void DatabaseInterface::insertRadio(const TrackDataType &oneTrack)
qCDebug(orgKdeElisaDatabase) << "DatabaseInterface::updateTrackInDatabase" << query.lastQuery();
qCDebug(orgKdeElisaDatabase) << "DatabaseInterface::updateTrackInDatabase" << query.boundValues();
qCDebug(orgKdeElisaDatabase) << "DatabaseInterface::updateTrackInDatabase" << query.lastError();
}else{
TrackDataType radio(oneTrack);
radio[TrackDataType::key_type::ArtistRole] = radio[TrackDataType::key_type::TitleRole];
if (radio[TrackDataType::key_type::DatabaseIdRole] == -1) {
radio[TrackDataType::key_type::DatabaseIdRole] = internalRadioIdFromHttpAddress(oneTrack.resourceURI().toString());
radio[TrackDataType::key_type::AlbumRole] = QStringLiteral("Radios");
radio[TrackDataType::key_type::ArtistRole] = radio[TrackDataType::key_type::TitleRole];
radio[DataType::key_type::ElementTypeRole] = ElisaUtils::Radio;
// Genre and rating missing for now, see buildRadioDataFromDatabaseRecord. Should be added if used for radios.
} else {
if (oneTrack[TrackDataType::key_type::DatabaseIdRole] == -1) {
auto radio = internalOneRadioPartialData(internalRadioIdFromHttpAddress(oneTrack.resourceURI().toString()));
Q_EMIT radioAdded(radio);
} else {
auto radio = internalOneRadioPartialData(oneTrack.databaseId());
Q_EMIT radioModified(radio);
}
}
......
......@@ -54,8 +54,8 @@ enum PlayListEntryType {
Composer,
Track,
FileName,
Unknown,
Radio,
Unknown,
};
Q_ENUM_NS(PlayListEntryType)
......
......@@ -114,6 +114,7 @@ QHash<int, QByteArray> MediaPlayList::roleNames() const
roles[static_cast<int>(ColumnsRoles::TrackDataRole)] = "trackData";
roles[static_cast<int>(ColumnsRoles::AlbumIdRole)] = "albumId";
roles[static_cast<int>(ColumnsRoles::AlbumSectionRole)] = "albumSection";
roles[static_cast<int>(ColumnsRoles::ElementTypeRole)] = "entryType";
return roles;
}
......
......@@ -58,33 +58,33 @@ void ModelDataLoader::setDatabase(DatabaseInterface *database)
d->mDatabase = database;
connect(database, &DatabaseInterface::genresAdded,
this, &ModelDataLoader::databaseGenresAdded);
this, &ModelDataLoader::genresAdded);
connect(database, &DatabaseInterface::albumsAdded,
this, &ModelDataLoader::databaseAlbumsAdded);
connect(database, &DatabaseInterface::albumModified,
this, &ModelDataLoader::databaseAlbumModified);
this, &ModelDataLoader::albumModified);
connect(database, &DatabaseInterface::albumRemoved,
this, &ModelDataLoader::databaseAlbumRemoved);
this, &ModelDataLoader::albumRemoved);
connect(database, &DatabaseInterface::tracksAdded,
this, &ModelDataLoader::databaseTracksAdded);
connect(database, &DatabaseInterface::trackModified,
this, &ModelDataLoader::databaseTrackModified);
this, &ModelDataLoader::trackModified);
connect(database, &DatabaseInterface::trackRemoved,
this, &ModelDataLoader::databaseTrackRemoved);
this, &ModelDataLoader::trackRemoved);
connect(database, &DatabaseInterface::artistsAdded,
this, &ModelDataLoader::databaseArtistsAdded);
connect(database, &DatabaseInterface::artistRemoved,
this, &ModelDataLoader::databaseArtistRemoved);
this, &ModelDataLoader::artistRemoved);
connect(this, &ModelDataLoader::saveRadioModified,
database, &DatabaseInterface::insertRadio);
connect(this, &ModelDataLoader::removeRadio,
database, &DatabaseInterface::removeRadio);
connect(database, &DatabaseInterface::radioAdded,
this, &ModelDataLoader::databaseRadioAdded);
this, &ModelDataLoader::radioAdded);
connect(database, &DatabaseInterface::radioModified,
this, &ModelDataLoader::databaseRadioModified);
this, &ModelDataLoader::radioModified);
connect(database, &DatabaseInterface::radioRemoved,
this, &ModelDataLoader::databaseRadioRemoved);
this, &ModelDataLoader::radioRemoved);
}
void ModelDataLoader::loadData(ElisaUtils::PlayListEntryType dataType)
......@@ -365,21 +365,6 @@ void ModelDataLoader::databaseTracksAdded(const ListTrackDataType &newData)
}
}
void ModelDataLoader::databaseTrackModified(const TrackDataType &modifiedTrack)
{
Q_EMIT trackModified(modifiedTrack);
}
void ModelDataLoader::databaseTrackRemoved(qulonglong removedTrackId)
{
Q_EMIT trackRemoved(removedTrackId);
}
void ModelDataLoader::databaseGenresAdded(const ListGenreDataType &newData)
{
Q_EMIT genresAdded(newData);
}
void ModelDataLoader::databaseArtistsAdded(const ListArtistDataType &newData)
{
switch(d->mFilterType) {
......@@ -407,11 +392,6 @@ void ModelDataLoader::databaseArtistsAdded(const ListArtistDataType &newData)
}
}
void ModelDataLoader::databaseArtistRemoved(qulonglong removedDatabaseId)
{
Q_EMIT artistRemoved(removedDatabaseId);
}
void ModelDataLoader::databaseAlbumsAdded(const ListAlbumDataType &newData)
{
switch(d->mFilterType) {
......@@ -452,39 +432,4 @@ void ModelDataLoader::databaseAlbumsAdded(const ListAlbumDataType &newData)
}
}
void ModelDataLoader::databaseAlbumRemoved(qulonglong removedDatabaseId)
{
Q_EMIT albumRemoved(removedDatabaseId);
}
void ModelDataLoader::databaseAlbumModified(const AlbumDataType &modifiedAlbum)
{
Q_EMIT albumModified(modifiedAlbum);
}
void ModelDataLoader::updateRadioData(const TrackDataType &trackDataType)
{
Q_EMIT saveRadioModified(trackDataType);
}
void ModelDataLoader::deleteRadioData(qulonglong radioId)
{
Q_EMIT removeRadio(radioId);
}
void ModelDataLoader::databaseRadioAdded(TrackDataType radio)
{
Q_EMIT radioAdded(radio);
}
void ModelDataLoader::databaseRadioModified(TrackDataType radio)
{
Q_EMIT radioModified(radio);
}
void ModelDataLoader::databaseRadioRemoved(qulonglong radioId)
{
Q_EMIT radioRemoved(radioId);
}
#include "moc_modeldataloader.cpp"
......@@ -122,36 +122,14 @@ public Q_SLOTS:
void loadFrequentlyPlayedData(ElisaUtils::PlayListEntryType dataType);
void updateRadioData(const ModelDataLoader::TrackDataType &trackDataType);
void deleteRadioData(qulonglong radioId);
private:
private Q_SLOTS:
void databaseTracksAdded(const ListTrackDataType &newData);
void databaseTrackModified(const TrackDataType &modifiedTrack);
void databaseTrackRemoved(qulonglong removedTrackId);
void databaseGenresAdded(const ListGenreDataType &newData);
void databaseArtistsAdded(const ListArtistDataType &newData);
void databaseArtistRemoved(qulonglong removedDatabaseId);
void databaseAlbumsAdded(const ListAlbumDataType &newData);
void databaseAlbumRemoved(qulonglong removedDatabaseId);
void databaseAlbumModified(const AlbumDataType &modifiedAlbum);
void databaseRadioAdded(const TrackDataType radio);
void databaseRadioModified(const TrackDataType radio);
void databaseRadioRemoved(qulonglong radioId);
private:
std::unique_ptr<ModelDataLoaderPrivate> d;
......
......@@ -23,7 +23,6 @@
#include <QtConcurrent>
TrackMetadataModel::TrackMetadataModel(QObject *parent)
: QAbstractListModel(parent)
{
......@@ -47,7 +46,7 @@ int TrackMetadataModel::rowCount(const QModelIndex &parent) const
return mTrackData.count();
}
QVariant TrackMetadataModel::dataGeneral(const QModelIndex &index, int role) const
QVariant TrackMetadataModel::data(const QModelIndex &index, int role) const
{
auto result = QVariant{};
......@@ -272,135 +271,6 @@ QVariant TrackMetadataModel::dataGeneral(const QModelIndex &index, int role) con
return result;
}
QVariant TrackMetadataModel::dataRadio(const QModelIndex &index, int role) const
{
auto result = QVariant{};
const auto currentKey = mTrackKeys[index.row()];
switch (role)
{
case Qt::DisplayRole:
result = mTrackData[currentKey];
break;
case ItemNameRole:
switch (currentKey)
{
case DatabaseInterface::TitleRole:
result = i18nc("Track title for track metadata view", "Title");
break;
case DatabaseInterface::CommentRole:
result = i18nc("Comment label for track metadata view", "Comment");
break;
case DatabaseInterface::ResourceRole:
result = i18nc("Radio HTTP address for radio metadata view", "Stream Http Address");
break;
case DatabaseInterface::ChannelsRole:
case DatabaseInterface::BitRateRole:
case DatabaseInterface::SampleRateRole:
case DatabaseInterface::LastPlayDate:
case DatabaseInterface::PlayCounter:
case DatabaseInterface::LyricsRole:
case DatabaseInterface::YearRole:
case DatabaseInterface::ComposerRole:
case DatabaseInterface::ArtistRole:
case DatabaseInterface::AlbumRole:
case DatabaseInterface::AlbumArtistRole:
case DatabaseInterface::TrackNumberRole:
case DatabaseInterface::DiscNumberRole:
case DatabaseInterface::RatingRole:
case DatabaseInterface::GenreRole:
case DatabaseInterface::LyricistRole:
case DatabaseInterface::DurationRole:
case DatabaseInterface::SecondaryTextRole:
case DatabaseInterface::ImageUrlRole:
case DatabaseInterface::ShadowForImageRole:
case DatabaseInterface::ChildModelRole:
case DatabaseInterface::StringDurationRole:
case DatabaseInterface::MilliSecondsDurationRole:
case DatabaseInterface::AllArtistsRole:
case DatabaseInterface::HighestTrackRating:
case DatabaseInterface::IdRole:
case DatabaseInterface::DatabaseIdRole:
case DatabaseInterface::IsSingleDiscAlbumRole:
case DatabaseInterface::ContainerDataRole:
case DatabaseInterface::IsPartialDataRole:
case DatabaseInterface::AlbumIdRole:
case DatabaseInterface::HasEmbeddedCover:
case DatabaseInterface::FileModificationTime:
case DatabaseInterface::FirstPlayDate:
case DatabaseInterface::PlayFrequency:
case DatabaseInterface::ElementTypeRole:
case DatabaseInterface::IsValidAlbumArtistRole:
break;
}
break;
case ItemTypeRole:
switch (currentKey)
{
case DatabaseInterface::TitleRole:
result = TextEntry;
break;
case DatabaseInterface::ResourceRole:
result = TextEntry;
break;
case DatabaseInterface::CommentRole:
result = TextEntry;
break;
case DatabaseInterface::ArtistRole:
case DatabaseInterface::AlbumRole:
case DatabaseInterface::AlbumArtistRole:
case DatabaseInterface::TrackNumberRole:
case DatabaseInterface::DiscNumberRole:
case DatabaseInterface::RatingRole:
case DatabaseInterface::GenreRole:
case DatabaseInterface::LyricistRole:
case DatabaseInterface::ComposerRole:
case DatabaseInterface::YearRole:
case DatabaseInterface::LastPlayDate:
case DatabaseInterface::PlayCounter:
case DatabaseInterface::LyricsRole:
case DatabaseInterface::DurationRole:
case DatabaseInterface::SampleRateRole:
case DatabaseInterface::BitRateRole:
case DatabaseInterface::ChannelsRole:
case DatabaseInterface::SecondaryTextRole:
case DatabaseInterface::ImageUrlRole:
case DatabaseInterface::ShadowForImageRole:
case DatabaseInterface::ChildModelRole:
case DatabaseInterface::StringDurationRole:
case DatabaseInterface::MilliSecondsDurationRole:
case DatabaseInterface::AllArtistsRole:
case DatabaseInterface::HighestTrackRating:
case DatabaseInterface::IdRole:
case DatabaseInterface::DatabaseIdRole:
case DatabaseInterface::IsSingleDiscAlbumRole:
case DatabaseInterface::ContainerDataRole:
case DatabaseInterface::IsPartialDataRole:
case DatabaseInterface::AlbumIdRole:
case DatabaseInterface::HasEmbeddedCover:
case DatabaseInterface::FileModificationTime:
case DatabaseInterface::FirstPlayDate:
case DatabaseInterface::PlayFrequency:
case DatabaseInterface::ElementTypeRole:
case DatabaseInterface::IsValidAlbumArtistRole:
break;
}
break;
}
return result;
}
QVariant TrackMetadataModel::data(const QModelIndex &index, int role) const
{
if (this->mIsRadio) {
return dataRadio(index, role);
} else {
return dataGeneral(index, role);
}
}
bool TrackMetadataModel::setData(const QModelIndex &index, const QVariant &value, int role)
{
if (data(index, role) != value) {
......@@ -446,32 +316,38 @@ QString TrackMetadataModel::lyrics() const
return mFullData[TrackDataType::key_type::LyricsRole].toString();
}
qulonglong TrackMetadataModel::databaseId() const
{
return mDatabaseId;
}
void TrackMetadataModel::trackData(const TrackMetadataModel::TrackDataType &trackData)
{
if (!mFullData.isEmpty() && trackData.databaseId() != mFullData.databaseId()) {
return;
}
fillDataFromTrackData(trackData);
const QList<DatabaseInterface::ColumnsRoles> fieldsForTrack({DatabaseInterface::TitleRole, DatabaseInterface::ArtistRole,
DatabaseInterface::AlbumRole, DatabaseInterface::AlbumArtistRole,
DatabaseInterface::TrackNumberRole, DatabaseInterface::DiscNumberRole,
DatabaseInterface::RatingRole, DatabaseInterface::GenreRole,
DatabaseInterface::LyricistRole, DatabaseInterface::ComposerRole,
DatabaseInterface::CommentRole, DatabaseInterface::YearRole,
DatabaseInterface::LastPlayDate, DatabaseInterface::PlayCounter,
DatabaseInterface::DatabaseIdRole});
fillDataFromTrackData(trackData, fieldsForTrack);
}
void TrackMetadataModel::fillDataFromTrackData(const TrackMetadataModel::TrackDataType &trackData)
void TrackMetadataModel::fillDataFromTrackData(const TrackMetadataModel::TrackDataType &trackData,
const QList<DatabaseInterface::ColumnsRoles> &fieldsForTrack)
{
const QList<DatabaseInterface::ColumnsRoles> mFieldsForClassicTrack({DatabaseInterface::TitleRole, DatabaseInterface::ArtistRole, DatabaseInterface::AlbumRole,
DatabaseInterface::AlbumArtistRole, DatabaseInterface::TrackNumberRole, DatabaseInterface::DiscNumberRole,
DatabaseInterface::RatingRole, DatabaseInterface::GenreRole, DatabaseInterface::LyricistRole,
DatabaseInterface::ComposerRole, DatabaseInterface::CommentRole, DatabaseInterface::YearRole,
DatabaseInterface::LastPlayDate, DatabaseInterface::PlayCounter});
const QList mFieldsForRadioTrack({DatabaseInterface::TitleRole,DatabaseInterface::ResourceRole, DatabaseInterface::CommentRole, DatabaseInterface::DatabaseIdRole,
DatabaseInterface::ArtistRole, DatabaseInterface::AlbumRole});
beginResetModel();
mFullData = trackData;
mTrackData.clear();
mTrackKeys.clear();
for (DatabaseInterface::ColumnsRoles role : (isRadio() ? mFieldsForRadioTrack : mFieldsForClassicTrack)){
for (DatabaseInterface::ColumnsRoles role : fieldsForTrack) {
if (trackData.constFind(role) != trackData.constEnd()) {
if (role == DatabaseInterface::RatingRole) {
if (trackData[role].toInt() == 0) {
......@@ -488,6 +364,9 @@ void TrackMetadataModel::fillDataFromTrackData(const TrackMetadataModel::TrackDa
fetchLyrics();
mDatabaseId = trackData[DatabaseInterface::DatabaseIdRole].toULongLong();
Q_EMIT databaseIdChanged();
mCoverImage = trackData[DatabaseInterface::ImageUrlRole].toUrl();
Q_EMIT coverUrlChanged();
......@@ -540,6 +419,18 @@ void TrackMetadataModel::lyricsValueIsReady()
}
}
void TrackMetadataModel::initializeById(ElisaUtils::PlayListEntryType type, qulonglong databaseId)
{
mFullData.clear();
mTrackData.clear();
mCoverImage.clear();
mFileUrl.clear();
Q_EMIT lyricsChanged();
Q_EMIT needDataByDatabaseId(type, databaseId);
}
void TrackMetadataModel::initialize(MusicListenersManager *newManager, DatabaseInterface *trackDatabase)
{
mManager = newManager;
......@@ -559,26 +450,20 @@ void TrackMetadataModel::initialize(MusicListenersManager *newManager, DatabaseI
&mDataLoader, &ModelDataLoader::loadDataByDatabaseId);
connect(this, &TrackMetadataModel::needDataByFileName,
&mDataLoader, &ModelDataLoader::loadDataByFileName);
if (isRadio()) {
connect(this, &TrackMetadataModel::saveRadioData,
&mDataLoader, &ModelDataLoader::updateRadioData);
connect(this, &TrackMetadataModel::deleteRadioData,
&mDataLoader, &ModelDataLoader::deleteRadioData);
connect(&mDataLoader, &ModelDataLoader::radioAdded,
this, &TrackMetadataModel::radioAdded);
connect(&mDataLoader, &ModelDataLoader::radioModified,
this, &TrackMetadataModel::radioModified);
connect(&mDataLoader, &ModelDataLoader::radioRemoved,
this, &TrackMetadataModel::radioRemoved);
connect(&mDataLoader, &ModelDataLoader::allRadioData,
this, &TrackMetadataModel::trackData);
} else {
connect(&mDataLoader, &ModelDataLoader::trackModified,
this, &TrackMetadataModel::trackData);
connect(&mDataLoader, &ModelDataLoader::allTrackData,
this, &TrackMetadataModel::trackData);
}
connect(this, &TrackMetadataModel::saveRadioData,
&mDataLoader, &ModelDataLoader::saveRadioModified);
connect(this, &TrackMetadataModel::deleteRadioData,
&mDataLoader, &ModelDataLoader::removeRadio);
connect(&mDataLoader, &ModelDataLoader::trackModified,
this, &TrackMetadataModel::trackData);
connect(&mDataLoader, &ModelDataLoader::allTrackData,
this, &TrackMetadataModel::trackData);
connect(&mDataLoader, &ModelDataLoader::allRadioData,
this, &TrackMetadataModel::radioData);
connect(&mDataLoader, &ModelDataLoader::radioAdded,
this, &TrackMetadataModel::radioData);
connect(&mDataLoader, &ModelDataLoader::radioModified,
this, &TrackMetadataModel::radioData);
}
void TrackMetadataModel::fetchLyrics()
......@@ -594,18 +479,6 @@ void TrackMetadataModel::fetchLyrics()
mLyricsValueWatcher.setFuture(lyricicsValue);
}
void TrackMetadataModel::initializeByTrackId(qulonglong databaseId)
{
mFullData.clear();
mTrackData.clear();
mCoverImage.clear();
mFileUrl.clear();
Q_EMIT lyricsChanged();
Q_EMIT needDataByDatabaseId((isRadio() ? ElisaUtils::Radio : ElisaUtils::Track), databaseId);
}
void TrackMetadataModel::initializeForNewRadio()
{
mFullData.clear();
......@@ -626,11 +499,10 @@ void TrackMetadataModel::fillDataForNewRadio()
DatabaseInterface::CommentRole,
DatabaseInterface::DatabaseIdRole
}) {
}) {
mTrackKeys.push_back(role);
if (role == DatabaseInterface::DatabaseIdRole) {
mTrackData[role] = -1;
Q_EMIT hideDeleteButton();
} else {
mTrackData[role] = QString();
}
......@@ -657,21 +529,11 @@ void TrackMetadataModel::setManager(MusicListenersManager *newManager)
initialize(newManager, nullptr);
}
void TrackMetadataModel::setIsRadio(bool isRadio){
this->mIsRadio = isRadio;
Q_EMIT isRadioChanged();
}
void TrackMetadataModel::setDatabase(DatabaseInterface *trackDatabase)
{
initialize(nullptr, trackDatabase);
}
bool TrackMetadataModel::isRadio(){
return this->mIsRadio;
}
void TrackMetadataModel::saveData()
{
Q_EMIT saveRadioData(mTrackData);
......@@ -684,18 +546,17 @@ void TrackMetadataModel::deleteRadio()
}
}
void TrackMetadataModel::radioAdded(const TrackDataType &radiosData){
mTrackData[DatabaseInterface::DatabaseIdRole] = radiosData[DatabaseInterface::DatabaseIdRole];
Q_EMIT showDeleteButton();
radioModified();
}
void TrackMetadataModel::radioData(const TrackDataType &radiosData)
{
if (!mFullData.isEmpty() && mFullData[DatabaseInterface::DatabaseIdRole].toInt() != -1 &&
mFullData.databaseId() != radiosData.databaseId()) {
return;
}
void TrackMetadataModel::radioModified(){
Q_EMIT disableApplyButton();
}
const QList<DatabaseInterface::ColumnsRoles> fieldsForTrack({DatabaseInterface::TitleRole, DatabaseInterface::ResourceRole,
DatabaseInterface::CommentRole, DatabaseInterface::DatabaseIdRole});