Skip to content

Commit 15db87c

Browse files
authored
Merge pull request #675 from Flow-Launcher/dev
Release 1.8.3
2 parents 151c69e + df9cb4b commit 15db87c

File tree

7 files changed

+31
-35
lines changed

7 files changed

+31
-35
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ private bool ActionKeywordMatch(Query query, Settings.ActionKeyword allowedActio
7575
keyword == Settings.SearchActionKeyword,
7676
Settings.ActionKeyword.PathSearchActionKeyword => Settings.PathSearchKeywordEnabled &&
7777
keyword == Settings.PathSearchActionKeyword,
78-
Settings.ActionKeyword.FileContentSearchActionKeyword => keyword ==
79-
Settings.FileContentSearchActionKeyword,
80-
Settings.ActionKeyword.IndexSearchActionKeyword => Settings.IndexOnlySearchKeywordEnabled &&
81-
keyword == Settings.IndexSearchActionKeyword
78+
Settings.ActionKeyword.FileContentSearchActionKeyword => Settings.FileContentSearchKeywordEnabled &&
79+
keyword == Settings.FileContentSearchActionKeyword,
80+
Settings.ActionKeyword.IndexSearchActionKeyword => Settings.IndexSearchKeywordEnabled &&
81+
keyword == Settings.IndexSearchActionKeyword
8282
};
8383
}
8484

Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
using Flow.Launcher.Plugin.Explorer.Search;
22
using Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks;
3-
using Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption;
43
using System;
54
using System.Collections.Generic;
6-
using System.IO;
75

86
namespace Flow.Launcher.Plugin.Explorer
97
{
@@ -25,13 +23,15 @@ public class Settings
2523

2624
public string FileContentSearchActionKeyword { get; set; } = Constants.DefaultContentSearchActionKeyword;
2725

26+
public bool FileContentSearchKeywordEnabled { get; set; } = true;
27+
2828
public string PathSearchActionKeyword { get; set; } = Query.GlobalPluginWildcardSign;
2929

3030
public bool PathSearchKeywordEnabled { get; set; }
3131

3232
public string IndexSearchActionKeyword { get; set; } = Query.GlobalPluginWildcardSign;
3333

34-
public bool IndexOnlySearchKeywordEnabled { get; set; }
34+
public bool IndexSearchKeywordEnabled { get; set; }
3535

3636
public bool WarnWindowsSearchServiceOff { get; set; } = true;
3737

@@ -48,7 +48,8 @@ internal enum ActionKeyword
4848
ActionKeyword.SearchActionKeyword => SearchActionKeyword,
4949
ActionKeyword.PathSearchActionKeyword => PathSearchActionKeyword,
5050
ActionKeyword.FileContentSearchActionKeyword => FileContentSearchActionKeyword,
51-
ActionKeyword.IndexSearchActionKeyword => IndexSearchActionKeyword
51+
ActionKeyword.IndexSearchActionKeyword => IndexSearchActionKeyword,
52+
_ => throw new ArgumentOutOfRangeException(nameof(actionKeyword), actionKeyword, "ActionKeyWord property not found")
5253
};
5354

5455
internal void SetActionKeyword(ActionKeyword actionKeyword, string keyword) => _ = actionKeyword switch
@@ -57,23 +58,25 @@ internal enum ActionKeyword
5758
ActionKeyword.PathSearchActionKeyword => PathSearchActionKeyword = keyword,
5859
ActionKeyword.FileContentSearchActionKeyword => FileContentSearchActionKeyword = keyword,
5960
ActionKeyword.IndexSearchActionKeyword => IndexSearchActionKeyword = keyword,
60-
_ => throw new ArgumentOutOfRangeException(nameof(actionKeyword), actionKeyword, "Unexpected property")
61+
_ => throw new ArgumentOutOfRangeException(nameof(actionKeyword), actionKeyword, "ActionKeyWord property not found")
6162
};
6263

63-
internal bool? GetActionKeywordEnabled(ActionKeyword actionKeyword) => actionKeyword switch
64+
internal bool GetActionKeywordEnabled(ActionKeyword actionKeyword) => actionKeyword switch
6465
{
6566
ActionKeyword.SearchActionKeyword => SearchActionKeywordEnabled,
6667
ActionKeyword.PathSearchActionKeyword => PathSearchKeywordEnabled,
67-
ActionKeyword.IndexSearchActionKeyword => IndexOnlySearchKeywordEnabled,
68-
_ => null
68+
ActionKeyword.IndexSearchActionKeyword => IndexSearchKeywordEnabled,
69+
ActionKeyword.FileContentSearchActionKeyword => FileContentSearchKeywordEnabled,
70+
_ => throw new ArgumentOutOfRangeException(nameof(actionKeyword), actionKeyword, "ActionKeyword enabled status not defined")
6971
};
7072

