diff -r b023a8d2866a -r ea65f74e6de4 photosgallery/viewframework/dataprovider/src/glxmulmodelproviderbase.cpp --- a/photosgallery/viewframework/dataprovider/src/glxmulmodelproviderbase.cpp Thu Jul 15 18:39:01 2010 +0300 +++ b/photosgallery/viewframework/dataprovider/src/glxmulmodelproviderbase.cpp Thu Aug 19 09:55:03 2010 +0300 @@ -20,19 +20,16 @@ #include "glxmulmodelproviderbase.h" -#include #include #include #include #include -//#include #include #include #include +#include // An interface for Multimedia coverflow Widget #include //Logging #include -#include "glxbinding.h" -#include "glxcommandbindingutility.h" #include #include @@ -42,8 +39,9 @@ #include #include #include -#include // An interface for Multimedia coverflow Widget #include "glxdrmgiftexturecreator.h" +#include "glxbinding.h" +#include "glxcommandbindingutility.h" using namespace Alf; @@ -51,9 +49,6 @@ static const char* const KGridWidget = "GridWidget"; static const char* const KCoverFlowWidget = "CoverflowWidget"; -//@todo to be uncommented when using command binding -//#include "glxboundcommand.h" - // ---------------------------------------------------------------------------- // BaseConstructL // ---------------------------------------------------------------------------- @@ -189,6 +184,7 @@ AlfEventStatus response = EEventNotHandled; if ( aEvent.IsCustomEvent() ) { + GLX_LOG_INFO1("CGlxMulModelProviderBase::offerEvent() aEvent.CustomParameter(%d)", aEvent.CustomParameter()); switch ( aEvent.CustomParameter() ) { case KAlfActionIdDeviceLayoutChanged: @@ -206,9 +202,29 @@ response = EEventHandled; } break; - default: - break; - } + case Alf::ETypeItemRemoved: + { + GLX_LOG_INFO("CGlxMulModelProviderBase::offerEvent - ETypeItemRemoved!"); + CGlxUiUtility* uiUtility = CGlxUiUtility::UtilityL(); + CleanupClosePushL(*uiUtility); + if (iModel->Count() == 0 && UString(KCoverFlowWidget) + == UString(iWidget.widgetName()) + && iNavigationalState->ViewingMode() + == NGlxNavigationalState::EView + && uiUtility->GetForegroundStatus()) + { + uiUtility->SetViewNavigationDirection( + EGlxNavigationBackwards); + + iNavigationalState->ActivatePreviousViewL(); + response = EEventHandled; + } + CleanupStack::PopAndDestroy(uiUtility); + } + break; + default: + break; + } } return response; } @@ -306,12 +322,12 @@ TGlxMediaGeneralRightsValidity isValid = EGlxDrmRightsValidityUnknown; if (aMedia.GetDrmProtected(drm)) { - GLX_DEBUG1("CGlxMulModelProviderBase::SetDataT GetDrmValidity"); aMedia.GetDrmValidity(isValid); + GLX_DEBUG2("CGlxMulModelProviderBase::SetDataT DrmValidity(%d)", isValid); } TInt frameCount; aMedia.GetFrameCount(frameCount); - + GLX_DEBUG2("CGlxMulModelProviderBase::SetDataT framecount=%d", frameCount); //Create the DRM gif texture intance only if the DRM gif image is //valid and focused if (frameCount > 1 && drm && isValid == EGlxDrmRightsValid) @@ -444,6 +460,7 @@ { TRACER("CGlxMulModelProviderBase::RemoveItems"); // RemoveItems does not throw according to model documentation + GLX_LOG_INFO2("CGlxMulModelProviderBase::RemoveItems() aIndex(%d), aCount(%d)", aIndex, aCount); iModel->Remove( aIndex, aCount ); }