From 3fbf1b2dd1fc747d2d2452ce9660f4a2a1304d5e Mon Sep 17 00:00:00 2001 From: DavidXanatos <3890945+DavidXanatos@users.noreply.github.com> Date: Fri, 11 Aug 2023 22:26:02 +0200 Subject: [PATCH] 1.10.5 --- SandboxiePlus/SandMan/SbiePlusAPI.cpp | 2 ++ SandboxiePlus/SandMan/Views/SbieView.cpp | 25 ++++++++++++------------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/SandboxiePlus/SandMan/SbiePlusAPI.cpp b/SandboxiePlus/SandMan/SbiePlusAPI.cpp index 5736b581..b6583e7e 100644 --- a/SandboxiePlus/SandMan/SbiePlusAPI.cpp +++ b/SandboxiePlus/SandMan/SbiePlusAPI.cpp @@ -537,6 +537,8 @@ void CSandBoxPlus::ScanStartMenu() //pLink->Arguments = ; pLink->Icon = ReadIni(L"InternetShortcut", L"IconFile"); pLink->IconIndex = ReadIni(L"InternetShortcut", L"IconIndex").toInt(); + if (pLink->Icon.isEmpty()) + pLink->IconIndex = -1; //pLink->WorkDir = ; } diff --git a/SandboxiePlus/SandMan/Views/SbieView.cpp b/SandboxiePlus/SandMan/Views/SbieView.cpp index a7cd11b7..182ce20b 100644 --- a/SandboxiePlus/SandMan/Views/SbieView.cpp +++ b/SandboxiePlus/SandMan/Views/SbieView.cpp @@ -1869,10 +1869,10 @@ void CSbieView::UpdateStartMenu(CSandBoxPlus* pBoxEx) QAction* pAction = pMenu->addAction(Link.Name, this, SLOT(OnSandBoxAction())); QIcon Icon; - if (!Link.Icon.isEmpty()) - Icon = LoadWindowsIcon(Link.Icon, Link.IconIndex); - else if (Link.Target.contains("://")) + if(Link.IconIndex == -1) Icon = theGUI->GetIcon("Internet"); + else if (!Link.Icon.isEmpty()) + Icon = LoadWindowsIcon(Link.Icon, Link.IconIndex); if (Icon.isNull()) Icon = m_IconProvider.icon(QFileInfo(Link.Target)); pAction->setIcon(Icon); QString Command; @@ -1916,26 +1916,25 @@ void CSbieView::UpdateRunMenu(const CSandBoxPtr& pBox) QString CmdFile = pBoxEx->GetCommandFile(Entry["Command"].toString()); QString IconFile; - int IconIndex = 0; - if (FileIndex.first.isEmpty()) { - if (!CmdFile.contains("://")) - IconFile = CmdFile; - } - else if (FileIndex.second.isEmpty()) { + int IconIndex ; + if (FileIndex.second.isEmpty()) { IconFile = CmdFile; IconIndex = FileIndex.first.toInt(); } else { - IconFile = FileIndex.first.replace("%BoxRoot%", pBoxEx->GetFileRoot(), Qt::CaseInsensitive); + if (FileIndex.first.isEmpty()) + IconFile = CmdFile; + else + IconFile = FileIndex.first.replace("%BoxRoot%", pBoxEx->GetFileRoot(), Qt::CaseInsensitive); IconIndex = FileIndex.second.toInt(); } QAction* pAction = pMenu->addAction(FolderName.second, this, SLOT(OnSandBoxAction())); QIcon Icon; - if (!IconFile.isEmpty()) - Icon = LoadWindowsIcon(IconFile, IconIndex); - else if (CmdFile.contains("://")) + if(IconIndex == -1) Icon = theGUI->GetIcon("Internet"); + else if (!IconFile.isEmpty()) + Icon = LoadWindowsIcon(IconFile, IconIndex); if (Icon.isNull()) Icon = m_IconProvider.icon(QFileInfo(CmdFile)); pAction->setIcon(Icon); pAction->setData(Entry["Command"].toString());