Changeset View
Changeset View
Standalone View
Standalone View
src/search/katesearchbar.cpp
Show All 40 Lines | |||||
41 | #include <KMessageBox> | 41 | #include <KMessageBox> | ||
42 | #include <KStandardAction> | 42 | #include <KStandardAction> | ||
43 | #include <KLocalizedString> | 43 | #include <KLocalizedString> | ||
44 | 44 | | |||
45 | #include <QVBoxLayout> | 45 | #include <QVBoxLayout> | ||
46 | #include <QCheckBox> | 46 | #include <QCheckBox> | ||
47 | #include <QComboBox> | 47 | #include <QComboBox> | ||
48 | #include <QCompleter> | 48 | #include <QCompleter> | ||
49 | #include <QRegularExpression> | ||||
49 | #include <QShortcut> | 50 | #include <QShortcut> | ||
50 | #include <QStringListModel> | 51 | #include <QStringListModel> | ||
51 | #include <QTime> | 52 | #include <QTime> | ||
52 | 53 | | |||
53 | #include <vector> | 54 | #include <vector> | ||
54 | 55 | | |||
55 | // Turn debug messages on/off here | 56 | // Turn debug messages on/off here | ||
56 | // #define FAST_DEBUG_ENABLE | 57 | // #define FAST_DEBUG_ENABLE | ||
▲ Show 20 Lines • Show All 635 Lines • ▼ Show 20 Line(s) | |||||
692 | 693 | | |||
693 | bool KateSearchBar::isPatternValid() const | 694 | bool KateSearchBar::isPatternValid() const | ||
694 | { | 695 | { | ||
695 | if (searchPattern().isEmpty()) { | 696 | if (searchPattern().isEmpty()) { | ||
696 | return false; | 697 | return false; | ||
697 | } | 698 | } | ||
698 | 699 | | |||
699 | return searchOptions().testFlag(WholeWords) ? searchPattern().trimmed() == searchPattern() : | 700 | return searchOptions().testFlag(WholeWords) ? searchPattern().trimmed() == searchPattern() : | ||
700 | searchOptions().testFlag(Regex) ? QRegExp(searchPattern()).isValid() : | 701 | searchOptions().testFlag(Regex) ? QRegularExpression(searchPattern()).isValid() : | ||
701 | true; | 702 | true; | ||
702 | } | 703 | } | ||
703 | 704 | | |||
704 | void KateSearchBar::givePatternFeedback() | 705 | void KateSearchBar::givePatternFeedback() | ||
705 | { | 706 | { | ||
706 | // Enable/disable next/prev and replace next/all | 707 | // Enable/disable next/prev and replace next/all | ||
707 | m_powerUi->findNext->setEnabled(isPatternValid()); | 708 | m_powerUi->findNext->setEnabled(isPatternValid()); | ||
708 | m_powerUi->findPrev->setEnabled(isPatternValid()); | 709 | m_powerUi->findPrev->setEnabled(isPatternValid()); | ||
▲ Show 20 Lines • Show All 1032 Lines • Show Last 20 Lines |