engine/collectionframework/datasource/manager/src/glxcollectionpluginbase.cpp
changeset 43 72396548277c
parent 26 c499df2dbb33
child 44 aa2fa096cbfb
equal deleted inserted replaced
42:5e1df1b52eb3 43:72396548277c
   100 // ----------------------------------------------------------------------------
   100 // ----------------------------------------------------------------------------
   101 // Navigates to the given path
   101 // Navigates to the given path
   102 // ----------------------------------------------------------------------------
   102 // ----------------------------------------------------------------------------
   103 //
   103 //
   104 EXPORT_C void CGlxCollectionPluginBase::OpenL(const CMPXCollectionPath& aPath,
   104 EXPORT_C void CGlxCollectionPluginBase::OpenL(const CMPXCollectionPath& aPath,
   105                    const TArray<TMPXAttribute>& /*aAttrs*/,
   105                    const TArray<TMPXAttribute>& aAttrs,
   106                    CMPXFilter* aFilter)
   106                    CMPXFilter* aFilter)
   107     {
   107     {
   108     TRACER("void CGlxCollectionPluginBase::OpenL()");
   108     TRACER("void CGlxCollectionPluginBase::OpenL()");
   109     iPath = CMPXCollectionPath::NewL(aPath);
   109     iPath = CMPXCollectionPath::NewL(aPath);
   110     if(aFilter)
   110     // When a collection is opened for browsing, 
   111         {
   111     // there are two queries executed with similar filter. 
   112         if(aFilter->IsSupported(KGlxFilterGeneralNavigationalStateOnly))
   112     // First query to open the collection from list / cloud view.
       
   113     // Second one from grid view construction. To improve the grid opening
       
   114     // performance, the first query will be completed with empty Id list.
       
   115     TBool openRequest = EFalse;
       
   116     for (TInt index = 0; index < aAttrs.Count(); index++)
       
   117         {
       
   118         const TMPXAttribute attr = aAttrs[index];
       
   119 
       
   120         if (attr == KGlxFilterGeneralNavigationalStateOnly)
   113             {
   121             {
   114             RArray<TMPXItemId> mpxIds;
   122             openRequest = ETrue;
   115          	CleanupClosePushL(mpxIds);
       
   116             iPath->AppendL(mpxIds.Array());
       
   117             iObs->HandleOpen(iPath, KErrNone);
       
   118             CleanupStack::PopAndDestroy(&mpxIds);
       
   119             delete iPath;
       
   120             iPath = NULL;
       
   121             return;
       
   122             }
   123             }
       
   124         }
       
   125 
       
   126     if ((aFilter && aFilter->IsSupported(
       
   127             KGlxFilterGeneralNavigationalStateOnly)) || openRequest)
       
   128         {
       
   129         RArray<TMPXItemId> mpxIds;
       
   130         CleanupClosePushL(mpxIds);
       
   131         iPath->AppendL(mpxIds.Array());
       
   132         iObs->HandleOpen(iPath, KErrNone);
       
   133         CleanupStack::PopAndDestroy(&mpxIds);
       
   134         delete iPath;
       
   135         iPath = NULL;
       
   136         return;
   123         }
   137         }
   124 
   138 
   125     TGlxMediaId targetId(aPath.Id());
   139     TGlxMediaId targetId(aPath.Id());
   126     if (aPath.Levels() == KGlxCollectionRootLevel)
   140     if (aPath.Levels() == KGlxCollectionRootLevel)
   127         {
   141         {
   216 	    
   230 	    
   217         TInt countInfo(0);
   231         TInt countInfo(0);
   218 	    
   232 	    
   219 	    if(aSpecs->IsSupported(KMPXMediaGeneralSize))
   233 	    if(aSpecs->IsSupported(KMPXMediaGeneralSize))
   220 	    	{
   234 	    	{
   221 	    	tnFileInfo->iFileSize = aSpecs->ValueTObjectL<TInt>(KMPXMediaGeneralSize);
   235 	    	tnFileInfo->iFileSize = aSpecs->ValueTObjectL<TUint>(KMPXMediaGeneralSize);
   222 	    	countInfo++;
   236 	    	countInfo++;
   223 	    	}
   237 	    	}
   224 	    if(aSpecs->IsSupported(KGlxMediaGeneralLastModifiedDate))
   238 	    if(aSpecs->IsSupported(KGlxMediaGeneralLastModifiedDate))
   225 	    	{
   239 	    	{
   226 	    	tnFileInfo->iFileTime = aSpecs->ValueTObjectL<TInt64>(KGlxMediaGeneralLastModifiedDate);
   240 	    	tnFileInfo->iFileTime = aSpecs->ValueTObjectL<TInt64>(KGlxMediaGeneralLastModifiedDate);