Changeset View
Changeset View
Standalone View
Standalone View
addons/search/plugin_search.cpp
Show First 20 Lines • Show All 104 Lines • ▼ Show 20 Line(s) | 91 | bool operator<(const QTreeWidgetItem &other) const override { | |||
---|---|---|---|---|---|
105 | int sepCount = data(0, ReplaceMatches::FileUrlRole).toString().count(QDir::separator()); | 105 | int sepCount = data(0, ReplaceMatches::FileUrlRole).toString().count(QDir::separator()); | ||
106 | int oSepCount = other.data(0, ReplaceMatches::FileUrlRole).toString().count(QDir::separator()); | 106 | int oSepCount = other.data(0, ReplaceMatches::FileUrlRole).toString().count(QDir::separator()); | ||
107 | if (sepCount < oSepCount) return true; | 107 | if (sepCount < oSepCount) return true; | ||
108 | if (sepCount > oSepCount) return false; | 108 | if (sepCount > oSepCount) return false; | ||
109 | return data(0, ReplaceMatches::FileUrlRole).toString().toLower() < other.data(0, ReplaceMatches::FileUrlRole).toString().toLower(); | 109 | return data(0, ReplaceMatches::FileUrlRole).toString().toLower() < other.data(0, ReplaceMatches::FileUrlRole).toString().toLower(); | ||
110 | } | 110 | } | ||
111 | }; | 111 | }; | ||
112 | 112 | | |||
113 | Results::Results(QWidget *parent): QWidget(parent), matches(0), useRegExp(false), searchPlaceIndex(0) | 113 | Results::Results(QWidget *parent): QWidget(parent) | ||
114 | { | 114 | { | ||
115 | setupUi(this); | 115 | setupUi(this); | ||
116 | 116 | | |||
117 | tree->setItemDelegate(new SPHtmlDelegate(tree)); | 117 | tree->setItemDelegate(new SPHtmlDelegate(tree)); | ||
118 | } | 118 | } | ||
119 | 119 | | |||
120 | 120 | | |||
121 | K_PLUGIN_FACTORY_WITH_JSON (KatePluginSearchFactory, "katesearch.json", registerPlugin<KatePluginSearch>();) | 121 | K_PLUGIN_FACTORY_WITH_JSON (KatePluginSearchFactory, "katesearch.json", registerPlugin<KatePluginSearch>();) | ||
122 | 122 | | |||
123 | KatePluginSearch::KatePluginSearch(QObject* parent, const QList<QVariant>&) | 123 | KatePluginSearch::KatePluginSearch(QObject* parent, const QList<QVariant>&) | ||
124 | : KTextEditor::Plugin (parent), | 124 | : KTextEditor::Plugin (parent) | ||
125 | m_searchCommand(nullptr) | | |||
126 | { | 125 | { | ||
127 | m_searchCommand = new KateSearchCommand(this); | 126 | m_searchCommand = new KateSearchCommand(this); | ||
128 | } | 127 | } | ||
129 | 128 | | |||
130 | KatePluginSearch::~KatePluginSearch() | 129 | KatePluginSearch::~KatePluginSearch() | ||
131 | { | 130 | { | ||
132 | delete m_searchCommand; | 131 | delete m_searchCommand; | ||
133 | } | 132 | } | ||
▲ Show 20 Lines • Show All 2171 Lines • Show Last 20 Lines |