Changeset View
Changeset View
Standalone View
Standalone View
src/models/datamodel.h
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Line(s) | 38 | { | |||
---|---|---|---|---|---|
45 | Q_PROPERTY(QString author | 45 | Q_PROPERTY(QString author | ||
46 | READ author | 46 | READ author | ||
47 | NOTIFY authorChanged) | 47 | NOTIFY authorChanged) | ||
48 | 48 | | |||
49 | Q_PROPERTY(bool isBusy READ isBusy NOTIFY isBusyChanged) | 49 | Q_PROPERTY(bool isBusy READ isBusy NOTIFY isBusyChanged) | ||
50 | 50 | | |||
51 | public: | 51 | public: | ||
52 | 52 | | |||
53 | using ListRadioDataType = DatabaseInterface::ListRadioDataType; | ||||
54 | | ||||
53 | using ListTrackDataType = DatabaseInterface::ListTrackDataType; | 55 | using ListTrackDataType = DatabaseInterface::ListTrackDataType; | ||
54 | 56 | | |||
55 | using TrackDataType = DatabaseInterface::TrackDataType; | 57 | using TrackDataType = DatabaseInterface::TrackDataType; | ||
56 | 58 | | |||
57 | using ListAlbumDataType = DatabaseInterface::ListAlbumDataType; | 59 | using ListAlbumDataType = DatabaseInterface::ListAlbumDataType; | ||
58 | 60 | | |||
59 | using AlbumDataType = DatabaseInterface::AlbumDataType; | 61 | using AlbumDataType = DatabaseInterface::AlbumDataType; | ||
60 | 62 | | |||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Line(s) | 95 | Q_SIGNALS: | |||
112 | void needFrequentlyPlayedData(ElisaUtils::PlayListEntryType dataType); | 114 | void needFrequentlyPlayedData(ElisaUtils::PlayListEntryType dataType); | ||
113 | 115 | | |||
114 | void isBusyChanged(); | 116 | void isBusyChanged(); | ||
115 | 117 | | |||
116 | public Q_SLOTS: | 118 | public Q_SLOTS: | ||
117 | 119 | | |||
118 | void tracksAdded(DataModel::ListTrackDataType newData); | 120 | void tracksAdded(DataModel::ListTrackDataType newData); | ||
119 | 121 | | |||
122 | void radiosAdded(DataModel::ListRadioDataType newData); | ||||
123 | | ||||
120 | void trackModified(const DataModel::TrackDataType &modifiedTrack); | 124 | void trackModified(const DataModel::TrackDataType &modifiedTrack); | ||
121 | 125 | | |||
122 | void trackRemoved(qulonglong removedTrackId); | 126 | void trackRemoved(qulonglong removedTrackId); | ||
123 | 127 | | |||
128 | void radioRemoved(qulonglong removedRadioId); | ||||
129 | | ||||
124 | void genresAdded(DataModel::ListGenreDataType newData); | 130 | void genresAdded(DataModel::ListGenreDataType newData); | ||
125 | 131 | | |||
126 | void artistsAdded(DataModel::ListArtistDataType newData); | 132 | void artistsAdded(DataModel::ListArtistDataType newData); | ||
127 | 133 | | |||
128 | void artistRemoved(qulonglong removedDatabaseId); | 134 | void artistRemoved(qulonglong removedDatabaseId); | ||
129 | 135 | | |||
130 | void albumsAdded(DataModel::ListAlbumDataType newData); | 136 | void albumsAdded(DataModel::ListAlbumDataType newData); | ||
131 | 137 | | |||
132 | void albumRemoved(qulonglong removedDatabaseId); | 138 | void albumRemoved(qulonglong removedDatabaseId); | ||
133 | 139 | | |||
134 | void albumModified(const DataModel::AlbumDataType &modifiedAlbum); | 140 | void albumModified(const DataModel::AlbumDataType &modifiedAlbum); | ||
135 | 141 | | |||
136 | void initialize(MusicListenersManager *manager, DatabaseInterface *database, | 142 | void initialize(MusicListenersManager *manager, DatabaseInterface *database, | ||
137 | ElisaUtils::PlayListEntryType modelType, ElisaUtils::FilterType filter, | 143 | ElisaUtils::PlayListEntryType modelType, ElisaUtils::FilterType filter, | ||
138 | const QString &genre, const QString &artist, qulonglong databaseId); | 144 | const QString &genre, const QString &artist, qulonglong databaseId); | ||
139 | 145 | | |||
140 | private Q_SLOTS: | 146 | private Q_SLOTS: | ||
astippich: just call it radioModified for consistency with the others | |||||
141 | 147 | | |||
142 | void cleanedDatabase(); | 148 | void cleanedDatabase(); | ||
143 | 149 | | |||
144 | private: | 150 | private: | ||
145 | 151 | | |||
146 | int trackIndexFromId(qulonglong id) const; | 152 | void radioAdded(const DataModel::TrackDataType radiosData); | ||
153 | | ||||
154 | void radioModified(const DataModel::TrackDataType &modifiedRadio); | ||||
155 | | ||||
156 | int indexFromId(qulonglong id) const; | ||||
147 | 157 | | |||
148 | void connectModel(DatabaseInterface *database); | 158 | void connectModel(DatabaseInterface *database); | ||
149 | 159 | | |||
150 | void setBusy(bool value); | 160 | void setBusy(bool value); | ||
151 | 161 | | |||
152 | void initializeModel(MusicListenersManager *manager, DatabaseInterface *database, | 162 | void initializeModel(MusicListenersManager *manager, DatabaseInterface *database, | ||
153 | ElisaUtils::PlayListEntryType modelType, ElisaUtils::FilterType type); | 163 | ElisaUtils::PlayListEntryType modelType, ElisaUtils::FilterType type); | ||
154 | 164 | | |||
155 | void askModelData(); | 165 | void askModelData(); | ||
156 | 166 | | |||
167 | void removeRadios(); | ||||
168 | | ||||
157 | std::unique_ptr<DataModelPrivate> d; | 169 | std::unique_ptr<DataModelPrivate> d; | ||
158 | 170 | | |||
159 | }; | 171 | }; | ||
160 | 172 | | |||
161 | #endif // DATAMODEL_H | 173 | #endif // DATAMODEL_H |
just call it radioModified for consistency with the others