Skip to content

Commit a78956b

Browse files
authored
Merge branch 'dev' into filewatcher
2 parents 5404303 + 961e182 commit a78956b

File tree

50 files changed

+343
-255
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+343
-255
lines changed

.github/workflows/stale.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# For more information, see:
2+
# https://github.com/actions/stale
3+
name: Mark stale issues and pull requests
4+
5+
on:
6+
schedule:
7+
- cron: '30 1 * * *'
8+
9+
jobs:
10+
stale:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
issues: write
14+
pull-requests: write
15+
steps:
16+
- uses: actions/stale@v4
17+
with:
18+
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
19+
days-before-stale: 30
20+
days-before-close: 5
21+
days-before-pr-close: -1
22+
exempt-all-milestones: true
23+
close-issue-message: 'This issue was closed because it has been stale for 5 days with no activity. If you feel this issue still needs attention please feel free to reopen.'

Flow.Launcher.Core/Flow.Launcher.Core.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net5.0-windows</TargetFramework>
4+
<TargetFramework>net6.0-windows</TargetFramework>
55
<UseWpf>true</UseWpf>
66
<UseWindowsForms>true</UseWindowsForms>
77
<OutputType>Library</OutputType>
@@ -53,7 +53,7 @@
5353
</ItemGroup>
5454

5555
<ItemGroup>
56-
<PackageReference Include="Droplex" Version="1.4.0" />
56+
<PackageReference Include="Droplex" Version="1.4.1" />
5757
<PackageReference Include="FSharp.Core" Version="5.0.2" />
5858
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="2.1.3" />
5959
<PackageReference Include="squirrel.windows" Version="1.5.2" />

Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,6 @@ internal class PluginAssemblyLoader : AssemblyLoadContext
1515

1616
private readonly AssemblyName assemblyName;
1717

18-
private static readonly ConcurrentDictionary<string, byte> loadedAssembly;
19-
20-
static PluginAssemblyLoader()
21-
{
22-
var currentAssemblies = AppDomain.CurrentDomain.GetAssemblies();
23-
loadedAssembly = new ConcurrentDictionary<string, byte>(
24-
currentAssemblies.Select(x => new KeyValuePair<string, byte>(x.FullName, default)));
25-
26-
AppDomain.CurrentDomain.AssemblyLoad += (sender, args) =>
27-
{
28-
loadedAssembly[args.LoadedAssembly.FullName] = default;
29-
};
30-
}
31-
3218
internal PluginAssemblyLoader(string assemblyFilePath)
3319
{
3420
dependencyResolver = new AssemblyDependencyResolver(assemblyFilePath);
@@ -47,21 +33,15 @@ protected override Assembly Load(AssemblyName assemblyName)
4733
// When resolving dependencies, ignore assembly depenedencies that already exits with Flow.Launcher
4834
// Otherwise duplicate assembly will be loaded and some weird behavior will occur, such as WinRT.Runtime.dll
4935
// will fail due to loading multiple versions in process, each with their own static instance of registration state
50-
if (assemblyPath == null || ExistsInReferencedPackage(assemblyName))
51-
return null;
36+
var existAssembly = Default.Assemblies.FirstOrDefault(x => x.FullName == assemblyName.FullName);
5237

53-
return LoadFromAssemblyPath(assemblyPath);
38+
return existAssembly ?? (assemblyPath == null ? null : LoadFromAssemblyPath(assemblyPath));
5439
}
5540

5641
internal Type FromAssemblyGetTypeOfInterface(Assembly assembly, Type type)
5742
{
5843
var allTypes = assembly.ExportedTypes;
5944
return allTypes.First(o => o.IsClass && !o.IsAbstract && o.GetInterfaces().Any(t => t == type));
6045
}
61-
62-
internal bool ExistsInReferencedPackage(AssemblyName assemblyName)
63-
{
64-
return loadedAssembly.ContainsKey(assemblyName.FullName);
65-
}
6646
}
6747
}

