winemenubuilder: Only extract icons when association changed.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2020-11-13 10:30:56 +01:00 committed by Alexandre Julliard
parent a600d7ece1
commit 3603478b1b
1 changed files with 7 additions and 1 deletions

View File

@ -2657,7 +2657,7 @@ static BOOL generate_associations(const char *xdg_data_home, const char *package
executableW = assoc_query(ASSOCSTR_EXECUTABLE, extensionW, openW);
if (executableW)
openWithIconA = extract_icon(executableW, 0, NULL, FALSE);
openWithIconA = compute_native_identifier(0, executableW);
friendlyAppNameW = assoc_query(ASSOCSTR_FRIENDLYAPPNAME, extensionW, openW);
if (friendlyAppNameW)
@ -2730,6 +2730,12 @@ static BOOL generate_associations(const char *xdg_data_home, const char *package
}
}
if (hasChanged && openWithIconA)
{
char *outputIconA = extract_icon(executableW, 0, openWithIconA, FALSE);
HeapFree(GetProcessHeap(), 0, outputIconA);
}
end:
HeapFree(GetProcessHeap(), 0, extensionA);
HeapFree(GetProcessHeap(), 0, commandW);