diff --git a/DataClasses/RowData.cs b/DataClasses/RowData.cs index 1cb0317..e7271c1 100644 --- a/DataClasses/RowData.cs +++ b/DataClasses/RowData.cs @@ -148,10 +148,8 @@ namespace SystemTrayMenu.DataClasses { icon = IconReader.GetFileIconWithCache( TargetFilePath, - showOverlay, - false, - out bool toDispose); - diposeIcon = toDispose; + showOverlay); + diposeIcon = false; } catch (Exception ex) { @@ -334,8 +332,8 @@ namespace SystemTrayMenu.DataClasses { if (FileUrl.GetDefaultBrowserPath(out string browserPath)) { - icon = IconReader.GetFileIconWithCache(browserPath, true, true, out bool toDispose); - diposeIcon = toDispose; + icon = IconReader.GetFileIconWithCache(browserPath, true); + diposeIcon = false; handled = true; } } diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 0eb5e7e..25fbd97 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -39,5 +39,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.17.51")] -[assembly: AssemblyFileVersion("1.0.17.51")] +[assembly: AssemblyVersion("1.0.17.52")] +[assembly: AssemblyFileVersion("1.0.17.52")] diff --git a/Utilities/File/IconReader.cs b/Utilities/File/IconReader.cs index 7f06daf..a5d138d 100644 --- a/Utilities/File/IconReader.cs +++ b/Utilities/File/IconReader.cs @@ -47,31 +47,24 @@ namespace SystemTrayMenu.Utilities } } - public static Icon GetFileIconWithCache(string filePath, bool linkOverlay, bool isBrowser, out bool toDispose) + public static Icon GetFileIconWithCache(string filePath, bool linkOverlay) { Icon icon = null; string extension = Path.GetExtension(filePath); IconSize size = IconSize.Small; - if (isBrowser) - { - extension = "DefaultBrowserPath"; - } - if (IsExtensionWitSameIcon(extension)) { icon = DictIconCache.GetOrAdd(extension + linkOverlay, GetIcon); - Icon GetIcon(string keyExtension) - { - return GetFileIconSTA(filePath, linkOverlay, size); - } - - toDispose = false; } else { - icon = GetFileIconSTA(filePath, linkOverlay, size); - toDispose = true; + icon = DictIconCache.GetOrAdd(filePath, GetIcon); + } + + Icon GetIcon(string keyExtension) + { + return GetFileIconSTA(filePath, linkOverlay, size); } return icon;