7173
internal void SetActionKeywordEnabled(ActionKeyword actionKeyword, bool enable) => _ = actionKeyword switch
7274
{
7375
ActionKeyword.SearchActionKeyword => SearchActionKeywordEnabled = enable,
7476
ActionKeyword.PathSearchActionKeyword => PathSearchKeywordEnabled = enable,
75-
ActionKeyword.IndexSearchActionKeyword => IndexOnlySearchKeywordEnabled = enable,
76-
_ => throw new ArgumentOutOfRangeException(nameof(actionKeyword), actionKeyword, "Unexpected property")
77+
ActionKeyword.IndexSearchActionKeyword => IndexSearchKeywordEnabled = enable,
78+
ActionKeyword.FileContentSearchActionKeyword => FileContentSearchKeywordEnabled = enable,
79+
_ => throw new ArgumentOutOfRangeException(nameof(actionKeyword), actionKeyword, "ActionKeyword enabled status not defined")
7780
};
7881
}
7982
}

Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030
<CheckBox Name="ChkActionKeywordEnabled" ToolTip="{DynamicResource plugin_explorer_actionkeyword_enabled_tooltip}"
3131
Margin="10" Grid.Row="0" Grid.Column="2" Content="{DynamicResource plugin_explorer_actionkeyword_enabled}"
3232
Width="auto"
33-
VerticalAlignment="Center" IsChecked="{Binding Enabled}"
34-
Visibility="{Binding Visible}"/>
33+
VerticalAlignment="Center" IsChecked="{Binding Enabled}" />
3534
<Button Name="DownButton"
3635
Click="OnDoneButtonClick" Grid.Row="1" Grid.Column="2"
3736
Margin="10 0 10 0" Width="80" Height="35"

Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml.cs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,18 @@ public partial class ActionKeywordSetting : Window
1919

2020
public string ActionKeyword
2121
{
22-
get => _actionKeyword;
22+
get => actionKeyword;
2323
set
2424
{
2525
// Set Enable to be true if user change ActionKeyword
26-
if (Enabled is not null)
27-
Enabled = true;
28-
_actionKeyword = value;
26+
Enabled = true;
27+
actionKeyword = value;
2928
}
3029
}
3130

32-
public bool? Enabled { get; set; }
31+
public bool Enabled { get; set; }
3332

34-
private string _actionKeyword;
35-
36-
public Visibility Visible =>
37-
CurrentActionKeyword.Enabled is not null ? Visibility.Visible : Visibility.Collapsed;
33+
private string actionKeyword;
3834

3935
public ActionKeywordSetting(SettingsViewModel settingsViewModel,
4036
ActionKeywordView selectedActionKeyword)
@@ -74,8 +70,7 @@ private void OnDoneButtonClick(object sender, RoutedEventArgs e)
7470

7571
var oldActionKeyword = CurrentActionKeyword.Keyword;
7672

77-
// == because of nullable
78-
if (Enabled == false || !settingsViewModel.IsActionKeywordAlreadyAssigned(ActionKeyword))
73+
if (!Enabled || !settingsViewModel.IsActionKeywordAlreadyAssigned(ActionKeyword))
7974
{
8075
// Update View Data
8176
CurrentActionKeyword.Keyword = Enabled == true ? ActionKeyword : Query.GlobalPluginWildcardSign;
@@ -84,7 +79,7 @@ private void OnDoneButtonClick(object sender, RoutedEventArgs e)
8479
switch (Enabled)
8580
{
8681
// reset to global so it does not take up an action keyword when disabled
87-
// not for null Enable plugin
82+
// not for null Enable plugin
8883
case false when oldActionKeyword != Query.GlobalPluginWildcardSign:
8984
settingsViewModel.UpdateActionKeyword(CurrentActionKeyword.KeywordProperty,
9085
Query.GlobalPluginWildcardSign, oldActionKeyword);

Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ internal ActionKeywordView(Settings.ActionKeyword actionKeyword, string descript
325325
}
326326

327327
public string Description { get; private init; }
328-
public string Color => Enabled ?? true ? "Black" : "Gray";
328+
public string Color => Enabled ? "Black" : "Gray";
329329

330330
internal Settings.ActionKeyword KeywordProperty { get; }
331331

@@ -335,11 +335,10 @@ public string Keyword
335335
set => _settings.SetActionKeyword(KeywordProperty, value);
336336
}
337337

338-
public bool? Enabled
338+
public bool Enabled
339339
{
340340
get => _settings.GetActionKeywordEnabled(KeywordProperty);
341-
set => _settings.SetActionKeywordEnabled(KeywordProperty,
342-
value ?? throw new ArgumentException("Unexpected null value"));
341+
set => _settings.SetActionKeywordEnabled(KeywordProperty, value);
343342
}
344343
}
345344
}

Plugins/Flow.Launcher.Plugin.Explorer/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"Name": "Explorer",
1010
"Description": "Search and manage files and folders. Explorer utilises Windows Index Search",
1111
"Author": "Jeremy Wu",
12-
"Version": "1.8.4",
12+
"Version": "1.8.5",
1313
"Language": "csharp",
1414
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
1515
"ExecuteFileName": "Flow.Launcher.Plugin.Explorer.dll",

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: '1.8.2.{build}'
1+
version: '1.8.3.{build}'
22

33
init:
44
- ps: |
@@ -79,5 +79,5 @@ on_success:
7979
if ($env:APPVEYOR_REPO_BRANCH -eq "master" -and $env:APPVEYOR_REPO_TAG -eq "true")
8080
{
8181
iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
82-
.\wingetcreate.exe update Flow-Launcher.Flow-Launcher -s true -u https://github.com/Flow-Launcher/Flow.Launcher/releases/download/v$env:flowVersion/Flow-Launcher-v$env:flowVersion.exe -v $env:flowVersion -t $env:winget_token
82+
.\wingetcreate.exe update Flow-Launcher.Flow-Launcher -s true -u https://github.com/Flow-Launcher/Flow.Launcher/releases/download/v$env:flowVersion/Flow-Launcher-Setup.exe -v $env:flowVersion -t $env:winget_token
8383
}

0 commit comments

Comments
 (0)