From 802457f7136205056396446ec5ce5b48a118a398 Mon Sep 17 00:00:00 2001 From: Marcin Badurowicz Date: Sun, 10 Sep 2023 22:03:41 +0200 Subject: [PATCH 1/6] switch to different nuget --- .../FirefoxBookmarkLoader.cs | 10 +++++----- .../Flow.Launcher.Plugin.BrowserBookmark.csproj | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs index 022f2814408..9bd3431ccb3 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs @@ -1,7 +1,7 @@ using Flow.Launcher.Plugin.BrowserBookmark.Models; +using Microsoft.Data.Sqlite; using System; using System.Collections.Generic; -using System.Data.SQLite; using System.IO; using System.Linq; @@ -33,11 +33,11 @@ protected static List GetBookmarksFromPath(string placesPath) // create the connection string and init the connection string dbPath = string.Format(dbPathFormat, placesPath); - using var dbConnection = new SQLiteConnection(dbPath); + using var dbConnection = new SqliteConnection(dbPath); // Open connection to the database file and execute the query dbConnection.Open(); - var reader = new SQLiteCommand(queryAllBookmarks, dbConnection).ExecuteReader(); - + var reader = new SqliteCommand(queryAllBookmarks, dbConnection).ExecuteReader(); + // return results in List format bookmarkList = reader.Select( x => new Bookmark(x["title"] is DBNull ? string.Empty : x["title"].ToString(), @@ -133,7 +133,7 @@ Current profiles.ini structure example as of Firefox version 69.0.1 public static class Extensions { - public static IEnumerable Select(this SQLiteDataReader reader, Func projection) + public static IEnumerable Select(this SqliteDataReader reader, Func projection) { while (reader.Read()) { diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj index 6cd155ecc28..fc26ee77a23 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj @@ -1,4 +1,4 @@ - + Library @@ -56,14 +56,14 @@ - + - + - + \ No newline at end of file From bdc3bfc6b8b2181fb79925659632050935c8b767 Mon Sep 17 00:00:00 2001 From: Marcin Badurowicz Date: Sun, 10 Sep 2023 23:23:30 +0200 Subject: [PATCH 2/6] remove unused properties from connection string --- .../FirefoxBookmarkLoader.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs index 9bd3431ccb3..3d061e75846 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs @@ -19,7 +19,7 @@ INNER JOIN moz_bookmarks ON ( ORDER BY moz_places.visit_count DESC "; - private const string dbPathFormat = "Data Source ={0};Version=3;New=False;Compress=True;"; + private const string dbPathFormat = "Data Source ={0}"; protected static List GetBookmarksFromPath(string placesPath) { From c33e8127eaf9606ae98fc285a23bf2e852fe01b3 Mon Sep 17 00:00:00 2001 From: Marcin Badurowicz Date: Sun, 10 Sep 2023 23:40:08 +0200 Subject: [PATCH 3/6] remove dll copy step as it is automatically done when dotnet build with rid --- .../Flow.Launcher.Plugin.BrowserBookmark.csproj | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj index fc26ee77a23..8ebf292aaa2 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj @@ -63,15 +63,4 @@ - - \ No newline at end of file From 5c7141d4f887b8cfd73b12d2c67b88b58b7e2ffb Mon Sep 17 00:00:00 2001 From: Marcin Badurowicz Date: Sun, 10 Sep 2023 23:44:10 +0200 Subject: [PATCH 4/6] set default rid to x64 --- .../Flow.Launcher.Plugin.BrowserBookmark.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj index 8ebf292aaa2..115d06a3241 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj @@ -12,6 +12,7 @@ false false true + win-x64 From 63b2a07dd98f15d1127d2349e6172da7870f6ded Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Mon, 11 Sep 2023 09:12:41 -0500 Subject: [PATCH 5/6] load unmanaged dll from dependencyResolver as well --- Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs | 13 ++++++++++++- .../Flow.Launcher.Plugin.BrowserBookmark.csproj | 1 - 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs b/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs index 1dd0683f095..87bf8e6e88b 100644 --- a/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs +++ b/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs @@ -34,6 +34,17 @@ protected override Assembly Load(AssemblyName assemblyName) return existAssembly ?? (assemblyPath == null ? null : LoadFromAssemblyPath(assemblyPath)); } + + protected override IntPtr LoadUnmanagedDll(string unmanagedDllName) + { + var path = dependencyResolver.ResolveUnmanagedDllToPath(unmanagedDllName); + if (!string.IsNullOrEmpty(path)) + { + return LoadUnmanagedDllFromPath(path); + } + + return IntPtr.Zero; + } internal Type FromAssemblyGetTypeOfInterface(Assembly assembly, Type type) { @@ -41,4 +52,4 @@ internal Type FromAssemblyGetTypeOfInterface(Assembly assembly, Type type) return allTypes.First(o => o.IsClass && !o.IsAbstract && o.GetInterfaces().Any(t => t == type)); } } -} \ No newline at end of file +} diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj index 115d06a3241..8ebf292aaa2 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj @@ -12,7 +12,6 @@ false false true - win-x64 From ab96629395fc960d42eccf2741458cf63520a503 Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Mon, 16 Oct 2023 05:55:57 -0500 Subject: [PATCH 6/6] remove legacy CompileRemove --- .../Flow.Launcher.Plugin.BrowserBookmark.csproj | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj index 8ebf292aaa2..9701c2ee869 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj @@ -55,10 +55,6 @@ - - - -