equal
deleted
inserted
replaced
54 // --------------------------------------------------------------------------- |
54 // --------------------------------------------------------------------------- |
55 // Two-phased constructor. |
55 // Two-phased constructor. |
56 // --------------------------------------------------------------------------- |
56 // --------------------------------------------------------------------------- |
57 // |
57 // |
58 EXPORT_C CGlxGridViewMLObserver* CGlxGridViewMLObserver::NewL( |
58 EXPORT_C CGlxGridViewMLObserver* CGlxGridViewMLObserver::NewL( |
59 MGlxMediaList& aMediaList, CHgGrid* aHgGrid) |
59 MGlxMediaList& aMediaList, CHgGrid* aHgGrid, |
|
60 TGlxFilterItemType aFilterType) |
60 { |
61 { |
61 TRACER("CGlxGridViewMLObserver::NewL()"); |
62 TRACER("CGlxGridViewMLObserver::NewL()"); |
62 CGlxGridViewMLObserver* self = |
63 CGlxGridViewMLObserver* self = new (ELeave) CGlxGridViewMLObserver( |
63 new (ELeave) CGlxGridViewMLObserver(aMediaList, aHgGrid); |
64 aMediaList, aHgGrid, aFilterType); |
64 CleanupStack::PushL(self); |
65 CleanupStack::PushL(self); |
65 self->ConstructL(); |
66 self->ConstructL(); |
66 CleanupStack::Pop(self); |
67 CleanupStack::Pop(self); |
67 return self; |
68 return self; |
68 } |
69 } |
70 // C++ default constructor can NOT contain any code, that |
71 // C++ default constructor can NOT contain any code, that |
71 // might leave. |
72 // might leave. |
72 // --------------------------------------------------------------------------- |
73 // --------------------------------------------------------------------------- |
73 // |
74 // |
74 CGlxGridViewMLObserver::CGlxGridViewMLObserver(MGlxMediaList& aMediaList, |
75 CGlxGridViewMLObserver::CGlxGridViewMLObserver(MGlxMediaList& aMediaList, |
75 CHgGrid* aHgGrid ) : iMediaList(aMediaList), iHgGrid(aHgGrid) |
76 CHgGrid* aHgGrid, TGlxFilterItemType aFilterType) : |
|
77 iMediaList(aMediaList), iHgGrid(aHgGrid), iFilterType(aFilterType) |
76 { |
78 { |
77 TRACER("CGlxGridViewMLObserver::CGlxGridViewMLObserver()"); |
79 TRACER("CGlxGridViewMLObserver::CGlxGridViewMLObserver()"); |
78 } |
80 } |
79 |
81 |
80 // --------------------------------------------------------------------------- |
82 // --------------------------------------------------------------------------- |
222 iSpeedTnAttrib ); |
224 iSpeedTnAttrib ); |
223 |
225 |
224 TInt tnError = GlxErrorManager::HasAttributeErrorL( |
226 TInt tnError = GlxErrorManager::HasAttributeErrorL( |
225 item.Properties(), KGlxMediaIdThumbnail ); |
227 item.Properties(), KGlxMediaIdThumbnail ); |
226 GLX_DEBUG4("GlxGridMLObs::HandleAttributesAvailableL() tnError(%d)" |
228 GLX_DEBUG4("GlxGridMLObs::HandleAttributesAvailableL() tnError(%d)" |
227 "qualityTn(%x) and speedTn(%x)", qualityTn, speedTn, tnError); |
229 "qualityTn(%x) and speedTn(%x)",tnError, qualityTn, speedTn ); |
228 |
230 |
229 if (qualityTn) |
231 if (qualityTn) |
230 { |
232 { |
231 CFbsBitmap* bitmap = new (ELeave) CFbsBitmap; |
233 CFbsBitmap* bitmap = new (ELeave) CFbsBitmap; |
232 bitmap->Duplicate(qualityTn->iBitmap->Handle()); |
234 bitmap->Duplicate(qualityTn->iBitmap->Handle()); |
414 { |
416 { |
415 TRACER("CGlxGridViewMLObserver::HandlePopulatedL()"); |
417 TRACER("CGlxGridViewMLObserver::HandlePopulatedL()"); |
416 if (iHgGrid) |
418 if (iHgGrid) |
417 { |
419 { |
418 // Setting the Empty Text |
420 // Setting the Empty Text |
419 HBufC* emptyText = |
421 if (iFilterType == EGlxFilterImage) |
420 StringLoader::LoadLC(R_GRID_EMPTY_VIEW_TEXT); |
422 { |
421 iHgGrid->SetEmptyTextL(*emptyText); |
423 HBufC* emptyText = StringLoader::LoadLC( |
422 CleanupStack::PopAndDestroy(emptyText); |
424 R_GRID_EMPTY_VIEW_TEXT_IMAGE); |
|
425 iHgGrid->SetEmptyTextL(*emptyText); |
|
426 CleanupStack::PopAndDestroy(emptyText); |
|
427 } |
|
428 else if (iFilterType == EGlxFilterVideo) |
|
429 { |
|
430 HBufC* emptyText = StringLoader::LoadLC( |
|
431 R_GRID_EMPTY_VIEW_TEXT_VIDEO); |
|
432 iHgGrid->SetEmptyTextL(*emptyText); |
|
433 CleanupStack::PopAndDestroy(emptyText); |
|
434 } |
|
435 else |
|
436 { |
|
437 HBufC* emptyText = StringLoader::LoadLC(R_GRID_EMPTY_VIEW_TEXT); |
|
438 iHgGrid->SetEmptyTextL(*emptyText); |
|
439 CleanupStack::PopAndDestroy(emptyText); |
|
440 } |
|
441 |
423 GLX_DEBUG2("GridMLObserver::HandlePopulatedL() iMediaList.Count()=%d", |
442 GLX_DEBUG2("GridMLObserver::HandlePopulatedL() iMediaList.Count()=%d", |
424 iMediaList.Count()); |
443 iMediaList.Count()); |
425 |
444 |
426 if (iMediaList.Count() <= 0) |
445 if (iMediaList.Count() <= 0) |
427 { |
446 { |
428 GLX_DEBUG1("GridMLObserver::HandlePopulatedL() - SetEmptyTextL()"); |
447 GLX_DEBUG1("GridMLObserver::HandlePopulatedL() - SetEmptyTextL()"); |
429 iHgGrid->DrawNow(); |
448 iHgGrid->DrawNow(); |