From 0f1cab512b711ca15fcc1fd5285b1cda55e8be62 Mon Sep 17 00:00:00 2001 From: DavidXanatos <3890945+DavidXanatos@users.noreply.github.com> Date: Sat, 12 Aug 2023 09:39:18 +0200 Subject: [PATCH] Update SbieView.cpp --- SandboxiePlus/SandMan/Views/SbieView.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/SandboxiePlus/SandMan/Views/SbieView.cpp b/SandboxiePlus/SandMan/Views/SbieView.cpp index 182ce20b..d034da37 100644 --- a/SandboxiePlus/SandMan/Views/SbieView.cpp +++ b/SandboxiePlus/SandMan/Views/SbieView.cpp @@ -1871,8 +1871,12 @@ void CSbieView::UpdateStartMenu(CSandBoxPlus* pBoxEx) QIcon Icon; if(Link.IconIndex == -1) Icon = theGUI->GetIcon("Internet"); - else if (!Link.Icon.isEmpty()) - Icon = LoadWindowsIcon(Link.Icon, Link.IconIndex); + else if (!Link.Icon.isEmpty()) { + if(QFile::exists(Link.Icon)) + Icon = LoadWindowsIcon(Link.Icon, Link.IconIndex); + else + Icon = theGUI->GetIcon("File"); + } if (Icon.isNull()) Icon = m_IconProvider.icon(QFileInfo(Link.Target)); pAction->setIcon(Icon); QString Command; @@ -1933,8 +1937,12 @@ void CSbieView::UpdateRunMenu(const CSandBoxPtr& pBox) QIcon Icon; if(IconIndex == -1) Icon = theGUI->GetIcon("Internet"); - else if (!IconFile.isEmpty()) - Icon = LoadWindowsIcon(IconFile, IconIndex); + else if (!IconFile.isEmpty()) { + if(QFile::exists(IconFile)) + Icon = LoadWindowsIcon(IconFile, IconIndex); + else + Icon = theGUI->GetIcon("File"); + } if (Icon.isNull()) Icon = m_IconProvider.icon(QFileInfo(CmdFile)); pAction->setIcon(Icon); pAction->setData(Entry["Command"].toString());