Skip to content
GitLab
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
ee29b74d
Commit
ee29b74d
authored
Mar 07, 2022
by
Alexander Neundorf
Committed by
Christoph Cullmann
Mar 07, 2022
Browse files
Search&Replace: add "Role" suffix to "MatchItem" role
So it is consistent with all the other roles.
parent
ebff93e1
Pipeline
#146556
passed with stage
in 5 minutes and 4 seconds
Changes
3
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
addons/search/MatchModel.cpp
View file @
ee29b74d
...
...
@@ -1008,7 +1008,7 @@ QVariant MatchModel::data(const QModelIndex &index, int role) const
return
match
.
replaceText
;
case
PlainTextRole
:
return
matchToPlainText
(
match
);
case
MatchItem
:
case
MatchItem
Role
:
return
QVariant
::
fromValue
(
match
);
case
LastMatchedRangeInFileRole
:
qWarning
()
<<
"Requested last matched line from a match item instead of file item1"
;
...
...
addons/search/MatchModel.h
View file @
ee29b74d
...
...
@@ -60,7 +60,7 @@ public:
ReplacedRole
,
ReplaceTextRole
,
PlainTextRole
,
MatchItem
,
MatchItem
Role
,
LastMatchedRangeInFileRole
,
};
Q_ENUM
(
MatchDataRoles
)
...
...
addons/search/SearchResultsDelegate.cpp
View file @
ee29b74d
...
...
@@ -58,7 +58,7 @@ static int lineNumAreaWidth(const QModelIndex &index, const QFontMetrics &fm)
void
SearchResultsDelegate
::
paintMatchItem
(
QPainter
*
p
,
const
QStyleOptionViewItem
&
opt
,
const
QModelIndex
&
index
)
const
{
const
KateSearchMatch
match
=
index
.
data
(
MatchModel
::
MatchItem
).
value
<
KateSearchMatch
>
();
const
KateSearchMatch
match
=
index
.
data
(
MatchModel
::
MatchItem
Role
).
value
<
KateSearchMatch
>
();
const
int
line
=
match
.
range
.
start
().
line
()
+
1
;
const
int
col
=
match
.
range
.
start
().
column
()
+
1
;
const
QString
lineCol
=
QStringLiteral
(
"%1:%2"
).
arg
(
line
).
arg
(
col
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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