Skip to content

Commit 0ec38fa

Browse files
committed
Add code comments & Improve code quality
1 parent 72bd4c2 commit 0ec38fa

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Plugins/Flow.Launcher.Plugin.BrowserBookmark/ChromiumBookmarkLoader.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ private void LoadFaviconsFromDb(string dbPath, List<Bookmark> bookmarks)
132132
// Use a copy to avoid lock issues with the original file
133133
var tempDbPath = Path.Combine(_faviconCacheDir, $"tempfavicons_{Guid.NewGuid()}.db");
134134

135+
// Use a copy to avoid lock issues with the original file
135136
try
136137
{
137138
File.Copy(dbPath, tempDbPath, true);

Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ protected List<Bookmark> GetBookmarksFromPath(string placesPath)
6060
File.Copy(placesPath, tempDbPath, true);
6161

6262
// Create the connection string and init the connection
63-
string dbPath = string.Format(DbPathFormat, tempDbPath);
63+
var dbPath = string.Format($"Data Source={tempDbPath};Mode=ReadOnly");
6464
using var dbConnection = new SqliteConnection(dbPath);
6565

6666
// Open connection to the database file and execute the query
@@ -119,8 +119,10 @@ protected List<Bookmark> GetBookmarksFromPath(string placesPath)
119119

120120
private void LoadFaviconsFromDb(string faviconDbPath, List<Bookmark> bookmarks)
121121
{
122+
// Use a copy to avoid lock issues with the original file
122123
var tempDbPath = Path.Combine(_faviconCacheDir, $"tempfavicons_{Guid.NewGuid()}.sqlite");
123124

125+
// Use a copy to avoid lock issues with the original file
124126
try
125127
{
126128
// Use a copy to avoid lock issues with the original file

0 commit comments

Comments
 (0)