mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 10:01:43 +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
|
||||
mkdir utf16
|
||||
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
|
||||
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
|
|
@ -246,7 +246,7 @@ EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc)
|
|||
|
||||
skip_if_cached:
|
||||
|
||||
if (Info->Category == -1)
|
||||
if (Info->Category == FALSE)
|
||||
continue;
|
||||
|
||||
if (EnumType != Info->Category && EnumType != ENUM_ALL_AVAILABLE)
|
||||
|
@ -277,4 +277,22 @@ skip_if_cached:
|
|||
FindClose(hFind);
|
||||
|
||||
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_UPDATES "Actualizaciones"
|
||||
IDS_APPLICATIONS "Aplicaciones"
|
||||
IDS_CHOOSE_FOLDER_TEXT "Seleccione una carpeta donde se descargarán los programas:"
|
||||
IDS_CHOOSE_FOLDER_ERROR "¡La carpeta especificada no existe!"
|
||||
IDS_CHOOSE_FOLDER_TEXT "Seleccione una carpeta de donde se descargarán los programas:"
|
||||
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_INFORMATION "Información"
|
||||
IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not found!"
|
||||
IDS_UNABLE_TO_REMOVE "¡No se pudieron borrar del Registro los datos de instalación del programa!"
|
||||
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."
|
||||
END
|
||||
|
|
|
@ -414,12 +414,8 @@ LPWSTR GetINIFullPath(LPCWSTR lpFileName)
|
|||
UINT ParserGetString(LPCWSTR lpKeyName, LPWSTR lpReturnedString, UINT nSize, LPCWSTR lpFileName)
|
||||
{
|
||||
PWSTR lpFullFileName = GetINIFullPath(lpFileName);
|
||||
LPSTR lpRequiredBuf = HeapAlloc(GetProcessHeap(), 0, nSize);
|
||||
DWORD dwResult;
|
||||
|
||||
if (!lpRequiredBuf)
|
||||
return FALSE;
|
||||
|
||||
/* we don't have cached section strings for the current system language, create them */
|
||||
if(bCachedSectionStatus == FALSE)
|
||||
{
|
||||
|
@ -457,7 +453,7 @@ UINT ParserGetString(LPCWSTR lpKeyName, LPWSTR lpReturnedString, UINT nSize, LPC
|
|||
lpFullFileName);
|
||||
|
||||
if (dwResult != 0)
|
||||
goto skip;
|
||||
return TRUE;
|
||||
|
||||
/* 2nd - if they weren't present check for neutral sub-langs/ generic translations (e.g. "Section.0a") */
|
||||
dwResult = GetPrivateProfileStringW(szCachedINISectionLocaleNeutral,
|
||||
|
@ -468,7 +464,7 @@ UINT ParserGetString(LPCWSTR lpKeyName, LPWSTR lpReturnedString, UINT nSize, LPC
|
|||
lpFullFileName);
|
||||
|
||||
if (dwResult != 0)
|
||||
goto skip;
|
||||
return TRUE;
|
||||
|
||||
/* 3rd - if they weren't present fallback to standard english strings (just "Section") */
|
||||
dwResult = GetPrivateProfileStringW(L"Section",
|
||||
|
@ -478,18 +474,7 @@ UINT ParserGetString(LPCWSTR lpKeyName, LPWSTR lpReturnedString, UINT nSize, LPC
|
|||
nSize,
|
||||
lpFullFileName);
|
||||
|
||||
if (dwResult == 0)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, lpRequiredBuf);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
skip:
|
||||
|
||||
/* get rid of the dynamically allocated ANSI buffer */
|
||||
HeapFree(GetProcessHeap(), 0, lpRequiredBuf);
|
||||
|
||||
return TRUE;
|
||||
return (dwResult != 0 ? TRUE : FALSE);
|
||||
}
|
||||
|
||||
UINT ParserGetInt(LPCWSTR lpKeyName, LPCWSTR lpFileName)
|
||||
|
|
|
@ -125,6 +125,7 @@ typedef BOOL (CALLBACK *AVAILENUMPROC)(PAPPLICATION_INFO Info);
|
|||
BOOL EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc);
|
||||
BOOL ShowAvailableAppInfo(INT Index);
|
||||
BOOL UpdateAppsDB(VOID);
|
||||
VOID FreeCachedAvailableEntries(VOID);
|
||||
|
||||
/* installdlg.c */
|
||||
BOOL InstallApplication(INT Index);
|
||||
|
|
|
@ -147,21 +147,6 @@ EnumInstalledAppProc(INT ItemIndex, LPWSTR lpName, PINSTALLED_INFO Info)
|
|||
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
|
||||
CALLBACK
|
||||
EnumAvailableAppProc(PAPPLICATION_INFO Info)
|
||||
|
@ -202,9 +187,6 @@ UpdateApplicationsList(INT EnumType)
|
|||
|
||||
if (IS_INSTALLED_ENUM(SelectedEnumType))
|
||||
FreeInstalledAppList();
|
||||
/* FIXME: reenable when caching is fixed */
|
||||
/* else if (IS_AVAILABLE_ENUM(SelectedEnumType))
|
||||
FreeAvailableAppList(); */
|
||||
|
||||
(VOID) ListView_DeleteAllItems(hListView);
|
||||
|
||||
|
@ -887,11 +869,13 @@ MainWindowProc(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
FreeLogs();
|
||||
|
||||
if (IS_AVAILABLE_ENUM(SelectedEnumType))
|
||||
FreeAvailableAppList();
|
||||
FreeCachedAvailableEntries();
|
||||
|
||||
if (IS_INSTALLED_ENUM(SelectedEnumType))
|
||||
FreeInstalledAppList();
|
||||
if (hImageTreeView) ImageList_Destroy(hImageTreeView);
|
||||
|
||||
if (hImageTreeView)
|
||||
ImageList_Destroy(hImageTreeView);
|
||||
|
||||
PostQuitMessage(0);
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue