mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-12 18:29:24 +08:00
Merge branch 'master' of https://github.com/qianlifeng/Wox.git
This commit is contained in:
commit
25cedff47a
@ -15,6 +15,11 @@ namespace Wox
|
|||||||
{
|
{
|
||||||
private static Dictionary<string, object> imageCache = new Dictionary<string, object>();
|
private static Dictionary<string, object> imageCache = new Dictionary<string, object>();
|
||||||
private static List<string> imageExts = new List<string>() { ".png", ".jpg", ".jpeg", ".gif", ".bmp", ".tiff", ".ico" };
|
private static List<string> imageExts = new List<string>() { ".png", ".jpg", ".jpeg", ".gif", ".bmp", ".tiff", ".ico" };
|
||||||
|
private static List<string> selfExts = new List<string>() {
|
||||||
|
".exe", ".lnk",
|
||||||
|
".ani", ".cur",
|
||||||
|
".sln"
|
||||||
|
};
|
||||||
|
|
||||||
private static ImageSource GetIcon(string fileName)
|
private static ImageSource GetIcon(string fileName)
|
||||||
{
|
{
|
||||||
@ -42,7 +47,7 @@ namespace Wox
|
|||||||
{
|
{
|
||||||
return imageCache[fullPath];
|
return imageCache[fullPath];
|
||||||
}
|
}
|
||||||
if (imageCache.ContainsKey(ext))
|
if (!selfExts.Contains(ext) && imageCache.ContainsKey(ext))
|
||||||
{
|
{
|
||||||
return imageCache[ext];
|
return imageCache[ext];
|
||||||
}
|
}
|
||||||
@ -56,9 +61,10 @@ namespace Wox
|
|||||||
{
|
{
|
||||||
resolvedPath = fullPath;
|
resolvedPath = fullPath;
|
||||||
}
|
}
|
||||||
|
string extn = Path.GetExtension(resolvedPath).ToLower();
|
||||||
|
|
||||||
var cacheKey = fullPath;
|
var cacheKey = fullPath;
|
||||||
if (resolvedPath.ToLower().EndsWith(".exe") || resolvedPath.ToLower().EndsWith(".lnk"))
|
if (selfExts.Contains(extn))
|
||||||
{
|
{
|
||||||
img = GetIcon(resolvedPath);
|
img = GetIcon(resolvedPath);
|
||||||
}
|
}
|
||||||
@ -69,7 +75,7 @@ namespace Wox
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
img = GetIcon(resolvedPath);
|
img = GetIcon(resolvedPath);
|
||||||
cacheKey = ext;
|
if (!selfExts.Contains(ext)) cacheKey = ext;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (img != null)
|
if (img != null)
|
||||||
|
Loading…
Reference in New Issue
Block a user