Author: cwittich
Date: Fri Apr 17 12:37:08 2015
New Revision: 67224
URL:
http://svn.reactos.org/svn/reactos?rev=67224&view=rev
Log:
[RAPPS]
free cached entries and some other improvements
patch by Ismael Ferreras Morezuelas aka swyter
CORE-9060
Modified:
trunk/reactos/base/applications/rapps/CreateCabFile.sh
trunk/reactos/base/applications/rapps/available.c
trunk/reactos/base/applications/rapps/lang/es-ES.rc
trunk/reactos/base/applications/rapps/misc.c
trunk/reactos/base/applications/rapps/rapps.h
trunk/reactos/base/applications/rapps/winmain.c
Modified: trunk/reactos/base/applications/rapps/CreateCabFile.sh
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/Cr…
==============================================================================
--- trunk/reactos/base/applications/rapps/CreateCabFile.sh [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/CreateCabFile.sh [iso-8859-1] Fri Apr 17
12:37:08 2015
@@ -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
Modified: trunk/reactos/base/applications/rapps/available.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/av…
==============================================================================
--- trunk/reactos/base/applications/rapps/available.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/available.c [iso-8859-1] Fri Apr 17 12:37:08
2015
@@ -246,7 +246,7 @@
skip_if_cached:
- if (Info->Category == -1)
+ if (Info->Category == FALSE)
continue;
if (EnumType != Info->Category && EnumType != ENUM_ALL_AVAILABLE)
@@ -277,4 +277,22 @@
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);
+ }
}
Modified: trunk/reactos/base/applications/rapps/lang/es-ES.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
==============================================================================
--- trunk/reactos/base/applications/rapps/lang/es-ES.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/lang/es-ES.rc [iso-8859-1] Fri Apr 17 12:37:08
2015
@@ -194,10 +194,10 @@
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!"
-END
+ 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
Modified: trunk/reactos/base/applications/rapps/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/mi…
==============================================================================
--- trunk/reactos/base/applications/rapps/misc.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/misc.c [iso-8859-1] Fri Apr 17 12:37:08 2015
@@ -414,11 +414,7 @@
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 @@
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 @@
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 @@
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)
Modified: trunk/reactos/base/applications/rapps/rapps.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
==============================================================================
--- trunk/reactos/base/applications/rapps/rapps.h [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/rapps.h [iso-8859-1] Fri Apr 17 12:37:08 2015
@@ -125,6 +125,7 @@
BOOL EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc);
BOOL ShowAvailableAppInfo(INT Index);
BOOL UpdateAppsDB(VOID);
+VOID FreeCachedAvailableEntries(VOID);
/* installdlg.c */
BOOL InstallApplication(INT Index);
Modified: trunk/reactos/base/applications/rapps/winmain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/wi…
==============================================================================
--- trunk/reactos/base/applications/rapps/winmain.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/winmain.c [iso-8859-1] Fri Apr 17 12:37:08 2015
@@ -147,21 +147,6 @@
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 @@
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 @@
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;