diff -r 5e1df1b52eb3 -r 72396548277c engine/collectionframework/datasource/manager/src/glxcollectionpluginbase.cpp --- a/engine/collectionframework/datasource/manager/src/glxcollectionpluginbase.cpp Mon May 17 13:35:26 2010 +0530 +++ b/engine/collectionframework/datasource/manager/src/glxcollectionpluginbase.cpp Fri May 28 21:11:54 2010 +0530 @@ -102,26 +102,40 @@ // ---------------------------------------------------------------------------- // EXPORT_C void CGlxCollectionPluginBase::OpenL(const CMPXCollectionPath& aPath, - const TArray& /*aAttrs*/, + const TArray& aAttrs, CMPXFilter* aFilter) { TRACER("void CGlxCollectionPluginBase::OpenL()"); iPath = CMPXCollectionPath::NewL(aPath); - if(aFilter) + // When a collection is opened for browsing, + // there are two queries executed with similar filter. + // First query to open the collection from list / cloud view. + // Second one from grid view construction. To improve the grid opening + // performance, the first query will be completed with empty Id list. + TBool openRequest = EFalse; + for (TInt index = 0; index < aAttrs.Count(); index++) { - if(aFilter->IsSupported(KGlxFilterGeneralNavigationalStateOnly)) + const TMPXAttribute attr = aAttrs[index]; + + if (attr == KGlxFilterGeneralNavigationalStateOnly) { - RArray mpxIds; - CleanupClosePushL(mpxIds); - iPath->AppendL(mpxIds.Array()); - iObs->HandleOpen(iPath, KErrNone); - CleanupStack::PopAndDestroy(&mpxIds); - delete iPath; - iPath = NULL; - return; + openRequest = ETrue; } } + if ((aFilter && aFilter->IsSupported( + KGlxFilterGeneralNavigationalStateOnly)) || openRequest) + { + RArray mpxIds; + CleanupClosePushL(mpxIds); + iPath->AppendL(mpxIds.Array()); + iObs->HandleOpen(iPath, KErrNone); + CleanupStack::PopAndDestroy(&mpxIds); + delete iPath; + iPath = NULL; + return; + } + TGlxMediaId targetId(aPath.Id()); if (aPath.Levels() == KGlxCollectionRootLevel) { @@ -218,7 +232,7 @@ if(aSpecs->IsSupported(KMPXMediaGeneralSize)) { - tnFileInfo->iFileSize = aSpecs->ValueTObjectL(KMPXMediaGeneralSize); + tnFileInfo->iFileSize = aSpecs->ValueTObjectL(KMPXMediaGeneralSize); countInfo++; } if(aSpecs->IsSupported(KGlxMediaGeneralLastModifiedDate))