From 7cd9768880197c8f14bd774eaee1f9027e2583ea Mon Sep 17 00:00:00 2001 From: CoenraadS Date: Tue, 22 Jul 2014 13:13:26 +0200 Subject: [PATCH] Fix default icon retrieval. And replace continue; with if() statements (supposably more compile friendly) --- .../ControlPanel/ControlPanelList.cs | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanelList.cs b/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanelList.cs index 7448449822..d32b77a24f 100644 --- a/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanelList.cs +++ b/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanelList.cs @@ -66,20 +66,19 @@ namespace Wox.Plugin.SystemPlugins.ControlPanel { executablePath = getExecutablePath(currentKey); - if (executablePath == null) - continue; //Cannot have item without executable path + if (!(executablePath == null)) //Cannot have item without executable path + { + localizedString = getLocalizedString(currentKey); - localizedString = getLocalizedString(currentKey); + if (!string.IsNullOrEmpty(localizedString))//Cannot have item without Title + { + infoTip = getInfoTip(currentKey); - if (string.IsNullOrEmpty(localizedString)) - continue; //Cannot have item without Title - - infoTip = getInfoTip(currentKey); - - myIcon = getIcon(currentKey, size); - - controlPanelItems.Add(new ControlPanelItem(localizedString, infoTip, key, executablePath, myIcon)); + myIcon = getIcon(currentKey, size); + controlPanelItems.Add(new ControlPanelItem(localizedString, infoTip, key, executablePath, myIcon)); + } + } } } @@ -251,7 +250,7 @@ namespace Wox.Plugin.SystemPlugins.ControlPanel if (iconPtr == IntPtr.Zero) { iconQueue = new Queue(); - EnumResourceNamesWithID(dataFilePointer, 3, new EnumResNameDelegate(EnumRes), IntPtr.Zero); //Iterate through resources. + EnumResourceNamesWithID(dataFilePointer, GROUP_ICON, new EnumResNameDelegate(EnumRes), IntPtr.Zero); //Iterate through resources. while (iconPtr == IntPtr.Zero && iconQueue.Count > 0) {