mirror of
https://github.com/ShareX/ShareX.git
synced 2024-06-28 11:10:23 +12:00
fixed #713: History host filter error
This commit is contained in:
parent
27f42f153f
commit
44e391d333
|
@ -112,36 +112,46 @@ private HistoryItem[] ApplyFilters(HistoryItem[] historyItems)
|
|||
{
|
||||
string type = cbTypeFilterSelection.Text;
|
||||
|
||||
result = result.Where(x => x.Type == type);
|
||||
if (!string.IsNullOrEmpty(type))
|
||||
{
|
||||
result = result.Where(x => !string.IsNullOrEmpty(x.Type) && x.Type == type);
|
||||
}
|
||||
}
|
||||
|
||||
if (cbHostFilter.Checked)
|
||||
{
|
||||
string host = txtHostFilter.Text;
|
||||
|
||||
result = result.Where(x => x.Host.IndexOf(host, StringComparison.InvariantCultureIgnoreCase) >= 0);
|
||||
if (!string.IsNullOrEmpty(host))
|
||||
{
|
||||
result = result.Where(x => !string.IsNullOrEmpty(x.Host) && x.Host.IndexOf(host, StringComparison.InvariantCultureIgnoreCase) >= 0);
|
||||
}
|
||||
}
|
||||
|
||||
string filenameFilter = txtFilenameFilter.Text;
|
||||
if (cbFilenameFilter.Checked && !string.IsNullOrEmpty(filenameFilter))
|
||||
if (cbFilenameFilter.Checked)
|
||||
{
|
||||
StringComparison rule = GetStringRule();
|
||||
string filenameFilter = txtFilenameFilter.Text;
|
||||
|
||||
if (cbFilenameFilterMethod.SelectedIndex == 0) // Contains
|
||||
if (!string.IsNullOrEmpty(filenameFilter))
|
||||
{
|
||||
result = result.Where(x => x.Filename.IndexOf(filenameFilter, rule) >= 0);
|
||||
}
|
||||
else if (cbFilenameFilterMethod.SelectedIndex == 1) // Starts with
|
||||
{
|
||||
result = result.Where(x => x.Filename.StartsWith(filenameFilter, rule));
|
||||
}
|
||||
else if (cbFilenameFilterMethod.SelectedIndex == 2) // Ends with
|
||||
{
|
||||
result = result.Where(x => x.Filename.EndsWith(filenameFilter, rule));
|
||||
}
|
||||
else if (cbFilenameFilterMethod.SelectedIndex == 3) // Exact match
|
||||
{
|
||||
result = result.Where(x => x.Filename.Equals(filenameFilter, rule));
|
||||
StringComparison rule = GetStringRule();
|
||||
|
||||
if (cbFilenameFilterMethod.SelectedIndex == 0) // Contains
|
||||
{
|
||||
result = result.Where(x => x.Filename.IndexOf(filenameFilter, rule) >= 0);
|
||||
}
|
||||
else if (cbFilenameFilterMethod.SelectedIndex == 1) // Starts with
|
||||
{
|
||||
result = result.Where(x => x.Filename.StartsWith(filenameFilter, rule));
|
||||
}
|
||||
else if (cbFilenameFilterMethod.SelectedIndex == 2) // Ends with
|
||||
{
|
||||
result = result.Where(x => x.Filename.EndsWith(filenameFilter, rule));
|
||||
}
|
||||
else if (cbFilenameFilterMethod.SelectedIndex == 3) // Exact match
|
||||
{
|
||||
result = result.Where(x => x.Filename.Equals(filenameFilter, rule));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -73,6 +73,6 @@ Global
|
|||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
RESX_AutoCreateNewLanguageFiles = True
|
||||
RESX_AutoCreateNewLanguageFiles = False
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
Loading…
Reference in a new issue