Skip to content

Commit d3bf4b6

Browse files
committed
MenuContainer: Faster recent Metro apps enumeration
It seems that `SHCreateItemInKnownFolder` is quite slow for Metro apps. Thus we should avoid it and use cached app info.
1 parent aa09a0d commit d3bf4b6

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

Src/StartMenu/StartMenuDLL/MenuContainer.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1937,15 +1937,6 @@ void CMenuContainer::GetRecentPrograms( std::vector<MenuItem> &items, int maxCou
19371937
continue;
19381938
}
19391939

1940-
{
1941-
CComPtr<IShellItem> pAppItem;
1942-
if (FAILED(SHCreateItemInKnownFolder(FOLDERID_AppsFolder2,0,uaItem.name,IID_IShellItem,(void**)&pAppItem)))
1943-
continue;
1944-
CComString pName;
1945-
if (FAILED(pAppItem->GetDisplayName(SIGDN_NORMALDISPLAY,&pName)) || wcsncmp(pName,L"@{",2)==0)
1946-
continue;
1947-
}
1948-
19491940
uaItem.pLinkInfo=g_ItemManager.GetMetroAppInfo10(uaItem.name);
19501941
if (!uaItem.pLinkInfo)
19511942
{
@@ -1956,6 +1947,11 @@ void CMenuContainer::GetRecentPrograms( std::vector<MenuItem> &items, int maxCou
19561947
LOG_MENU(LOG_MFU,L"UserAssist: '%s', %d, %.3f",uaItem.name,data.count,uaItem.rank);
19571948
{
19581949
CItemManager::RWLock lock(&g_ItemManager,false,CItemManager::RWLOCK_ITEMS);
1950+
if (uaItem.pLinkInfo->GetMetroName().IsEmpty() || wcsncmp(uaItem.pLinkInfo->GetMetroName(), L"@{",2)==0)
1951+
{
1952+
LOG_MENU(LOG_MFU, L"UserAssist: Dropping: No metro name");
1953+
continue;
1954+
}
19591955
if (uaItem.pLinkInfo->IsNoPin())
19601956
{
19611957
LOG_MENU(LOG_MFU,L"UserAssist: Dropping: No pin");

0 commit comments

Comments
 (0)