Changeset View
Changeset View
Standalone View
Standalone View
src/search/katesearchbar.cpp
Show First 20 Lines • Show All 177 Lines • ▼ Show 20 Line(s) | 160 | { | |||
---|---|---|---|---|---|
178 | QWidget *const widget = centralWidget(); | 178 | QWidget *const widget = centralWidget(); | ||
179 | widget->setLayout(m_layout); | 179 | widget->setLayout(m_layout); | ||
180 | m_layout->setContentsMargins(0, 0, 0, 0); | 180 | m_layout->setContentsMargins(0, 0, 0, 0); | ||
181 | 181 | | |||
182 | // allow to have small size, for e.g. Kile | 182 | // allow to have small size, for e.g. Kile | ||
183 | setMinimumWidth(100); | 183 | setMinimumWidth(100); | ||
184 | 184 | | |||
185 | // Copy global to local config backup | 185 | // Copy global to local config backup | ||
186 | const long searchFlags = m_config->searchFlags(); | 186 | const auto searchFlags = m_config->searchFlags(); | ||
187 | m_incHighlightAll = (searchFlags & KateViewConfig::IncHighlightAll) != 0; | 187 | m_incHighlightAll = (searchFlags & KateViewConfig::IncHighlightAll) != 0; | ||
188 | m_incFromCursor = (searchFlags & KateViewConfig::IncFromCursor) != 0; | 188 | m_incFromCursor = (searchFlags & KateViewConfig::IncFromCursor) != 0; | ||
189 | m_incMatchCase = (searchFlags & KateViewConfig::IncMatchCase) != 0; | 189 | m_incMatchCase = (searchFlags & KateViewConfig::IncMatchCase) != 0; | ||
190 | m_powerMatchCase = (searchFlags & KateViewConfig::PowerMatchCase) != 0; | 190 | m_powerMatchCase = (searchFlags & KateViewConfig::PowerMatchCase) != 0; | ||
191 | m_powerFromCursor = (searchFlags & KateViewConfig::PowerFromCursor) != 0; | 191 | m_powerFromCursor = (searchFlags & KateViewConfig::PowerFromCursor) != 0; | ||
192 | m_powerHighlightAll = (searchFlags & KateViewConfig::PowerHighlightAll) != 0; | 192 | m_powerHighlightAll = (searchFlags & KateViewConfig::PowerHighlightAll) != 0; | ||
193 | m_powerMode = ((searchFlags & KateViewConfig::PowerModeRegularExpression) != 0) | 193 | m_powerMode = ((searchFlags & KateViewConfig::PowerModeRegularExpression) != 0) | ||
194 | ? MODE_REGEX | 194 | ? MODE_REGEX | ||
▲ Show 20 Lines • Show All 540 Lines • ▼ Show 20 Line(s) | 733 | if (ofPower) { | |||
735 | m_powerMode = m_powerUi->searchMode->currentIndex(); | 735 | m_powerMode = m_powerUi->searchMode->currentIndex(); | ||
736 | } else { | 736 | } else { | ||
737 | m_incMatchCase = m_incUi->matchCase->isChecked(); | 737 | m_incMatchCase = m_incUi->matchCase->isChecked(); | ||
738 | } | 738 | } | ||
739 | } | 739 | } | ||
740 | 740 | | |||
741 | void KateSearchBar::sendConfig() | 741 | void KateSearchBar::sendConfig() | ||
742 | { | 742 | { | ||
743 | const long pastFlags = m_config->searchFlags(); | 743 | const auto pastFlags = m_config->searchFlags(); | ||
744 | long futureFlags = pastFlags; | 744 | auto futureFlags = pastFlags; | ||
745 | 745 | | |||
746 | if (m_powerUi != nullptr) { | 746 | if (m_powerUi != nullptr) { | ||
747 | const bool OF_POWER = true; | 747 | const bool OF_POWER = true; | ||
748 | backupConfig(OF_POWER); | 748 | backupConfig(OF_POWER); | ||
749 | 749 | | |||
750 | // Update power search flags only | 750 | // Update power search flags only | ||
751 | const long incFlagsOnly = pastFlags | 751 | const auto incFlagsOnly = pastFlags | ||
752 | & (KateViewConfig::IncHighlightAll | 752 | & (KateViewConfig::IncHighlightAll | ||
753 | | KateViewConfig::IncFromCursor | 753 | | KateViewConfig::IncFromCursor | ||
754 | | KateViewConfig::IncMatchCase); | 754 | | KateViewConfig::IncMatchCase); | ||
755 | 755 | | |||
756 | futureFlags = incFlagsOnly | 756 | futureFlags = incFlagsOnly | ||
757 | | (m_powerMatchCase ? KateViewConfig::PowerMatchCase : 0) | 757 | | (m_powerMatchCase ? KateViewConfig::PowerMatchCase : 0) | ||
758 | | (m_powerFromCursor ? KateViewConfig::PowerFromCursor : 0) | 758 | | (m_powerFromCursor ? KateViewConfig::PowerFromCursor : 0) | ||
759 | | (m_powerHighlightAll ? KateViewConfig::PowerHighlightAll : 0) | 759 | | (m_powerHighlightAll ? KateViewConfig::PowerHighlightAll : 0) | ||
760 | | ((m_powerMode == MODE_REGEX) | 760 | | ((m_powerMode == MODE_REGEX) | ||
761 | ? KateViewConfig::PowerModeRegularExpression | 761 | ? KateViewConfig::PowerModeRegularExpression | ||
762 | : ((m_powerMode == MODE_ESCAPE_SEQUENCES) | 762 | : ((m_powerMode == MODE_ESCAPE_SEQUENCES) | ||
763 | ? KateViewConfig::PowerModeEscapeSequences | 763 | ? KateViewConfig::PowerModeEscapeSequences | ||
764 | : ((m_powerMode == MODE_WHOLE_WORDS) | 764 | : ((m_powerMode == MODE_WHOLE_WORDS) | ||
765 | ? KateViewConfig::PowerModeWholeWords | 765 | ? KateViewConfig::PowerModeWholeWords | ||
766 | : KateViewConfig::PowerModePlainText))); | 766 | : KateViewConfig::PowerModePlainText))); | ||
767 | 767 | | |||
768 | } else if (m_incUi != nullptr) { | 768 | } else if (m_incUi != nullptr) { | ||
769 | const bool OF_INCREMENTAL = false; | 769 | const bool OF_INCREMENTAL = false; | ||
770 | backupConfig(OF_INCREMENTAL); | 770 | backupConfig(OF_INCREMENTAL); | ||
771 | 771 | | |||
772 | // Update incremental search flags only | 772 | // Update incremental search flags only | ||
773 | const long powerFlagsOnly = pastFlags | 773 | const auto powerFlagsOnly = pastFlags | ||
774 | & (KateViewConfig::PowerMatchCase | 774 | & (KateViewConfig::PowerMatchCase | ||
775 | | KateViewConfig::PowerFromCursor | 775 | | KateViewConfig::PowerFromCursor | ||
776 | | KateViewConfig::PowerHighlightAll | 776 | | KateViewConfig::PowerHighlightAll | ||
777 | | KateViewConfig::PowerModeRegularExpression | 777 | | KateViewConfig::PowerModeRegularExpression | ||
778 | | KateViewConfig::PowerModeEscapeSequences | 778 | | KateViewConfig::PowerModeEscapeSequences | ||
779 | | KateViewConfig::PowerModeWholeWords | 779 | | KateViewConfig::PowerModeWholeWords | ||
780 | | KateViewConfig::PowerModePlainText); | 780 | | KateViewConfig::PowerModePlainText); | ||
781 | 781 | | |||
▲ Show 20 Lines • Show All 959 Lines • Show Last 20 Lines |