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
06a884ec
Commit
06a884ec
authored
Feb 18, 2022
by
Waqar Ahmed
Committed by
Christoph Cullmann
Feb 19, 2022
Browse files
search: Make file names more consistent
parent
1d1df19c
Pipeline
#139853
passed with stage
in 4 minutes and 57 seconds
Changes
9
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
addons/search/CMakeLists.txt
View file @
06a884ec
...
...
@@ -35,10 +35,10 @@ target_sources(
MatchModel.cpp
MatchProxyModel.cpp
SearchDiskFiles.cpp
htmld
elegate.cpp
SearchResultsD
elegate.cpp
plugin.qrc
plugin_search
.cpp
s
earch
_o
pen
_f
iles.cpp
SearchPlugin
.cpp
S
earch
O
pen
F
iles.cpp
Results.cpp
ResultsTreeView.cpp
)
...
...
addons/search/MatchExportDialog.cpp
View file @
06a884ec
...
...
@@ -5,7 +5,7 @@
*/
#include "MatchExportDialog.h"
#include "
plugin_search
.h"
#include "
SearchPlugin
.h"
#include <QAction>
#include <QMenu>
...
...
addons/search/Results.cpp
View file @
06a884ec
...
...
@@ -7,7 +7,7 @@
#include "Results.h"
#include "MatchProxyModel.h"
#include "
htmld
elegate.h"
#include "
SearchResultsD
elegate.h"
#include <KSyntaxHighlighting/Theme>
#include <KTextEditor/Editor>
...
...
@@ -17,7 +17,7 @@ Results::Results(QWidget *parent)
{
setupUi
(
this
);
treeView
->
setItemDelegate
(
new
S
PHtml
Delegate
(
treeView
));
treeView
->
setItemDelegate
(
new
S
earchResults
Delegate
(
treeView
));
MatchProxyModel
*
proxy
=
new
MatchProxyModel
(
this
);
proxy
->
setSourceModel
(
&
matchModel
);
...
...
addons/search/
s
earch
_o
pen
_f
iles.cpp
→
addons/search/
S
earch
O
pen
F
iles.cpp
View file @
06a884ec
...
...
@@ -4,7 +4,7 @@
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include "
s
earch
_o
pen
_f
iles.h"
#include "
S
earch
O
pen
F
iles.h"
SearchOpenFiles
::
SearchOpenFiles
(
QObject
*
parent
)
:
QObject
(
parent
)
...
...
addons/search/
s
earch
_o
pen
_f
iles.h
→
addons/search/
S
earch
O
pen
F
iles.h
View file @
06a884ec
File moved
addons/search/
plugin_search
.cpp
→
addons/search/
SearchPlugin
.cpp
View file @
06a884ec
...
...
@@ -5,7 +5,7 @@
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include "
plugin_search
.h"
#include "
SearchPlugin
.h"
#include "KateSearchCommand.h"
#include "MatchExportDialog.h"
#include "MatchProxyModel.h"
...
...
@@ -2362,6 +2362,6 @@ void KatePluginSearchView::slotProjectFileNameChanged()
}
}
#include "
plugin_search
.moc"
#include "
SearchPlugin
.moc"
// kate: space-indent on; indent-width 4; replace-tabs on;
addons/search/
plugin_search
.h
→
addons/search/
SearchPlugin
.h
View file @
06a884ec
...
...
@@ -27,7 +27,7 @@
#include "FolderFilesList.h"
#include "MatchModel.h"
#include "SearchDiskFiles.h"
#include "
s
earch
_o
pen
_f
iles.h"
#include "
S
earch
O
pen
F
iles.h"
class
KateSearchCommand
;
class
Results
;
...
...
addons/search/
htmld
elegate.cpp
→
addons/search/
SearchResultsD
elegate.cpp
View file @
06a884ec
...
...
@@ -4,7 +4,7 @@
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include "
htmld
elegate.h"
#include "
SearchResultsD
elegate.h"
#include "MatchModel.h"
#include <KLocalizedString>
...
...
@@ -24,7 +24,7 @@
// (which would not be the case with default QTextDocument margin)
static
const
int
s_ItemMargin
=
1
;
S
PHtmlDelegate
::
SPHtml
Delegate
(
QObject
*
parent
)
S
earchResultsDelegate
::
SearchResults
Delegate
(
QObject
*
parent
)
:
QStyledItemDelegate
(
parent
)
{
const
auto
e
=
KTextEditor
::
Editor
::
instance
();
...
...
@@ -54,7 +54,7 @@ static int lineNumAreaWidth(const QModelIndex &index, const QFontMetrics &fm)
return
fm
.
horizontalAdvance
(
lineCol
);
}
void
S
PHtml
Delegate
::
paintMatchItem
(
QPainter
*
p
,
const
QStyleOptionViewItem
&
opt
,
const
QModelIndex
&
index
)
const
void
S
earchResults
Delegate
::
paintMatchItem
(
QPainter
*
p
,
const
QStyleOptionViewItem
&
opt
,
const
QModelIndex
&
index
)
const
{
const
KateSearchMatch
match
=
index
.
data
(
MatchModel
::
MatchItem
).
value
<
KateSearchMatch
>
();
const
int
line
=
match
.
range
.
start
().
line
()
+
1
;
...
...
@@ -147,7 +147,7 @@ static bool isMatchItem(const QModelIndex &index)
return
index
.
parent
().
isValid
()
&&
index
.
parent
().
parent
().
isValid
();
}
void
S
PHtml
Delegate
::
paint
(
QPainter
*
painter
,
const
QStyleOptionViewItem
&
option
,
const
QModelIndex
&
index
)
const
void
S
earchResults
Delegate
::
paint
(
QPainter
*
painter
,
const
QStyleOptionViewItem
&
option
,
const
QModelIndex
&
index
)
const
{
if
(
!
index
.
isValid
())
{
QStyledItemDelegate
::
paint
(
painter
,
option
,
index
);
...
...
@@ -189,7 +189,7 @@ void SPHtmlDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option
}
}
QSize
S
PHtml
Delegate
::
sizeHint
(
const
QStyleOptionViewItem
&
opt
,
const
QModelIndex
&
index
)
const
QSize
S
earchResults
Delegate
::
sizeHint
(
const
QStyleOptionViewItem
&
opt
,
const
QModelIndex
&
index
)
const
{
QSize
s
=
QStyledItemDelegate
::
sizeHint
(
opt
,
index
);
QFontMetrics
fm
(
m_font
);
...
...
addons/search/
htmld
elegate.h
→
addons/search/
SearchResultsD
elegate.h
View file @
06a884ec
...
...
@@ -10,12 +10,12 @@
#include <QFont>
#include <QStyledItemDelegate>
class
S
PHtml
Delegate
:
public
QStyledItemDelegate
class
S
earchResults
Delegate
:
public
QStyledItemDelegate
{
Q_OBJECT
public:
explicit
S
PHtml
Delegate
(
QObject
*
parent
);
explicit
S
earchResults
Delegate
(
QObject
*
parent
);
void
paint
(
QPainter
*
,
const
QStyleOptionViewItem
&
,
const
QModelIndex
&
)
const
override
;
QSize
sizeHint
(
const
QStyleOptionViewItem
&
,
const
QModelIndex
&
)
const
override
;
...
...
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