mirror of
https://github.com/reactos/reactos.git
synced 2025-06-15 12:59:33 +00:00
[RAPPS] Replace pointer array with object array in parts related to app DL.
This commit is contained in:
parent
11baa0d723
commit
c9aa1915df
6 changed files with 13 additions and 17 deletions
|
@ -411,15 +411,15 @@ CAvailableApplicationInfo* CAvailableApps::FindInfo(const ATL::CStringW& szAppNa
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ATL::CSimpleArray<CAvailableApplicationInfo*> CAvailableApps::FindInfoList(const ATL::CSimpleArray<ATL::CStringW> &arrAppsNames) const
|
ATL::CSimpleArray<CAvailableApplicationInfo> CAvailableApps::FindInfoList(const ATL::CSimpleArray<ATL::CStringW> &arrAppsNames) const
|
||||||
{
|
{
|
||||||
ATL::CSimpleArray<CAvailableApplicationInfo*> result;
|
ATL::CSimpleArray<CAvailableApplicationInfo> result;
|
||||||
for (INT i = 0; i < arrAppsNames.GetSize(); ++i)
|
for (INT i = 0; i < arrAppsNames.GetSize(); ++i)
|
||||||
{
|
{
|
||||||
CAvailableApplicationInfo* Info = FindInfo(arrAppsNames[i]);
|
CAvailableApplicationInfo* Info = FindInfo(arrAppsNames[i]);
|
||||||
if (Info)
|
if (Info)
|
||||||
{
|
{
|
||||||
result.Add(Info);
|
result.Add(*Info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -554,20 +554,20 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ATL::CSimpleArray<CAvailableApplicationInfo*> GetCheckedItems()
|
ATL::CSimpleArray<CAvailableApplicationInfo> GetCheckedItems()
|
||||||
{
|
{
|
||||||
if (!bHasCheckboxes)
|
if (!bHasCheckboxes)
|
||||||
{
|
{
|
||||||
return ATL::CSimpleArray<CAvailableApplicationInfo*>();
|
return ATL::CSimpleArray<CAvailableApplicationInfo>();
|
||||||
}
|
}
|
||||||
|
|
||||||
ATL::CSimpleArray<CAvailableApplicationInfo*> list;
|
ATL::CSimpleArray<CAvailableApplicationInfo> list;
|
||||||
for (INT i = 0; i >= 0; i = GetNextItem(i, LVNI_ALL))
|
for (INT i = 0; i >= 0; i = GetNextItem(i, LVNI_ALL))
|
||||||
{
|
{
|
||||||
if (GetCheckState(i) != FALSE)
|
if (GetCheckState(i) != FALSE)
|
||||||
{
|
{
|
||||||
CAvailableApplicationInfo* pAppInfo = (CAvailableApplicationInfo*) GetItemData(i);
|
CAvailableApplicationInfo* pAppInfo = (CAvailableApplicationInfo*) GetItemData(i);
|
||||||
list.Add(pAppInfo);
|
list.Add(*pAppInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
|
|
|
@ -45,6 +45,7 @@ struct CAvailableApplicationInfo
|
||||||
ATL::CStringW m_szSHA1;
|
ATL::CStringW m_szSHA1;
|
||||||
ATL::CStringW m_szInstalledVersion;
|
ATL::CStringW m_szInstalledVersion;
|
||||||
|
|
||||||
|
// Create an object from file
|
||||||
CAvailableApplicationInfo(const ATL::CStringW& sFileNameParam);
|
CAvailableApplicationInfo(const ATL::CStringW& sFileNameParam);
|
||||||
|
|
||||||
// Load all info from the file
|
// Load all info from the file
|
||||||
|
@ -100,7 +101,7 @@ public:
|
||||||
BOOL Enum(INT EnumType, AVAILENUMPROC lpEnumProc);
|
BOOL Enum(INT EnumType, AVAILENUMPROC lpEnumProc);
|
||||||
|
|
||||||
CAvailableApplicationInfo* FindInfo(const ATL::CStringW& szAppName) const;
|
CAvailableApplicationInfo* FindInfo(const ATL::CStringW& szAppName) const;
|
||||||
ATL::CSimpleArray<CAvailableApplicationInfo*> FindInfoList(const ATL::CSimpleArray<ATL::CStringW> &arrAppsNames) const;
|
ATL::CSimpleArray<CAvailableApplicationInfo> FindInfoList(const ATL::CSimpleArray<ATL::CStringW> &arrAppsNames) const;
|
||||||
|
|
||||||
const ATL::CStringW& GetFolderPath() const;
|
const ATL::CStringW& GetFolderPath() const;
|
||||||
const ATL::CStringW& GetAppPath() const;
|
const ATL::CStringW& GetAppPath() const;
|
||||||
|
|
|
@ -26,7 +26,7 @@ public:
|
||||||
DWORD_PTR dwRefData);
|
DWORD_PTR dwRefData);
|
||||||
|
|
||||||
static DWORD WINAPI ThreadFunc(LPVOID Context);
|
static DWORD WINAPI ThreadFunc(LPVOID Context);
|
||||||
static BOOL DownloadListOfApplications(const ATL::CSimpleArray<CAvailableApplicationInfo*>& AppsList, BOOL bIsModal = FALSE);
|
static BOOL DownloadListOfApplications(const ATL::CSimpleArray<CAvailableApplicationInfo>& AppsList, BOOL bIsModal = FALSE);
|
||||||
static BOOL DownloadApplication(CAvailableApplicationInfo* pAppInfo, BOOL bIsModal = FALSE);
|
static BOOL DownloadApplication(CAvailableApplicationInfo* pAppInfo, BOOL bIsModal = FALSE);
|
||||||
static VOID DownloadApplicationsDB(LPCWSTR lpUrl);
|
static VOID DownloadApplicationsDB(LPCWSTR lpUrl);
|
||||||
static VOID LaunchDownloadDialog(BOOL);
|
static VOID LaunchDownloadDialog(BOOL);
|
||||||
|
|
|
@ -830,20 +830,15 @@ end:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL CDownloadManager::DownloadListOfApplications(const ATL::CSimpleArray<CAvailableApplicationInfo*>& AppsList, BOOL bIsModal)
|
BOOL CDownloadManager::DownloadListOfApplications(const ATL::CSimpleArray<CAvailableApplicationInfo>& AppsList, BOOL bIsModal)
|
||||||
{
|
{
|
||||||
if (AppsList.GetSize() == 0)
|
if (AppsList.GetSize() == 0)
|
||||||
{
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
|
||||||
|
|
||||||
// Initialize shared variables
|
// Initialize shared variables
|
||||||
for (INT i = 0; i < AppsList.GetSize(); ++i)
|
for (INT i = 0; i < AppsList.GetSize(); ++i)
|
||||||
{
|
{
|
||||||
if (AppsList[i])
|
AppsToInstallList.Add(AppsList[i]); // implicit conversion to DownloadInfo
|
||||||
{
|
|
||||||
AppsToInstallList.Add(*(AppsList[i]));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a dialog and issue a download process
|
// Create a dialog and issue a download process
|
||||||
|
|
|
@ -64,7 +64,7 @@ BOOL UseCmdParameters(LPWSTR lpCmdLine)
|
||||||
apps.UpdateAppsDB();
|
apps.UpdateAppsDB();
|
||||||
apps.Enum(ENUM_ALL_AVAILABLE, NULL);
|
apps.Enum(ENUM_ALL_AVAILABLE, NULL);
|
||||||
|
|
||||||
ATL::CSimpleArray<CAvailableApplicationInfo*> arrAppInfo = apps.FindInfoList(arrNames);
|
ATL::CSimpleArray<CAvailableApplicationInfo> arrAppInfo = apps.FindInfoList(arrNames);
|
||||||
if (arrAppInfo.GetSize() > 0)
|
if (arrAppInfo.GetSize() > 0)
|
||||||
{
|
{
|
||||||
CDownloadManager::DownloadListOfApplications(arrAppInfo, TRUE);
|
CDownloadManager::DownloadListOfApplications(arrAppInfo, TRUE);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue