Commit 06a884ec authored by Waqar Ahmed's avatar Waqar Ahmed Committed by Christoph Cullmann
Browse files

search: Make file names more consistent

parent 1d1df19c
Pipeline #139853 passed with stage
in 4 minutes and 57 seconds
......@@ -35,10 +35,10 @@ target_sources(
MatchModel.cpp
MatchProxyModel.cpp
SearchDiskFiles.cpp
htmldelegate.cpp
SearchResultsDelegate.cpp
plugin.qrc
plugin_search.cpp
search_open_files.cpp
SearchPlugin.cpp
SearchOpenFiles.cpp
Results.cpp
ResultsTreeView.cpp
)
......
......@@ -5,7 +5,7 @@
*/
#include "MatchExportDialog.h"
#include "plugin_search.h"
#include "SearchPlugin.h"
#include <QAction>
#include <QMenu>
......
......@@ -7,7 +7,7 @@
#include "Results.h"
#include "MatchProxyModel.h"
#include "htmldelegate.h"
#include "SearchResultsDelegate.h"
#include <KSyntaxHighlighting/Theme>
#include <KTextEditor/Editor>
......@@ -17,7 +17,7 @@ Results::Results(QWidget *parent)
{
setupUi(this);
treeView->setItemDelegate(new SPHtmlDelegate(treeView));
treeView->setItemDelegate(new SearchResultsDelegate(treeView));
MatchProxyModel *proxy = new MatchProxyModel(this);
proxy->setSourceModel(&matchModel);
......
......@@ -4,7 +4,7 @@
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include "search_open_files.h"
#include "SearchOpenFiles.h"
SearchOpenFiles::SearchOpenFiles(QObject *parent)
: QObject(parent)
......
......@@ -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;
......@@ -27,7 +27,7 @@
#include "FolderFilesList.h"
#include "MatchModel.h"
#include "SearchDiskFiles.h"
#include "search_open_files.h"
#include "SearchOpenFiles.h"
class KateSearchCommand;
class Results;
......
......@@ -4,7 +4,7 @@
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include "htmldelegate.h"
#include "SearchResultsDelegate.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;
SPHtmlDelegate::SPHtmlDelegate(QObject *parent)
SearchResultsDelegate::SearchResultsDelegate(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 SPHtmlDelegate::paintMatchItem(QPainter *p, const QStyleOptionViewItem &opt, const QModelIndex &index) const
void SearchResultsDelegate::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 SPHtmlDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
void SearchResultsDelegate::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 SPHtmlDelegate::sizeHint(const QStyleOptionViewItem &opt, const QModelIndex &index) const
QSize SearchResultsDelegate::sizeHint(const QStyleOptionViewItem &opt, const QModelIndex &index) const
{
QSize s = QStyledItemDelegate::sizeHint(opt, index);
QFontMetrics fm(m_font);
......
......@@ -10,12 +10,12 @@
#include <QFont>
#include <QStyledItemDelegate>
class SPHtmlDelegate : public QStyledItemDelegate
class SearchResultsDelegate : public QStyledItemDelegate
{
Q_OBJECT
public:
explicit SPHtmlDelegate(QObject *parent);
explicit SearchResultsDelegate(QObject *parent);
void paint(QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const override;
QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const override;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment