Exclude redundant calls to LoadXImage in Linux Scan

This commit is contained in:
asava 2020-04-14 09:51:00 +03:00
parent 95976da8c6
commit 7951eb69ba

View File

@ -1254,11 +1254,13 @@ VOID ScanLoader(VOID)
if (gSettings.LinuxScan) {
// check for linux loaders
for (Index = 0; Index < LinuxEntryDataCount; ++Index) {
XImage ImageX;
XStringW IconXSW = XStringW().takeValueFrom(LinuxEntryData[Index].Icon);
ImageX.LoadXImage(ThemeX.ThemeDir, (L"os_"_XSW + IconXSW.SubString(0, IconXSW.IdxOf(','))).wc_str());
AddLoaderEntry(LinuxEntryData[Index].Path, ""_XS, XStringW().takeValueFrom(LinuxEntryData[Index].Title), Volume,
(ImageX.isEmpty() ? NULL : &ImageX), OSTYPE_LIN, OSFLAG_NODEFAULTARGS);
if (FileExists(Volume->RootDir, LinuxEntryData[Index].Path)) {
XImage ImageX;
XStringW IconXSW = XStringW().takeValueFrom(LinuxEntryData[Index].Icon);
ImageX.LoadXImage(ThemeX.ThemeDir, (L"os_"_XSW + IconXSW.SubString(0, IconXSW.IdxOf(','))).wc_str());
AddLoaderEntry(LinuxEntryData[Index].Path, ""_XS, XStringW().takeValueFrom(LinuxEntryData[Index].Title), Volume,
(ImageX.isEmpty() ? NULL : &ImageX), OSTYPE_LIN, OSFLAG_NODEFAULTARGS);
}
}
// check for linux kernels
PartGUID = FindGPTPartitionGuidInDevicePath(Volume->DevicePath);