Flow.Launcher.Core/Resource/AvailableLanguages.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ internal static class AvailableLanguages
1919
public static Language Serbian = new Language("sr", "Srpski");
2020
public static Language Portuguese_Portugal = new Language("pt-pt", "Português");
2121
public static Language Portuguese_Brazil = new Language("pt-br", "Português (Brasil)");
22+
public static Language Spanish = new Language("es", "Spanish");
23+
public static Language Spanish_LatinAmerica = new Language("es-419", "Spanish (Latin America)");
2224
public static Language Italian = new Language("it", "Italiano");
2325
public static Language Norwegian_Bokmal = new Language("nb-NO", "Norsk Bokmål");
2426
public static Language Slovak = new Language("sk", "Slovenský");
@@ -43,6 +45,8 @@ public static List<Language> GetAvailableLanguages()
4345
Serbian,
4446
Portuguese_Portugal,
4547
Portuguese_Brazil,
48+
Spanish,
49+
Spanish_LatinAmerica,
4650
Italian,
4751
Norwegian_Bokmal,
4852
Slovak,

Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net5.0-windows</TargetFramework>
4+
<TargetFramework>net6.0-windows</TargetFramework>
55
<ProjectGuid>{4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}</ProjectGuid>
66
<OutputType>Library</OutputType>
77
<UseWpf>true</UseWpf>

Flow.Launcher.Infrastructure/Image/ImageCache.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ async void SliceExtra()
7474
// To delete the images from the data dictionary based on the resizing of the Usage Dictionary
7575
// Double Check to avoid concurrent remove
7676
if (Data.Count > permissibleFactor * MaxCached)
77-
foreach (var key in Data.OrderBy(x => x.Value.usage).Take(Data.Count - MaxCached).Select(x => x.Key).ToArray())
77+
foreach (var key in Data.OrderBy(x => x.Value.usage).Take(Data.Count - MaxCached).Select(x => x.Key))
7878
Data.TryRemove(key, out _);
7979
semaphore.Release();
8080
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net5.0-windows</TargetFramework>
4+
<TargetFramework>net6.0-windows</TargetFramework>
55
<ProjectGuid>{8451ECDD-2EA4-4966-BB0A-7BBC40138E80}</ProjectGuid>
66
<UseWPF>true</UseWPF>
77
<OutputType>Library</OutputType>
@@ -14,10 +14,10 @@
1414
</PropertyGroup>
1515

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

Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,27 @@ public interface IPublicAPI
228228
public void OpenDirectory(string DirectoryPath, string FileName = null);
229229

230230
/// <summary>
231-
/// Opens the url. The browser and mode used is based on what's configured in Flow's default browser settings.
231+
/// Opens the URL with the given Uri object.
232+
/// The browser and mode used is based on what's configured in Flow's default browser settings.
233+
/// </summary>
234+
public void OpenUrl(Uri url, bool? inPrivate = null);
235+
236+
/// <summary>
237+
/// Opens the URL with the given string.
238+
/// The browser and mode used is based on what's configured in Flow's default browser settings.
239+
/// Non-C# plugins should use this method.
232240
/// </summary>
233241
public void OpenUrl(string url, bool? inPrivate = null);
242+
243+
/// <summary>
244+
/// Opens the application URI with the given Uri object, e.g. obsidian://search-query-example
245+
/// </summary>
246+
public void OpenAppUri(Uri appUri);
247+
248+
/// <summary>
249+
/// Opens the application URI with the given string, e.g. obsidian://search-query-example
250+
/// Non-C# plugins should use this method
251+
/// </summary>
252+
public void OpenAppUri(string appUri);
234253
}
235254
}

Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public static void OpenInBrowserWindow(this string url, string browserPath = "",
6060

6161
try
6262
{
63-
Process.Start(psi);
63+
Process.Start(psi)?.Dispose();
6464
}
6565
catch (System.ComponentModel.Win32Exception)
6666
{
@@ -100,7 +100,7 @@ public static void OpenInBrowserTab(this string url, string browserPath = "", bo
100100
psi.FileName = url;
101101
}
102102

103-
Process.Start(psi);
103+
Process.Start(psi)?.Dispose();
104104
}
105105
// This error may be thrown if browser path is incorrect
106106
catch (System.ComponentModel.Win32Exception)

Flow.Launcher.Test/Flow.Launcher.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net5.0-windows10.0.19041.0</TargetFramework>
4+
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
55
<ProjectGuid>{FF742965-9A80-41A5-B042-D6C7D3A21708}</ProjectGuid>
66
<OutputType>Library</OutputType>
77
<AppDesignerFolder>Properties</AppDesignerFolder>

0 commit comments

Comments
 (0)