mirror of
https://github.com/OpenMW/openmw.git
synced 2026-02-01 03:48:27 +00:00
Validate regex patterns in global search
This commit is contained in:
parent
851f69609f
commit
ca1dbb7437
1 changed files with 10 additions and 2 deletions
|
|
@ -17,13 +17,21 @@ void CSVTools::SearchBox::updateSearchButton()
|
|||
switch (mMode.currentIndex())
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
|
||||
mSearch.setEnabled(!mText.text().isEmpty());
|
||||
break;
|
||||
|
||||
case 1:
|
||||
case 3:
|
||||
{
|
||||
if (mText.text().isEmpty())
|
||||
mSearch.setEnabled(false);
|
||||
else
|
||||
mSearch.setEnabled(QRegularExpression(mText.text()).isValid());
|
||||
break;
|
||||
}
|
||||
|
||||
case 4:
|
||||
|
||||
mSearch.setEnabled(true);
|
||||
|
|
|
|||
Loading…
Reference in a new issue