Skip to content

Commit 82ebbcb

Browse files
authored
merge PR #154: add dedicated missing image icon
2 parents e204a09 + c86e2db commit 82ebbcb

File tree

8 files changed

+16
-14
lines changed

8 files changed

+16
-14
lines changed

Doc/app_missing_img.png

43.5 KB
Loading

Flow.Launcher.Infrastructure/Constant.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ public static class Constant
2323
public static readonly string Version = FileVersionInfo.GetVersionInfo(Assembly.Location.NonNull()).ProductVersion;
2424

2525
public static readonly int ThumbnailSize = 64;
26-
public static readonly string DefaultIcon = Path.Combine(ProgramDirectory, "Images", "app.png");
27-
public static readonly string ErrorIcon = Path.Combine(ProgramDirectory, "Images", "app_error.png");
26+
private static readonly string ImagesDirectory = Path.Combine(ProgramDirectory, "Images");
27+
public static readonly string DefaultIcon = Path.Combine(ImagesDirectory, "app.png");
28+
public static readonly string ErrorIcon = Path.Combine(ImagesDirectory, "app_error.png");
29+
public static readonly string MissingImgIcon = Path.Combine(ImagesDirectory, "app_missing_img.png");
2830

2931
public static string PythonPath;
3032

Flow.Launcher.Infrastructure/Image/ImageLoader.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static void Initialize()
3838

3939
_imageCache.Usage = LoadStorageToConcurrentDictionary();
4040

41-
foreach (var icon in new[] { Constant.DefaultIcon, Constant.ErrorIcon })
41+
foreach (var icon in new[] { Constant.DefaultIcon, Constant.MissingImgIcon })
4242
{
4343
ImageSource img = new BitmapImage(new Uri(icon));
4444
img.Freeze();
@@ -106,7 +106,7 @@ private static ImageResult LoadInternal(string path, bool loadFullImage = false)
106106
{
107107
if (string.IsNullOrEmpty(path))
108108
{
109-
return new ImageResult(_imageCache[Constant.ErrorIcon], ImageType.Error);
109+
return new ImageResult(_imageCache[Constant.MissingImgIcon], ImageType.Error);
110110
}
111111
if (_imageCache.ContainsKey(path))
112112
{
@@ -139,7 +139,7 @@ private static ImageResult LoadInternal(string path, bool loadFullImage = false)
139139
Log.Exception($"|ImageLoader.Load|Failed to get thumbnail for {path} on first try", e);
140140
Log.Exception($"|ImageLoader.Load|Failed to get thumbnail for {path} on second try", e2);
141141

142-
ImageSource image = _imageCache[Constant.ErrorIcon];
142+
ImageSource image = _imageCache[Constant.MissingImgIcon];
143143
_imageCache[path] = image;
144144
imageResult = new ImageResult(image, ImageType.Error);
145145
}
@@ -191,8 +191,8 @@ private static ImageResult GetThumbnailResult(ref string path, bool loadFullImag
191191
}
192192
else
193193
{
194-
image = _imageCache[Constant.ErrorIcon];
195-
path = Constant.ErrorIcon;
194+
image = _imageCache[Constant.MissingImgIcon];
195+
path = Constant.MissingImgIcon;
196196
}
197197

198198
if (type != ImageType.Error)
43.5 KB
Loading

Flow.Launcher/ViewModel/ResultViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public ImageSource Image
5151
catch (Exception e)
5252
{
5353
Log.Exception($"|ResultViewModel.Image|IcoPath is empty and exception when calling Icon() for result <{Result.Title}> of plugin <{Result.PluginDirectory}>", e);
54-
imagePath = Constant.ErrorIcon;
54+
imagePath = Constant.MissingImgIcon;
5555
}
5656
}
5757

Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ private BitmapImage ImageFromPath(string path)
536536
ProgramLogger.LogException($"|UWP|ImageFromPath|{path}" +
537537
$"|Unable to get logo for {UserModelId} from {path} and" +
538538
$" located in {Package.Location}", new FileNotFoundException());
539-
return new BitmapImage(new Uri(Constant.ErrorIcon));
539+
return new BitmapImage(new Uri(Constant.MissingImgIcon));
540540
}
541541
}
542542

@@ -586,7 +586,7 @@ private ImageSource PlatedImage(BitmapImage image)
586586
$"|Unable to convert background string {BackgroundColor} " +
587587
$"to color for {Package.Location}", new InvalidOperationException());
588588

589-
return new BitmapImage(new Uri(Constant.ErrorIcon));
589+
return new BitmapImage(new Uri(Constant.MissingImgIcon));
590590
}
591591
}
592592
else

SolutionAssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
[assembly: AssemblyTrademark("")]
1717
[assembly: AssemblyCulture("")]
1818
[assembly: ComVisible(false)]
19-
[assembly: AssemblyVersion("1.2.1")]
20-
[assembly: AssemblyFileVersion("1.2.1")]
21-
[assembly: AssemblyInformationalVersion("1.2.1")]
19+
[assembly: AssemblyVersion("1.3.0")]
20+
[assembly: AssemblyFileVersion("1.3.0")]
21+
[assembly: AssemblyInformationalVersion("1.3.0")]

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: '1.2.1.{build}'
1+
version: '1.3.0.{build}'
22

33
init:
44
- ps: |

0 commit comments

Comments
 (0)