Changeset View
Changeset View
Standalone View
Standalone View
src/modeldataloader.h
Show All 35 Lines | 34 | { | |||
---|---|---|---|---|---|
36 | Q_OBJECT | 36 | Q_OBJECT | ||
37 | 37 | | |||
38 | public: | 38 | public: | ||
39 | 39 | | |||
40 | using ListAlbumDataType = DatabaseInterface::ListAlbumDataType; | 40 | using ListAlbumDataType = DatabaseInterface::ListAlbumDataType; | ||
41 | using ListArtistDataType = DatabaseInterface::ListArtistDataType; | 41 | using ListArtistDataType = DatabaseInterface::ListArtistDataType; | ||
42 | using ListGenreDataType = DatabaseInterface::ListGenreDataType; | 42 | using ListGenreDataType = DatabaseInterface::ListGenreDataType; | ||
43 | using ListTrackDataType = DatabaseInterface::ListTrackDataType; | 43 | using ListTrackDataType = DatabaseInterface::ListTrackDataType; | ||
44 | using ListRadioDataType = DatabaseInterface::ListRadioDataType; | ||||
44 | using TrackDataType = DatabaseInterface::TrackDataType; | 45 | using TrackDataType = DatabaseInterface::TrackDataType; | ||
45 | using AlbumDataType = DatabaseInterface::AlbumDataType; | 46 | using AlbumDataType = DatabaseInterface::AlbumDataType; | ||
46 | 47 | | |||
47 | using FilterType = ElisaUtils::FilterType; | 48 | using FilterType = ElisaUtils::FilterType; | ||
48 | 49 | | |||
49 | explicit ModelDataLoader(QObject *parent = nullptr); | 50 | explicit ModelDataLoader(QObject *parent = nullptr); | ||
50 | 51 | | |||
51 | ~ModelDataLoader() override; | 52 | ~ModelDataLoader() override; | ||
52 | 53 | | |||
53 | void setDatabase(DatabaseInterface *database); | 54 | void setDatabase(DatabaseInterface *database); | ||
54 | 55 | | |||
55 | Q_SIGNALS: | 56 | Q_SIGNALS: | ||
56 | 57 | | |||
57 | void allAlbumsData(const ModelDataLoader::ListAlbumDataType &allData); | 58 | void allAlbumsData(const ModelDataLoader::ListAlbumDataType &allData); | ||
58 | 59 | | |||
59 | void allArtistsData(const ModelDataLoader::ListArtistDataType &allData); | 60 | void allArtistsData(const ModelDataLoader::ListArtistDataType &allData); | ||
60 | 61 | | |||
61 | void allGenresData(const ModelDataLoader::ListGenreDataType &allData); | 62 | void allGenresData(const ModelDataLoader::ListGenreDataType &allData); | ||
62 | 63 | | |||
63 | void allTracksData(const ModelDataLoader::ListTrackDataType &allData); | 64 | void allTracksData(const ModelDataLoader::ListTrackDataType &allData); | ||
64 | 65 | | |||
66 | void allRadiosData(const ModelDataLoader::ListRadioDataType &radiosData); | ||||
67 | | ||||
68 | void radioAdded(const ModelDataLoader::TrackDataType radiosData); | ||||
astippich: are all these updateUI signals (also below) really necessary? they are not needed for the rest… | |||||
Indeed I have removed radioModified signal which was not needed in this class. For the three others, I kept a defined role for each of them:
Should it be better if I try to integrate them or at least give them some better names? jguidon: Indeed I have removed radioModified signal which was not needed in this class.
For the three… | |||||
If you rename it now to radioModified I think it is pretty consistent with the rest astippich: If you rename it now to radioModified I think it is pretty consistent with the rest | |||||
69 | | ||||
70 | void radioModified(const ModelDataLoader::TrackDataType radiosData); | ||||
71 | | ||||
65 | void allTrackData(const ModelDataLoader::TrackDataType &allData); | 72 | void allTrackData(const ModelDataLoader::TrackDataType &allData); | ||
66 | 73 | | |||
74 | void allRadioData(const ModelDataLoader::TrackDataType &allData); | ||||
75 | | ||||
67 | void tracksAdded(ModelDataLoader::ListTrackDataType newData); | 76 | void tracksAdded(ModelDataLoader::ListTrackDataType newData); | ||
68 | 77 | | |||
69 | void trackModified(const ModelDataLoader::TrackDataType &modifiedTrack); | 78 | void trackModified(const ModelDataLoader::TrackDataType &modifiedTrack); | ||
70 | 79 | | |||
71 | void trackRemoved(qulonglong removedTrackId); | 80 | void trackRemoved(qulonglong removedTrackId); | ||
72 | 81 | | |||
73 | void genresAdded(ModelDataLoader::ListGenreDataType newData); | 82 | void genresAdded(ModelDataLoader::ListGenreDataType newData); | ||
74 | 83 | | |||
75 | void artistsAdded(ModelDataLoader::ListArtistDataType newData); | 84 | void artistsAdded(ModelDataLoader::ListArtistDataType newData); | ||
76 | 85 | | |||
77 | void artistRemoved(qulonglong removedDatabaseId); | 86 | void artistRemoved(qulonglong removedDatabaseId); | ||
78 | 87 | | |||
79 | void albumsAdded(ModelDataLoader::ListAlbumDataType newData); | 88 | void albumsAdded(ModelDataLoader::ListAlbumDataType newData); | ||
80 | 89 | | |||
81 | void albumRemoved(qulonglong removedDatabaseId); | 90 | void albumRemoved(qulonglong removedDatabaseId); | ||
82 | 91 | | |||
83 | void albumModified(const ModelDataLoader::AlbumDataType &modifiedAlbum); | 92 | void albumModified(const ModelDataLoader::AlbumDataType &modifiedAlbum); | ||
84 | 93 | | |||
94 | void saveRadioModified(const ModelDataLoader::TrackDataType trackDataType); | ||||
95 | | ||||
96 | void removeRadio(qulonglong radioId); | ||||
97 | | ||||
98 | void radioRemoved(qulonglong radioId); | ||||
99 | | ||||
85 | public Q_SLOTS: | 100 | public Q_SLOTS: | ||
86 | 101 | | |||
87 | void loadData(ElisaUtils::PlayListEntryType dataType); | 102 | void loadData(ElisaUtils::PlayListEntryType dataType); | ||
88 | 103 | | |||
89 | void loadDataByAlbumId(ElisaUtils::PlayListEntryType dataType, qulonglong databaseId); | 104 | void loadDataByAlbumId(ElisaUtils::PlayListEntryType dataType, qulonglong databaseId); | ||
90 | 105 | | |||
91 | void loadDataByGenre(ElisaUtils::PlayListEntryType dataType, | 106 | void loadDataByGenre(ElisaUtils::PlayListEntryType dataType, | ||
92 | const QString &genre); | 107 | const QString &genre); | ||
Show All 9 Lines | |||||
102 | 117 | | |||
103 | void loadDataByFileName(ElisaUtils::PlayListEntryType dataType, | 118 | void loadDataByFileName(ElisaUtils::PlayListEntryType dataType, | ||
104 | const QUrl &fileName); | 119 | const QUrl &fileName); | ||
105 | 120 | | |||
106 | void loadRecentlyPlayedData(ElisaUtils::PlayListEntryType dataType); | 121 | void loadRecentlyPlayedData(ElisaUtils::PlayListEntryType dataType); | ||
107 | 122 | | |||
108 | void loadFrequentlyPlayedData(ElisaUtils::PlayListEntryType dataType); | 123 | void loadFrequentlyPlayedData(ElisaUtils::PlayListEntryType dataType); | ||
109 | 124 | | |||
125 | void updateRadioData(ModelDataLoader::TrackDataType trackDataType); | ||||
126 | | ||||
127 | void deleteRadioData(qulonglong radioId); | ||||
128 | | ||||
110 | private: | 129 | private: | ||
111 | 130 | | |||
112 | void databaseTracksAdded(const ListTrackDataType &newData); | 131 | void databaseTracksAdded(const ListTrackDataType &newData); | ||
astippich: can these be renamed for consistency with others? | |||||
113 | 132 | | |||
114 | void databaseTrackModified(const TrackDataType &modifiedTrack); | 133 | void databaseTrackModified(const TrackDataType &modifiedTrack); | ||
115 | 134 | | |||
116 | void databaseTrackRemoved(qulonglong removedTrackId); | 135 | void databaseTrackRemoved(qulonglong removedTrackId); | ||
117 | 136 | | |||
118 | void databaseGenresAdded(const ListGenreDataType &newData); | 137 | void databaseGenresAdded(const ListGenreDataType &newData); | ||
119 | 138 | | |||
120 | void databaseArtistsAdded(const ListArtistDataType &newData); | 139 | void databaseArtistsAdded(const ListArtistDataType &newData); | ||
121 | 140 | | |||
122 | void databaseArtistRemoved(qulonglong removedDatabaseId); | 141 | void databaseArtistRemoved(qulonglong removedDatabaseId); | ||
123 | 142 | | |||
124 | void databaseAlbumsAdded(const ListAlbumDataType &newData); | 143 | void databaseAlbumsAdded(const ListAlbumDataType &newData); | ||
125 | 144 | | |||
126 | void databaseAlbumRemoved(qulonglong removedDatabaseId); | 145 | void databaseAlbumRemoved(qulonglong removedDatabaseId); | ||
127 | 146 | | |||
128 | void databaseAlbumModified(const AlbumDataType &modifiedAlbum); | 147 | void databaseAlbumModified(const AlbumDataType &modifiedAlbum); | ||
129 | 148 | | |||
149 | void databaseRadioAdded(const TrackDataType radio); | ||||
150 | | ||||
151 | void databaseRadioModified(const TrackDataType radio); | ||||
152 | | ||||
153 | void databaseRadioRemoved(qulonglong radioId); | ||||
154 | | ||||
130 | private: | 155 | private: | ||
131 | 156 | | |||
132 | std::unique_ptr<ModelDataLoaderPrivate> d; | 157 | std::unique_ptr<ModelDataLoaderPrivate> d; | ||
133 | 158 | | |||
134 | }; | 159 | }; | ||
135 | 160 | | |||
136 | #endif // MODELDATALOADER_H | 161 | #endif // MODELDATALOADER_H |
are all these updateUI signals (also below) really necessary? they are not needed for the rest of the views