From f81078e79b119ca252446c519e73f443c6e86177 Mon Sep 17 00:00:00 2001 From: asava Date: Mon, 13 Apr 2020 18:43:32 +0300 Subject: [PATCH] Correct Linux scan --- rEFIt_UEFI/Platform/Settings.cpp | 8 ++------ rEFIt_UEFI/entry_scan/loader.cpp | 7 +++++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/rEFIt_UEFI/Platform/Settings.cpp b/rEFIt_UEFI/Platform/Settings.cpp index ec4a7bad4..018a3c928 100644 --- a/rEFIt_UEFI/Platform/Settings.cpp +++ b/rEFIt_UEFI/Platform/Settings.cpp @@ -1850,9 +1850,7 @@ FillinCustomEntry ( FreePool (Entry->ImagePath); Entry->ImagePath = NULL; } - if (!Entry->Image.isEmpty()) { - Entry->Image.setEmpty(); - } + Entry->Image.setEmpty(); if (Prop->type == kTagTypeString) { Entry->ImagePath = PoolPrint (L"%a", Prop->string); } @@ -1872,9 +1870,7 @@ FillinCustomEntry ( FreePool (Entry->DriveImagePath); Entry->DriveImagePath = NULL; } - if (!Entry->DriveImage.isEmpty()) { - Entry->DriveImage.setEmpty(); - } + Entry->DriveImage.setEmpty(); if (Prop->type == kTagTypeString) { Entry->DriveImagePath = PoolPrint (L"%a", Prop->string); } diff --git a/rEFIt_UEFI/entry_scan/loader.cpp b/rEFIt_UEFI/entry_scan/loader.cpp index 32cf52e46..06cfbff42 100644 --- a/rEFIt_UEFI/entry_scan/loader.cpp +++ b/rEFIt_UEFI/entry_scan/loader.cpp @@ -1241,7 +1241,8 @@ VOID ScanLoader(VOID) } if (aFound && (aFound == aIndex)) { XImage ImageX; - ImageX.LoadXImage(ThemeX.ThemeDir, AndroidEntryData[Index].Icon); + XStringW IconXSW = XStringW().takeValueFrom(AndroidEntryData[Index].Icon); + ImageX.LoadXImage(ThemeX.ThemeDir, (L"os_"_XSW + IconXSW.SubString(0, IconXSW.IdxOf(','))).wc_str()); AddLoaderEntry(AndroidEntryData[Index].Path, ""_XS, XStringW().takeValueFrom(AndroidEntryData[Index].Title), Volume, (ImageX.isEmpty() ? NULL : &ImageX), OSTYPE_LIN, OSFLAG_NODEFAULTARGS); } @@ -1254,6 +1255,8 @@ VOID ScanLoader(VOID) // 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()); ImageX.LoadXImage(ThemeX.ThemeDir, LinuxEntryData[Index].Icon); AddLoaderEntry(LinuxEntryData[Index].Path, ""_XS, XStringW().takeValueFrom(LinuxEntryData[Index].Title), Volume, (ImageX.isEmpty() ? NULL : &ImageX), OSTYPE_LIN, OSFLAG_NODEFAULTARGS); @@ -1783,7 +1786,7 @@ STATIC VOID AddCustomEntry(IN UINTN CustomIndex, if (Image.isEmpty() && Custom->ImagePath) { Image.LoadXImage(ThemeX.ThemeDir, Custom->ImagePath); if (Image.isEmpty()) { - Image.LoadXImage(ThemeX.ThemeDir, XStringW() + L"os_"_XSW + Custom->ImagePath); + Image.LoadXImage(ThemeX.ThemeDir, L"os_"_XSW + Custom->ImagePath); if (Image.isEmpty()) { Image.LoadXImage(SelfDir, Custom->ImagePath); if (Image.isEmpty()) {