ui/uiengine/medialistwrapper/src/glxmlwrapper_p.cpp
changeset 50 a0f57508af73
parent 45 863223ea6961
child 52 a3a4c0de738e
--- a/ui/uiengine/medialistwrapper/src/glxmlwrapper_p.cpp	Fri Jun 25 15:41:33 2010 +0530
+++ b/ui/uiengine/medialistwrapper/src/glxmlwrapper_p.cpp	Sat Jul 10 00:59:39 2010 +0530
@@ -41,6 +41,7 @@
 #include "glxmlgenericobserver.h"
 #include "glxattributeretriever.h"
 #include "glxicondefs.h" //Contains the icon names/Ids
+#include "glxerrors.h"
 
 //#define GLXPERFORMANCE_LOG  
 #include <glxperformancemacro.h>
@@ -94,8 +95,8 @@
       iLsFsContextActivated(EFalse),
       iPtFsContextActivated(EFalse), 
       iPtListContextActivated(EFalse),
-      iSelectionListContextActivated(EFalse),
-	  iDetailsContextActivated(EFalse)
+      iDetailsContextActivated(EFalse),
+      iSelectionListContextActivated(EFalse)	  
 {
     TRACER("GlxMLWrapperPrivate::GlxMLWrapperPrivate");
 	iGridThumbnailContext = NULL;
@@ -700,12 +701,8 @@
     {  
         GLX_LOG_INFO1("### GlxMLWrapperPrivate::HandleAttributesAvailableL GetIconInfo-Index is %d",aItemIndex);
     }*/
-    else if( tnError == KErrCANoRights)	{
         //handle DRM case
-    }
-    else if( tnError ) {
-        return (new HbIcon(GLXICON_CORRUPT));
-    }
+
     
     GLX_LOG_INFO1("### GlxMLWrapperPrivate::RetrieveItemIcon value-Index is %d and have returned empty icon",aItemIndex);
     return NULL;
@@ -1187,7 +1184,7 @@
 void GlxMLWrapperPrivate::CheckDetailsAttributes(TInt aItemIndex, const RArray<TMPXAttribute>& aAttributes)
 {
     qDebug("GlxMLWrapperPrivate::CheckDetailsAttributes");
-    TBool attribPresent = EFalse;
+    
     TMPXAttribute titleAttrib(KMPXMediaGeneralComment);
     TIdentityRelation< TMPXAttribute > match ( &TMPXAttribute::Match );
 
@@ -1196,7 +1193,7 @@
     if (KErrNotFound != aAttributes.Find(titleAttrib, match))
         {
         qDebug("GlxMLWrapperPrivate::CheckDetailsAttributes TRUE");
-        attribPresent = ETrue;
+    
         iMLWrapper->handleDetailsItemAvailable(aItemIndex);
         GLX_LOG_INFO1("### GlxMLWrapperPrivate::CheckDetailsAttributes title present %d",aItemIndex);
         }     
@@ -1480,3 +1477,19 @@
 		}
 	}
 
+bool GlxMLWrapperPrivate::IsCorruptedImage( int aItemIndex )
+{
+    const TGlxMedia& item = iMediaList->Item( aItemIndex );
+    qDebug("GlxMLWrapperPrivate::IsCorruptedImage item property %u ", item.Properties() );
+    TInt tnError = GlxErrorManager::HasAttributeErrorL( item.Properties(), KGlxMediaIdThumbnail );
+    qDebug("GlxMLWrapperPrivate::IsCorruptedImage index %d error %d ", aItemIndex, tnError);
+    if ( KErrNone == tnError 
+            || KErrNotSupported == tnError 
+            || KErrCANoRights == tnError 
+            || KErrGlxEmptyContainer == tnError ) {
+        return false ;
+    }
+    else {
+        return true ;
+    }
+}