26 #include "glxicondefs.h" //Contains the icon names/Ids |
26 #include "glxicondefs.h" //Contains the icon names/Ids |
27 |
27 |
28 GlxAlbumModel::GlxAlbumModel(GlxModelParm & modelParm):mContextMode(GlxContextInvalid) |
28 GlxAlbumModel::GlxAlbumModel(GlxModelParm & modelParm):mContextMode(GlxContextInvalid) |
29 { |
29 { |
30 qDebug("GlxAlbumModel::GlxAlbumModel()"); |
30 qDebug("GlxAlbumModel::GlxAlbumModel()"); |
31 |
31 mSubState = -1; |
32 mMLWrapper = new GlxMLWrapper(modelParm.collection(),modelParm.depth(),modelParm.filterType()); |
32 mMLWrapper = new GlxMLWrapper(modelParm.collection(),modelParm.depth(),modelParm.filterType()); |
33 // mMLWrapper->setContextMode(GlxContextPtList); |
33 // mMLWrapper->setContextMode(GlxContextPtList); |
34 // mContextMode = GlxContextPtList; |
34 // mContextMode = GlxContextPtList; |
35 mMLWrapper->setContextMode(GlxContextSelectionList); |
35 mMLWrapper->setContextMode(GlxContextSelectionList); |
36 mContextMode = GlxContextSelectionList; |
36 mContextMode = GlxContextSelectionList; |
163 if ( value.isValid() && value.canConvert <int> () ) { |
167 if ( value.isValid() && value.canConvert <int> () ) { |
164 setContextMode( (GlxContextMode) value.value <int> () ); |
168 setContextMode( (GlxContextMode) value.value <int> () ); |
165 return TRUE; |
169 return TRUE; |
166 } |
170 } |
167 } |
171 } |
|
172 |
|
173 if ( role == GlxSubStateRole && value.isValid() && value.canConvert <int> ()) { |
|
174 mSubState = value.value <int> () ; |
|
175 return TRUE; |
|
176 } |
168 |
177 |
169 if ( GlxFocusIndexRole == role ) { |
178 if ( GlxFocusIndexRole == role ) { |
170 if ( value.isValid() && value.canConvert <int> () ) { |
179 if ( value.isValid() && value.canConvert <int> () ) { |
171 setFocusIndex( index( value.value <int> (), 0) ); |
180 setFocusIndex( index( value.value <int> (), 0) ); |
172 return TRUE; |
181 return TRUE; |
264 |
273 |
265 void GlxAlbumModel::itemsAdded(int startIndex, int endIndex) |
274 void GlxAlbumModel::itemsAdded(int startIndex, int endIndex) |
266 { |
275 { |
267 qDebug("GlxAlbumModel::itemsAdded %d %d", startIndex, endIndex); |
276 qDebug("GlxAlbumModel::itemsAdded %d %d", startIndex, endIndex); |
268 beginInsertRows(QModelIndex(), startIndex, endIndex); |
277 beginInsertRows(QModelIndex(), startIndex, endIndex); |
|
278 itemIconCache.clear(); |
269 endInsertRows(); |
279 endInsertRows(); |
270 } |
280 } |
271 |
281 |
272 void GlxAlbumModel::itemsRemoved(int startIndex, int endIndex) |
282 void GlxAlbumModel::itemsRemoved(int startIndex, int endIndex) |
273 { |
283 { |
274 qDebug("GlxAlbumModel::itemsRemoved %d %d", startIndex, endIndex); |
284 qDebug("GlxAlbumModel::itemsRemoved %d %d", startIndex, endIndex); |
275 beginRemoveRows(QModelIndex(), startIndex, endIndex); |
285 beginRemoveRows(QModelIndex(), startIndex, endIndex); |
|
286 itemIconCache.clear(); |
276 endRemoveRows(); |
287 endRemoveRows(); |
277 //emit rowsRemoved(index(startIndex,0), startIndex, endIndex ); |
288 //emit rowsRemoved(index(startIndex,0), startIndex, endIndex ); |
278 |
289 |
279 } |
290 } |
280 |
291 |