Commit 9f6fb571 authored by David Jarvie's avatar David Jarvie
Browse files

Don't do the search if an invalid regular expression has been entered

parent af21aa5e
......@@ -41,6 +41,7 @@
#include <QCheckBox>
#include <QVBoxLayout>
#include <QGridLayout>
#include <QRegExp>
// KAlarm-specific options for Find dialog
enum {
......@@ -255,6 +256,8 @@ void Find::slotFind()
return;
mHistory = mDialog->findHistory(); // save search history so that it can be displayed again
mOptions = mDialog->options() & ~FIND_KALARM_OPTIONS;
if ((mOptions & KFind::RegularExpression) && !QRegExp(mDialog->pattern()).isValid())
return;
mOptions |= (mLive->isEnabled() && mLive->isChecked() ? FIND_LIVE : 0)
| (mArchived->isEnabled() && mArchived->isChecked() ? FIND_ARCHIVED : 0)
| (mMessageType->isEnabled() && mMessageType->isChecked() ? FIND_MESSAGE : 0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment