Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
0bcd7f83
Commit
0bcd7f83
authored
Mar 18, 2021
by
Waqar Ahmed
Committed by
Kåre Särs
Mar 18, 2021
Browse files
set values in UI directly
Signed-off-by:
Waqar Ahmed
<
waqar.17a@gmail.com
>
parent
864a16e2
Changes
2
Hide whitespace changes
Inline
Side-by-side
addons/search/plugin_search.cpp
View file @
0bcd7f83
...
...
@@ -221,7 +221,7 @@ QObject *KatePluginSearch::createView(KTextEditor::MainWindow *mainWindow)
connect
(
m_searchCommand
,
&
KateSearchCommand
::
setCurrentFolder
,
view
,
&
KatePluginSearchView
::
setCurrentFolder
);
connect
(
m_searchCommand
,
&
KateSearchCommand
::
setSearchString
,
view
,
&
KatePluginSearchView
::
setSearchString
);
connect
(
m_searchCommand
,
&
KateSearchCommand
::
startSearch
,
view
,
&
KatePluginSearchView
::
startSearch
);
connect
(
m_searchCommand
,
&
KateSearchCommand
::
setProjectRegexSearch
,
view
,
&
KatePluginSearchView
::
setPr
eg
Search
);
connect
(
m_searchCommand
,
&
KateSearchCommand
::
setProjectRegexSearch
,
view
,
&
KatePluginSearchView
::
setPr
ojectRegex
Search
);
connect
(
m_searchCommand
,
SIGNAL
(
newTab
()),
view
,
SLOT
(
addTab
()));
connect
(
view
,
&
KatePluginSearchView
::
searchBusy
,
m_searchCommand
,
&
KateSearchCommand
::
setBusy
);
...
...
@@ -979,7 +979,7 @@ void KatePluginSearchView::startSearch()
QRegularExpression
::
PatternOptions
patternOptions
=
(
m_ui
.
matchCase
->
isChecked
()
?
QRegularExpression
::
UseUnicodePropertiesOption
:
QRegularExpression
::
UseUnicodePropertiesOption
|
QRegularExpression
::
CaseInsensitiveOption
);
QString
pattern
=
(
m_ui
.
useRegExp
->
isChecked
()
||
m_isPreg
?
currentSearchText
:
QRegularExpression
::
escape
(
currentSearchText
));
QString
pattern
=
(
m_ui
.
useRegExp
->
isChecked
()
?
currentSearchText
:
QRegularExpression
::
escape
(
currentSearchText
));
QRegularExpression
reg
(
pattern
,
patternOptions
);
if
(
!
reg
.
isValid
())
{
...
...
@@ -993,8 +993,8 @@ void KatePluginSearchView::startSearch()
updateViewColors
();
m_curResults
->
regExp
=
reg
;
m_curResults
->
useRegExp
=
m_isPreg
?
true
:
m_ui
.
useRegExp
->
isChecked
();
m_curResults
->
matchCase
=
m_isPreg
?
false
:
m_ui
.
matchCase
->
isChecked
();
m_curResults
->
useRegExp
=
m_ui
.
useRegExp
->
isChecked
();
m_curResults
->
matchCase
=
m_ui
.
matchCase
->
isChecked
();
m_curResults
->
searchPlaceIndex
=
m_ui
.
searchPlaceCombo
->
currentIndex
();
m_ui
.
newTabButton
->
setDisabled
(
true
);
...
...
@@ -1262,8 +1262,6 @@ void KatePluginSearchView::searchDone()
m_searchJustOpened
=
false
;
updateMatchMarks
();
// unset preg command mode
m_isPreg
=
false
;
// qDebug() << "done:" << s_timer.elapsed();
}
...
...
@@ -1584,12 +1582,6 @@ void KatePluginSearchView::expandResults()
return
;
}
// preg command? => expand all
if
(
m_isPreg
)
{
m_curResults
->
treeView
->
expandAll
();
return
;
}
// we expand recursively if we either are told so or we have just one toplevel match item
QModelIndex
rootItem
=
m_curResults
->
matchModel
.
index
(
0
,
0
);
if
((
m_ui
.
expandResults
->
isChecked
()
&&
m_curResults
->
matchModel
.
rowCount
(
rootItem
)
<
200
)
||
m_curResults
->
matchModel
.
rowCount
(
rootItem
)
==
1
)
{
...
...
@@ -1806,9 +1798,11 @@ void KatePluginSearchView::goToPreviousMatch()
}
}
void
KatePluginSearchView
::
setPr
eg
Search
()
void
KatePluginSearchView
::
setPr
ojectRegex
Search
()
{
m_isPreg
=
true
;
m_ui
.
expandResults
->
setChecked
(
true
);
m_ui
.
useRegExp
->
setChecked
(
true
);
m_ui
.
matchCase
->
setChecked
(
true
);
}
void
KatePluginSearchView
::
readSessionConfig
(
const
KConfigGroup
&
cg
)
...
...
addons/search/plugin_search.h
View file @
0bcd7f83
...
...
@@ -107,7 +107,7 @@ public Q_SLOTS:
void
setSearchPlace
(
int
place
);
void
goToNextMatch
();
void
goToPreviousMatch
();
void
setPr
eg
Search
();
void
setPr
ojectRegex
Search
();
private:
enum
CopyResultType
{
AllExpanded
,
All
};
...
...
@@ -205,7 +205,6 @@ private:
int
m_projectSearchPlaceIndex
=
0
;
bool
m_isSearchAsYouType
=
false
;
bool
m_isVerticalLayout
=
false
;
bool
m_isPreg
=
false
;
/* ci-regex search via preg command with auto expand */
QString
m_resultBaseDir
;
QVector
<
KTextEditor
::
MovingRange
*>
m_matchRanges
;
QTimer
m_changeTimer
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment