mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 04:23:32 +00:00
[RAPPS]
free cached entries and some other improvements patch by Ismael Ferreras Morezuelas aka swyter CORE-9060 svn path=/trunk/; revision=67224
This commit is contained in:
parent
1e7977088b
commit
4745785f04
6 changed files with 34 additions and 46 deletions
|
@ -2,8 +2,8 @@
|
||||||
cd rapps
|
cd rapps
|
||||||
mkdir utf16
|
mkdir utf16
|
||||||
for i in $(find -type f); do
|
for i in $(find -type f); do
|
||||||
../../../../output-MinGW-i386/host-tools/tools/utf16le.exe $i utf16/$i
|
../../../host-tools/tools/utf16le $i utf16/$i
|
||||||
done
|
done
|
||||||
cd ..
|
cd ..
|
||||||
../../../output-MinGW-i386/host-tools/tools/cabman/cabman -M mszip -S rappmgr.cab rapps/utf16/*.txt
|
../../host-tools/tools/cabman/cabman -M mszip -S rappmgr.cab rapps/utf16/*.txt
|
||||||
rm -r rapps/uft16
|
rm -r rapps/uft16
|
|
@ -246,7 +246,7 @@ EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc)
|
||||||
|
|
||||||
skip_if_cached:
|
skip_if_cached:
|
||||||
|
|
||||||
if (Info->Category == -1)
|
if (Info->Category == FALSE)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (EnumType != Info->Category && EnumType != ENUM_ALL_AVAILABLE)
|
if (EnumType != Info->Category && EnumType != ENUM_ALL_AVAILABLE)
|
||||||
|
@ -277,4 +277,22 @@ skip_if_cached:
|
||||||
FindClose(hFind);
|
FindClose(hFind);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID FreeCachedAvailableEntries(VOID)
|
||||||
|
{
|
||||||
|
PAPPLICATION_INFO Info;
|
||||||
|
|
||||||
|
/* loop and deallocate all the cached app infos in the list */
|
||||||
|
for (pCachedEntry = CachedEntriesHead.Flink; pCachedEntry != &CachedEntriesHead;)
|
||||||
|
{
|
||||||
|
Info = CONTAINING_RECORD(pCachedEntry, APPLICATION_INFO, List);
|
||||||
|
|
||||||
|
/* grab a reference to the next linked entry before getting rid of the current one */
|
||||||
|
pCachedEntry = pCachedEntry->Flink;
|
||||||
|
|
||||||
|
/* flush them down the toilet :D */
|
||||||
|
RemoveEntryList(&Info->List);
|
||||||
|
HeapFree(GetProcessHeap(), 0, Info);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -194,10 +194,10 @@ BEGIN
|
||||||
IDS_AVAILABLEFORINST "Disponible para su instalación"
|
IDS_AVAILABLEFORINST "Disponible para su instalación"
|
||||||
IDS_UPDATES "Actualizaciones"
|
IDS_UPDATES "Actualizaciones"
|
||||||
IDS_APPLICATIONS "Aplicaciones"
|
IDS_APPLICATIONS "Aplicaciones"
|
||||||
IDS_CHOOSE_FOLDER_TEXT "Seleccione una carpeta donde se descargarán los programas:"
|
IDS_CHOOSE_FOLDER_TEXT "Seleccione una carpeta de donde se descargarán los programas:"
|
||||||
IDS_CHOOSE_FOLDER_ERROR "¡La carpeta especificada no existe!"
|
IDS_CHOOSE_FOLDER_ERROR "La carpeta especificada no existe."
|
||||||
IDS_APP_REG_REMOVE "¿Está seguro de querer borrar del Registro los datos de instalación del programa?"
|
IDS_APP_REG_REMOVE "¿Está seguro de querer borrar del Registro los datos de instalación del programa?"
|
||||||
IDS_INFORMATION "Información"
|
IDS_INFORMATION "Información"
|
||||||
IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not found!"
|
IDS_UNABLE_TO_DOWNLOAD "No se pudo descargar el paquete. No se ha encontrado la dirección de Internet."
|
||||||
IDS_UNABLE_TO_REMOVE "¡No se pudieron borrar del Registro los datos de instalación del programa!"
|
IDS_UNABLE_TO_REMOVE "No se pudieron borrar del Registro los datos de instalación del programa."
|
||||||
END
|
END
|
||||||
|
|
|
@ -414,12 +414,8 @@ LPWSTR GetINIFullPath(LPCWSTR lpFileName)
|
||||||
UINT ParserGetString(LPCWSTR lpKeyName, LPWSTR lpReturnedString, UINT nSize, LPCWSTR lpFileName)
|
UINT ParserGetString(LPCWSTR lpKeyName, LPWSTR lpReturnedString, UINT nSize, LPCWSTR lpFileName)
|
||||||
{
|
{
|
||||||
PWSTR lpFullFileName = GetINIFullPath(lpFileName);
|
PWSTR lpFullFileName = GetINIFullPath(lpFileName);
|
||||||
LPSTR lpRequiredBuf = HeapAlloc(GetProcessHeap(), 0, nSize);
|
|
||||||
DWORD dwResult;
|
DWORD dwResult;
|
||||||
|
|
||||||
if (!lpRequiredBuf)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
/* we don't have cached section strings for the current system language, create them */
|
/* we don't have cached section strings for the current system language, create them */
|
||||||
if(bCachedSectionStatus == FALSE)
|
if(bCachedSectionStatus == FALSE)
|
||||||
{
|
{
|
||||||
|
@ -457,7 +453,7 @@ UINT ParserGetString(LPCWSTR lpKeyName, LPWSTR lpReturnedString, UINT nSize, LPC
|
||||||
lpFullFileName);
|
lpFullFileName);
|
||||||
|
|
||||||
if (dwResult != 0)
|
if (dwResult != 0)
|
||||||
goto skip;
|
return TRUE;
|
||||||
|
|
||||||
/* 2nd - if they weren't present check for neutral sub-langs/ generic translations (e.g. "Section.0a") */
|
/* 2nd - if they weren't present check for neutral sub-langs/ generic translations (e.g. "Section.0a") */
|
||||||
dwResult = GetPrivateProfileStringW(szCachedINISectionLocaleNeutral,
|
dwResult = GetPrivateProfileStringW(szCachedINISectionLocaleNeutral,
|
||||||
|
@ -468,7 +464,7 @@ UINT ParserGetString(LPCWSTR lpKeyName, LPWSTR lpReturnedString, UINT nSize, LPC
|
||||||
lpFullFileName);
|
lpFullFileName);
|
||||||
|
|
||||||
if (dwResult != 0)
|
if (dwResult != 0)
|
||||||
goto skip;
|
return TRUE;
|
||||||
|
|
||||||
/* 3rd - if they weren't present fallback to standard english strings (just "Section") */
|
/* 3rd - if they weren't present fallback to standard english strings (just "Section") */
|
||||||
dwResult = GetPrivateProfileStringW(L"Section",
|
dwResult = GetPrivateProfileStringW(L"Section",
|
||||||
|
@ -478,18 +474,7 @@ UINT ParserGetString(LPCWSTR lpKeyName, LPWSTR lpReturnedString, UINT nSize, LPC
|
||||||
nSize,
|
nSize,
|
||||||
lpFullFileName);
|
lpFullFileName);
|
||||||
|
|
||||||
if (dwResult == 0)
|
return (dwResult != 0 ? TRUE : FALSE);
|
||||||
{
|
|
||||||
HeapFree(GetProcessHeap(), 0, lpRequiredBuf);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
skip:
|
|
||||||
|
|
||||||
/* get rid of the dynamically allocated ANSI buffer */
|
|
||||||
HeapFree(GetProcessHeap(), 0, lpRequiredBuf);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT ParserGetInt(LPCWSTR lpKeyName, LPCWSTR lpFileName)
|
UINT ParserGetInt(LPCWSTR lpKeyName, LPCWSTR lpFileName)
|
||||||
|
|
|
@ -125,6 +125,7 @@ typedef BOOL (CALLBACK *AVAILENUMPROC)(PAPPLICATION_INFO Info);
|
||||||
BOOL EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc);
|
BOOL EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc);
|
||||||
BOOL ShowAvailableAppInfo(INT Index);
|
BOOL ShowAvailableAppInfo(INT Index);
|
||||||
BOOL UpdateAppsDB(VOID);
|
BOOL UpdateAppsDB(VOID);
|
||||||
|
VOID FreeCachedAvailableEntries(VOID);
|
||||||
|
|
||||||
/* installdlg.c */
|
/* installdlg.c */
|
||||||
BOOL InstallApplication(INT Index);
|
BOOL InstallApplication(INT Index);
|
||||||
|
|
|
@ -147,21 +147,6 @@ EnumInstalledAppProc(INT ItemIndex, LPWSTR lpName, PINSTALLED_INFO Info)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
|
||||||
FreeAvailableAppList(VOID)
|
|
||||||
{
|
|
||||||
INT Count = ListView_GetItemCount(hListView) - 1;
|
|
||||||
PVOID Info;
|
|
||||||
|
|
||||||
while (Count >= 0)
|
|
||||||
{
|
|
||||||
Info = ListViewGetlParam(Count);
|
|
||||||
if (Info)
|
|
||||||
HeapFree(GetProcessHeap(), 0, Info);
|
|
||||||
Count--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
CALLBACK
|
CALLBACK
|
||||||
EnumAvailableAppProc(PAPPLICATION_INFO Info)
|
EnumAvailableAppProc(PAPPLICATION_INFO Info)
|
||||||
|
@ -202,9 +187,6 @@ UpdateApplicationsList(INT EnumType)
|
||||||
|
|
||||||
if (IS_INSTALLED_ENUM(SelectedEnumType))
|
if (IS_INSTALLED_ENUM(SelectedEnumType))
|
||||||
FreeInstalledAppList();
|
FreeInstalledAppList();
|
||||||
/* FIXME: reenable when caching is fixed */
|
|
||||||
/* else if (IS_AVAILABLE_ENUM(SelectedEnumType))
|
|
||||||
FreeAvailableAppList(); */
|
|
||||||
|
|
||||||
(VOID) ListView_DeleteAllItems(hListView);
|
(VOID) ListView_DeleteAllItems(hListView);
|
||||||
|
|
||||||
|
@ -887,11 +869,13 @@ MainWindowProc(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
FreeLogs();
|
FreeLogs();
|
||||||
|
|
||||||
if (IS_AVAILABLE_ENUM(SelectedEnumType))
|
FreeCachedAvailableEntries();
|
||||||
FreeAvailableAppList();
|
|
||||||
if (IS_INSTALLED_ENUM(SelectedEnumType))
|
if (IS_INSTALLED_ENUM(SelectedEnumType))
|
||||||
FreeInstalledAppList();
|
FreeInstalledAppList();
|
||||||
if (hImageTreeView) ImageList_Destroy(hImageTreeView);
|
|
||||||
|
if (hImageTreeView)
|
||||||
|
ImageList_Destroy(hImageTreeView);
|
||||||
|
|
||||||
PostQuitMessage(0);
|
PostQuitMessage(0);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue