Merge pull request #131 from CoenraadS/master

Fix default icon retrieval.
This commit is contained in:
qianlifeng 2014-07-22 19:30:23 +08:00
commit f473c29430

View file

@ -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<IntPtr>();
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)
{