Skip to content

Commit 48faa99

Browse files
committed
Merge branch 'dev' into fix_plugin_depenedency_loading
2 parents 4bfc733 + e866820 commit 48faa99

File tree

19 files changed

+66
-51
lines changed

19 files changed

+66
-51
lines changed

Doc/app_missing_img.png

43.5 KB
Loading

Flow.Launcher.Core/Configuration/Portable.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public void RemoveUninstallerEntry()
9595

9696
public void MoveUserDataFolder(string fromLocation, string toLocation)
9797
{
98-
FilesFolders.Copy(fromLocation, toLocation);
98+
FilesFolders.CopyAll(fromLocation, toLocation);
9999
VerifyUserDataAfterMove(fromLocation, toLocation);
100100
}
101101

Flow.Launcher.Core/Updater.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public async Task UpdateApp(IPublicAPI api , bool silentUpdate = true)
9191
if (DataLocation.PortableDataLocationInUse())
9292
{
9393
var targetDestination = updateManager.RootAppDirectory + $"\\app-{newReleaseVersion.ToString()}\\{DataLocation.PortableFolderName}";
94-
FilesFolders.Copy(DataLocation.PortableDataPath, targetDestination);
94+
FilesFolders.CopyAll(DataLocation.PortableDataPath, targetDestination);
9595
if (!FilesFolders.VerifyBothFolderFilesEqual(DataLocation.PortableDataPath, targetDestination))
9696
MessageBox.Show("Flow Launcher was not able to move your user profile data to the new update version. Please manually " +
9797
$"move your profile data folder from {DataLocation.PortableDataPath} to {targetDestination}");

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)

Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
</PropertyGroup>
1515

1616
<PropertyGroup>
17-
<Version>1.2.0</Version>
18-
<PackageVersion>1.2.0</PackageVersion>
19-
<AssemblyVersion>1.2.0</AssemblyVersion>
20-
<FileVersion>1.2.0</FileVersion>
17+
<Version>1.2.1</Version>
18+
<PackageVersion>1.2.1</PackageVersion>
19+
<AssemblyVersion>1.2.1</AssemblyVersion>
20+
<FileVersion>1.2.1</FileVersion>
2121
<PackageId>Flow.Launcher.Plugin</PackageId>
2222
<Authors>Flow-Launcher</Authors>
2323
<PackageLicenseExpression>MIT</PackageLicenseExpression>

Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public static class FilesFolders
1717
/// </summary>
1818
/// <param name="sourcePath"></param>
1919
/// <param name="targetPath"></param>
20-
public static void Copy(this string sourcePath, string targetPath)
20+
public static void CopyAll(this string sourcePath, string targetPath)
2121
{
2222
// Get the subdirectories for the specified directory.
2323
DirectoryInfo dir = new DirectoryInfo(sourcePath);
@@ -50,7 +50,7 @@ public static void Copy(this string sourcePath, string targetPath)
5050
foreach (DirectoryInfo subdir in dirs)
5151
{
5252
string temppath = Path.Combine(targetPath, subdir.Name);
53-
Copy(subdir.FullName, temppath);
53+
CopyAll(subdir.FullName, temppath);
5454
}
5555
}
5656
catch (Exception e)
@@ -114,7 +114,7 @@ public static bool LocationExists(this string path)
114114
return Directory.Exists(path);
115115
}
116116

117-
public static bool FileExits(this string filePath)
117+
public static bool FileExists(this string filePath)
118118
{
119119
return File.Exists(filePath);
120120
}
@@ -124,7 +124,7 @@ public static void OpenPath(string fileOrFolderPath)
124124
var psi = new ProcessStartInfo { FileName = FileExplorerProgramName, UseShellExecute = true, Arguments = fileOrFolderPath };
125125
try
126126
{
127-
if (LocationExists(fileOrFolderPath) || FileExits(fileOrFolderPath))
127+
if (LocationExists(fileOrFolderPath) || FileExists(fileOrFolderPath))
128128
Process.Start(psi);
129129
}
130130
catch (Exception e)

Flow.Launcher/App.xaml.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Diagnostics;
3+
using System.Text;
34
using System.Threading.Tasks;
45
using System.Timers;
56
using System.Windows;
@@ -85,6 +86,8 @@ private void OnStartup(object sender, StartupEventArgs e)
8586

8687
Http.Proxy = _settings.Proxy;
8788

89+
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
90+
8891
RegisterExitEvents();
8992

9093
AutoStartup();
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

0 commit comments

Comments
 (0)