mirror of
https://github.com/reactos/reactos.git
synced 2025-06-20 07:36:05 +00:00
[FORMATTING][RAPPS] available.cpp: Fix braces
svn path=/branches/GSoC_2017/rapps/; revision=75220
This commit is contained in:
parent
17e36ed120
commit
de725c5391
1 changed files with 72 additions and 63 deletions
|
@ -9,7 +9,8 @@
|
||||||
|
|
||||||
#include "rapps.h"
|
#include "rapps.h"
|
||||||
|
|
||||||
inline void _AddText(UINT a, LPCWSTR b, DWORD c, DWORD d) {
|
inline void _AddText(UINT a, LPCWSTR b, DWORD c, DWORD d)
|
||||||
|
{
|
||||||
if (b[0] != '\0')
|
if (b[0] != '\0')
|
||||||
{
|
{
|
||||||
WCHAR szText[MAX_STR_LEN];
|
WCHAR szText[MAX_STR_LEN];
|
||||||
|
@ -19,7 +20,8 @@ inline void _AddText(UINT a, LPCWSTR b, DWORD c, DWORD d) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void _AddTextNewl(UINT a, DWORD b) {
|
inline void _AddTextNewl(UINT a, DWORD b)
|
||||||
|
{
|
||||||
WCHAR szText[MAX_STR_LEN];
|
WCHAR szText[MAX_STR_LEN];
|
||||||
LoadStringW(hInst, a, szText, _countof(szText));
|
LoadStringW(hInst, a, szText, _countof(szText));
|
||||||
InsertRichEditText(L"\n", 0);
|
InsertRichEditText(L"\n", 0);
|
||||||
|
@ -28,13 +30,16 @@ inline void _AddTextNewl(UINT a, DWORD b) {
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T, size_t N, size_t N2>
|
template<typename T, size_t N, size_t N2>
|
||||||
inline BOOL _GetString(LPCWSTR a, T(&b)[N], T (&cFileName)[N2]) {
|
inline BOOL _GetString(LPCWSTR a, T(&b)[N], T(&cFileName)[N2])
|
||||||
|
{
|
||||||
return ParserGetString(a, b, N, cFileName);
|
return ParserGetString(a, b, N, cFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T, size_t N, size_t N2>
|
template<typename T, size_t N, size_t N2>
|
||||||
inline void _GetStringNullFailure(LPCWSTR a, T(&b)[N], T (&cFileName)[N2]) {
|
inline void _GetStringNullFailure(LPCWSTR a, T(&b)[N], T(&cFileName)[N2])
|
||||||
if (!_GetString(a, b, cFileName)) {
|
{
|
||||||
|
if (!_GetString(a, b, cFileName))
|
||||||
|
{
|
||||||
b[0] = '\0';
|
b[0] = '\0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,7 +57,8 @@ inline BOOL _AppInstallCheckWithKey(PAPPLICATION_INFO Info, REGSAM key)
|
||||||
|
|
||||||
//Check both registry keys in 64bit system
|
//Check both registry keys in 64bit system
|
||||||
//TODO: check system type beforehand to avoid double checks?
|
//TODO: check system type beforehand to avoid double checks?
|
||||||
inline BOOL _AppInstallCheck(PAPPLICATION_INFO Info) {
|
inline BOOL _AppInstallCheck(PAPPLICATION_INFO Info)
|
||||||
|
{
|
||||||
return _AppInstallCheckWithKey(Info, KEY_WOW64_32KEY)
|
return _AppInstallCheckWithKey(Info, KEY_WOW64_32KEY)
|
||||||
|| _AppInstallCheckWithKey(Info, KEY_WOW64_64KEY);
|
|| _AppInstallCheckWithKey(Info, KEY_WOW64_64KEY);
|
||||||
}
|
}
|
||||||
|
@ -74,7 +80,7 @@ inline BOOL _GetInstalledVersion(PAPPLICATION_INFO Info, LPWSTR szVersion, UINT
|
||||||
|| _GetInstalledVersionWithKey(Info, szVersion, iVersionSize, KEY_WOW64_64KEY);
|
|| _GetInstalledVersionWithKey(Info, szVersion, iVersionSize, KEY_WOW64_64KEY);
|
||||||
}
|
}
|
||||||
|
|
||||||
LIST_ENTRY CachedEntriesHead = { &CachedEntriesHead, &CachedEntriesHead };
|
LIST_ENTRY CachedEntriesHead = {&CachedEntriesHead, &CachedEntriesHead};
|
||||||
PLIST_ENTRY pCachedEntry = &CachedEntriesHead;
|
PLIST_ENTRY pCachedEntry = &CachedEntriesHead;
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
|
@ -94,7 +100,8 @@ ShowAvailableAppInfo(INT Index)
|
||||||
{
|
{
|
||||||
_AddText(IDS_AINFO_VERSION, szVersion, CFE_BOLD, 0);
|
_AddText(IDS_AINFO_VERSION, szVersion, CFE_BOLD, 0);
|
||||||
}
|
}
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
_AddTextNewl(IDS_STATUS_NOTINSTALLED, CFE_ITALIC);
|
_AddTextNewl(IDS_STATUS_NOTINSTALLED, CFE_ITALIC);
|
||||||
}
|
}
|
||||||
|
@ -157,7 +164,8 @@ DeleteCurrentAppsDB(VOID)
|
||||||
continue;
|
continue;
|
||||||
result = result && DeleteFileW(szTmp);
|
result = result && DeleteFileW(szTmp);
|
||||||
|
|
||||||
} while (FindNextFileW(hFind, &FindFileData) != 0);
|
}
|
||||||
|
while (FindNextFileW(hFind, &FindFileData) != 0);
|
||||||
|
|
||||||
FindClose(hFind);
|
FindClose(hFind);
|
||||||
|
|
||||||
|
@ -263,7 +271,7 @@ EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc)
|
||||||
Info = CONTAINING_RECORD(pCachedEntry, APPLICATION_INFO, List);
|
Info = CONTAINING_RECORD(pCachedEntry, APPLICATION_INFO, List);
|
||||||
|
|
||||||
/* do we already have this entry in cache? */
|
/* do we already have this entry in cache? */
|
||||||
if(_wcsicmp(FindFileData.cFileName, Info->cFileName) == 0)
|
if (_wcsicmp(FindFileData.cFileName, Info->cFileName) == 0)
|
||||||
{
|
{
|
||||||
/* is it current enough, or the file has been modified since our last time here? */
|
/* is it current enough, or the file has been modified since our last time here? */
|
||||||
if (CompareFileTime(&FindFileData.ftLastWriteTime, &Info->ftCacheStamp) == 1)
|
if (CompareFileTime(&FindFileData.ftLastWriteTime, &Info->ftCacheStamp) == 1)
|
||||||
|
@ -283,9 +291,9 @@ EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create a new entry */
|
/* create a new entry */
|
||||||
Info = (PAPPLICATION_INFO)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(APPLICATION_INFO));
|
Info = (PAPPLICATION_INFO) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(APPLICATION_INFO));
|
||||||
|
|
||||||
if(!Info)
|
if (!Info)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
Info->Category = ParserGetInt(L"Category", FindFileData.cFileName);
|
Info->Category = ParserGetInt(L"Category", FindFileData.cFileName);
|
||||||
|
@ -297,7 +305,7 @@ EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc)
|
||||||
/* add our cached entry to the cached list */
|
/* add our cached entry to the cached list */
|
||||||
InsertTailList(&CachedEntriesHead, &Info->List);
|
InsertTailList(&CachedEntriesHead, &Info->List);
|
||||||
|
|
||||||
skip_if_cached:
|
skip_if_cached:
|
||||||
|
|
||||||
if (Info->Category == FALSE)
|
if (Info->Category == FALSE)
|
||||||
continue;
|
continue;
|
||||||
|
@ -329,7 +337,8 @@ skip_if_cached:
|
||||||
if (!lpEnumProc(Info))
|
if (!lpEnumProc(Info))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
} while (FindNextFileW(hFind, &FindFileData) != 0);
|
}
|
||||||
|
while (FindNextFileW(hFind, &FindFileData) != 0);
|
||||||
|
|
||||||
FindClose(hFind);
|
FindClose(hFind);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue