remove dup RegisterBookmarkFile & update condition

This commit is contained in:
Jeremy 2022-02-07 08:47:28 +11:00
parent 25cc50b9ac
commit 18acea3321
4 changed files with 4 additions and 10 deletions

View file

@ -34,8 +34,6 @@ namespace Flow.Launcher.Plugin.BrowserBookmark
if (!File.Exists(path))
return new();
Main.RegisterBookmarkFile(path);
var bookmarks = new List<Bookmark>();
using var jsonDocument = JsonDocument.Parse(File.ReadAllText(path));
if (!jsonDocument.RootElement.TryGetProperty("roots", out var rootElement))

View file

@ -3,10 +3,6 @@ using System.Linq;
using Flow.Launcher.Infrastructure;
using Flow.Launcher.Plugin.BrowserBookmark.Models;
using Flow.Launcher.Plugin.SharedModels;
using Microsoft.AspNetCore.Authentication;
using System.IO;
using System.Threading.Channels;
using System.Threading.Tasks;
namespace Flow.Launcher.Plugin.BrowserBookmark.Commands
{

View file

@ -9,7 +9,7 @@ namespace Flow.Launcher.Plugin.BrowserBookmark
{
public class FirefoxBookmarkLoader : IBookmarkLoader
{
private const string QueryAllBookmarks = @"SELECT moz_places.url, moz_bookmarks.title
private const string queryAllBookmarks = @"SELECT moz_places.url, moz_bookmarks.title
FROM moz_places
INNER JOIN moz_bookmarks ON (
moz_bookmarks.fk NOT NULL AND moz_bookmarks.title NOT NULL AND moz_bookmarks.fk = moz_places.id
@ -37,7 +37,7 @@ namespace Flow.Launcher.Plugin.BrowserBookmark
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<Bookmark> format
bookmarkList = reader.Select(

View file

@ -212,11 +212,11 @@ namespace Flow.Launcher.Plugin.Program
return;
if (_uwps.Any(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier))
_uwps.FirstOrDefault(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier)!
_uwps.FirstOrDefault(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier)
.Enabled = false;
if (_win32s.Any(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier))
_win32s.FirstOrDefault(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier)!
_win32s.FirstOrDefault(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier)
.Enabled = false;
_settings.DisabledProgramSources