mirror of
https://github.com/reactos/reactos.git
synced 2025-01-15 18:43:27 +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;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
CAvailableApplicationInfo* Info = FindInfo(arrAppsNames[i]);
|
||||
if (Info)
|
||||
{
|
||||
result.Add(Info);
|
||||
result.Add(*Info);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
|
|
@ -554,20 +554,20 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
ATL::CSimpleArray<CAvailableApplicationInfo*> GetCheckedItems()
|
||||
ATL::CSimpleArray<CAvailableApplicationInfo> GetCheckedItems()
|
||||
{
|
||||
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))
|
||||
{
|
||||
if (GetCheckState(i) != FALSE)
|
||||
{
|
||||
CAvailableApplicationInfo* pAppInfo = (CAvailableApplicationInfo*) GetItemData(i);
|
||||
list.Add(pAppInfo);
|
||||
list.Add(*pAppInfo);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
|
|
|
@ -45,6 +45,7 @@ struct CAvailableApplicationInfo
|
|||
ATL::CStringW m_szSHA1;
|
||||
ATL::CStringW m_szInstalledVersion;
|
||||
|
||||
// Create an object from file
|
||||
CAvailableApplicationInfo(const ATL::CStringW& sFileNameParam);
|
||||
|
||||
// Load all info from the file
|
||||
|
@ -100,7 +101,7 @@ public:
|
|||
BOOL Enum(INT EnumType, AVAILENUMPROC lpEnumProc);
|
||||
|
||||
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& GetAppPath() const;
|
||||
|
|
|
@ -26,7 +26,7 @@ public:
|
|||
DWORD_PTR dwRefData);
|
||||
|
||||
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 VOID DownloadApplicationsDB(LPCWSTR lpUrl);
|
||||
static VOID LaunchDownloadDialog(BOOL);
|
||||
|
|
|
@ -830,20 +830,15 @@ end:
|
|||
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)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Initialize shared variables
|
||||
for (INT i = 0; i < AppsList.GetSize(); ++i)
|
||||
{
|
||||
if (AppsList[i])
|
||||
{
|
||||
AppsToInstallList.Add(*(AppsList[i]));
|
||||
}
|
||||
AppsToInstallList.Add(AppsList[i]); // implicit conversion to DownloadInfo
|
||||
}
|
||||
|
||||
// Create a dialog and issue a download process
|
||||
|
|
|
@ -64,7 +64,7 @@ BOOL UseCmdParameters(LPWSTR lpCmdLine)
|
|||
apps.UpdateAppsDB();
|
||||
apps.Enum(ENUM_ALL_AVAILABLE, NULL);
|
||||
|
||||
ATL::CSimpleArray<CAvailableApplicationInfo*> arrAppInfo = apps.FindInfoList(arrNames);
|
||||
ATL::CSimpleArray<CAvailableApplicationInfo> arrAppInfo = apps.FindInfoList(arrNames);
|
||||
if (arrAppInfo.GetSize() > 0)
|
||||
{
|
||||
CDownloadManager::DownloadListOfApplications(arrAppInfo, TRUE);
|
||||
|
|
Loading…
Reference in a new issue