- Fixed switching between "Installed" and "Available"
- Added default icon to "Installed"

svn path=/branches/GSoC_2017/rapps/; revision=75681
This commit is contained in:
Alexander Shaposhnikov 2017-08-26 19:41:09 +00:00
parent 93010e2e08
commit 0430bfa868
2 changed files with 9 additions and 8 deletions

View file

@ -240,12 +240,11 @@ VOID CAvailableApps::FreeCachedEntries()
/* loop and deallocate all the cached app infos in the list */
while (InfoListPosition)
{
CAvailableApplicationInfo* Info = m_InfoList.GetAt(InfoListPosition);
m_InfoList.RemoveHead();
CAvailableApplicationInfo* Info = m_InfoList.GetNext(InfoListPosition);
delete Info;
InfoListPosition = m_InfoList.GetHeadPosition();
}
m_InfoList.RemoveAll();
}
VOID CAvailableApps::DeleteCurrentAppsDB()
@ -317,6 +316,7 @@ BOOL CAvailableApps::ForceUpdateAppsDB()
BOOL CAvailableApps::EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc)
{
HANDLE hFind = INVALID_HANDLE_VALUE;
WIN32_FIND_DATAW FindFileData;

View file

@ -1396,15 +1396,13 @@ private:
return TRUE;
}
ItemInfo = (PINSTALLED_INFO) HeapAlloc(GetProcessHeap(), 0, sizeof(INSTALLED_INFO));
ItemInfo = new INSTALLED_INFO(*Info);
if (!ItemInfo)
{
RegCloseKey(Info->hSubKey);
return FALSE;
}
RtlCopyMemory(ItemInfo, Info, sizeof(INSTALLED_INFO));
Index = ListViewAddItem(ItemIndex, 0, szName, (LPARAM) ItemInfo);
/* Get version info */
@ -1481,7 +1479,7 @@ private:
nSelectedApps = 0;
if (EnumType < 0) EnumType = SelectedEnumType;
if (IS_INSTALLED_ENUM(EnumType))
if (IS_INSTALLED_ENUM(SelectedEnumType))
{
FreeInstalledAppList();
}
@ -1501,6 +1499,9 @@ private:
if (IS_INSTALLED_ENUM(EnumType))
{
HICON hIcon = (HICON) LoadIconW(hInst, MAKEINTRESOURCEW(IDI_MAIN));
ImageList_AddIcon(hImageListView, hIcon);
DestroyIcon(hIcon);
/* Enum installed applications and updates */
EnumInstalledApplications(EnumType, TRUE, s_EnumInstalledAppProc);
EnumInstalledApplications(EnumType, FALSE, s_EnumInstalledAppProc);