Skip to content

Commit

Permalink
Fix an issue where "[F]" could be set as the file filter if no file f…
Browse files Browse the repository at this point in the history
…ilter was selected in the Filters dialog.
  • Loading branch information
sdottaka committed Nov 2, 2023
1 parent e1709e5 commit 64d0eed
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions Src/MainFrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2078,23 +2078,26 @@ void CMainFrame::OnToolsFilters()
{
String strNone = _("<None>");
String path = fileFiltersDlg.GetSelected();
if (path.find(strNone) != String::npos)
if (!path.empty())
{
// Don't overwrite mask we already have
if (!pGlobalFileFilter->IsUsingMask())
if (path.find(strNone) != String::npos)
{
String sFilter(_T("*.*"));
pGlobalFileFilter->SetFilter(sFilter);
// Don't overwrite mask we already have
if (!pGlobalFileFilter->IsUsingMask())
{
String sFilter(_T("*.*"));
pGlobalFileFilter->SetFilter(sFilter);
GetOptionsMgr()->SaveOption(OPT_FILEFILTER_CURRENT, sFilter);
}
}
else
{
pGlobalFileFilter->SetFileFilterPath(path);
pGlobalFileFilter->UseMask(false);
String sFilter = pGlobalFileFilter->GetFilterNameOrMask();
GetOptionsMgr()->SaveOption(OPT_FILEFILTER_CURRENT, sFilter);
}
}
else
{
pGlobalFileFilter->SetFileFilterPath(path);
pGlobalFileFilter->UseMask(false);
String sFilter = pGlobalFileFilter->GetFilterNameOrMask();
GetOptionsMgr()->SaveOption(OPT_FILEFILTER_CURRENT, sFilter);
}
bool linefiltersEnabled = lineFiltersDlg.m_bIgnoreRegExp;
GetOptionsMgr()->SaveOption(OPT_LINEFILTER_ENABLED, linefiltersEnabled);

Expand Down

0 comments on commit 64d0eed

Please sign in to comment.