Changeset View
Changeset View
Standalone View
Standalone View
addons/search/plugin_search.cpp
Show First 20 Lines • Show All 129 Lines • ▼ Show 20 Line(s) | |||||
130 | KatePluginSearch::~KatePluginSearch() | 130 | KatePluginSearch::~KatePluginSearch() | ||
131 | { | 131 | { | ||
132 | delete m_searchCommand; | 132 | delete m_searchCommand; | ||
133 | } | 133 | } | ||
134 | 134 | | |||
135 | QObject *KatePluginSearch::createView(KTextEditor::MainWindow *mainWindow) | 135 | QObject *KatePluginSearch::createView(KTextEditor::MainWindow *mainWindow) | ||
136 | { | 136 | { | ||
137 | KatePluginSearchView *view = new KatePluginSearchView(this, mainWindow, KTextEditor::Editor::instance()->application()); | 137 | KatePluginSearchView *view = new KatePluginSearchView(this, mainWindow, KTextEditor::Editor::instance()->application()); | ||
138 | connect(m_searchCommand, SIGNAL(setSearchPlace(int)), view, SLOT(setSearchPlace(int))); | 138 | connect(m_searchCommand, &KateSearchCommand::setSearchPlace, view, &KatePluginSearchView::setSearchPlace); | ||
139 | connect(m_searchCommand, SIGNAL(setCurrentFolder()), view, SLOT(setCurrentFolder())); | 139 | connect(m_searchCommand, &KateSearchCommand::setCurrentFolder, view, &KatePluginSearchView::setCurrentFolder); | ||
140 | connect(m_searchCommand, SIGNAL(setSearchString(QString)), view, SLOT(setSearchString(QString))); | 140 | connect(m_searchCommand, &KateSearchCommand::setSearchString, view, &KatePluginSearchView::setSearchString); | ||
141 | connect(m_searchCommand, SIGNAL(startSearch()), view, SLOT(startSearch())); | 141 | connect(m_searchCommand, &KateSearchCommand::startSearch, view, &KatePluginSearchView::startSearch); | ||
142 | connect(m_searchCommand, SIGNAL(newTab()), view, SLOT(addTab())); | 142 | connect(m_searchCommand, SIGNAL(newTab()), view, SLOT(addTab())); | ||
143 | | ||||
144 | return view; | 143 | return view; | ||
dhaumann: which is ok - just remove this comment. | |||||
145 | } | 144 | } | ||
146 | 145 | | |||
147 | 146 | | |||
148 | bool ContainerWidget::focusNextPrevChild (bool next) | 147 | bool ContainerWidget::focusNextPrevChild (bool next) | ||
149 | { | 148 | { | ||
150 | QWidget* fw = focusWidget(); | 149 | QWidget* fw = focusWidget(); | ||
151 | bool found = false; | 150 | bool found = false; | ||
152 | emit nextFocus(fw, &found, next); | 151 | emit nextFocus(fw, &found, next); | ||
▲ Show 20 Lines • Show All 78 Lines • ▼ Show 20 Line(s) | 226 | { | |||
231 | m_toolView = mainWin->createToolView (plugin, QStringLiteral("kate_plugin_katesearch"), | 230 | m_toolView = mainWin->createToolView (plugin, QStringLiteral("kate_plugin_katesearch"), | ||
232 | KTextEditor::MainWindow::Bottom, | 231 | KTextEditor::MainWindow::Bottom, | ||
233 | QIcon::fromTheme(QStringLiteral("edit-find")), | 232 | QIcon::fromTheme(QStringLiteral("edit-find")), | ||
234 | i18n("Search and Replace")); | 233 | i18n("Search and Replace")); | ||
235 | 234 | | |||
236 | ContainerWidget *container = new ContainerWidget(m_toolView); | 235 | ContainerWidget *container = new ContainerWidget(m_toolView); | ||
237 | m_ui.setupUi(container); | 236 | m_ui.setupUi(container); | ||
238 | container->setFocusProxy(m_ui.searchCombo); | 237 | container->setFocusProxy(m_ui.searchCombo); | ||
239 | connect(container, SIGNAL(nextFocus(QWidget*,bool*,bool)), this, SLOT(nextFocus(QWidget*,bool*,bool))); | 238 | connect(container, &ContainerWidget::nextFocus, this, &KatePluginSearchView::nextFocus); | ||
240 | 239 | | |||
241 | QAction *a = actionCollection()->addAction(QStringLiteral("search_in_files")); | 240 | QAction *a = actionCollection()->addAction(QStringLiteral("search_in_files")); | ||
242 | actionCollection()->setDefaultShortcut(a, QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_F)); | 241 | actionCollection()->setDefaultShortcut(a, QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_F)); | ||
243 | a->setText(i18n("Search in Files")); | 242 | a->setText(i18n("Search in Files")); | ||
244 | connect(a, SIGNAL(triggered(bool)), this, SLOT(openSearchView())); | 243 | connect(a, &QAction::triggered, this, &KatePluginSearchView::openSearchView); | ||
245 | 244 | | |||
246 | a = actionCollection()->addAction(QStringLiteral("search_in_files_new_tab")); | 245 | a = actionCollection()->addAction(QStringLiteral("search_in_files_new_tab")); | ||
247 | a->setText(i18n("Search in Files (in new tab)")); | 246 | a->setText(i18n("Search in Files (in new tab)")); | ||
248 | // first add tab, then open search view, since open search view switches to show the search options | 247 | // first add tab, then open search view, since open search view switches to show the search options | ||
249 | connect(a, SIGNAL(triggered(bool)), this, SLOT(addTab())); | 248 | connect(a, &QAction::triggered, this, &KatePluginSearchView::addTab); | ||
250 | connect(a, SIGNAL(triggered(bool)), this, SLOT(openSearchView())); | 249 | connect(a, &QAction::triggered, this, &KatePluginSearchView::openSearchView); | ||
251 | 250 | | |||
252 | a = actionCollection()->addAction(QStringLiteral("go_to_next_match")); | 251 | a = actionCollection()->addAction(QStringLiteral("go_to_next_match")); | ||
253 | a->setText(i18n("Go to Next Match")); | 252 | a->setText(i18n("Go to Next Match")); | ||
254 | connect(a, SIGNAL(triggered(bool)), this, SLOT(goToNextMatch())); | 253 | connect(a, &QAction::triggered, this, &KatePluginSearchView::goToNextMatch); | ||
255 | 254 | | |||
256 | a = actionCollection()->addAction(QStringLiteral("go_to_prev_match")); | 255 | a = actionCollection()->addAction(QStringLiteral("go_to_prev_match")); | ||
257 | a->setText(i18n("Go to Previous Match")); | 256 | a->setText(i18n("Go to Previous Match")); | ||
258 | connect(a, SIGNAL(triggered(bool)), this, SLOT(goToPreviousMatch())); | 257 | connect(a, &QAction::triggered, this, &KatePluginSearchView::goToPreviousMatch); | ||
259 | 258 | | |||
260 | m_ui.resultTabWidget->tabBar()->setSelectionBehaviorOnRemove(QTabBar::SelectLeftTab); | 259 | m_ui.resultTabWidget->tabBar()->setSelectionBehaviorOnRemove(QTabBar::SelectLeftTab); | ||
261 | KAcceleratorManager::setNoAccel(m_ui.resultTabWidget); | 260 | KAcceleratorManager::setNoAccel(m_ui.resultTabWidget); | ||
262 | 261 | | |||
263 | m_ui.displayOptions->setIcon(QIcon::fromTheme(QStringLiteral("games-config-options"))); | 262 | m_ui.displayOptions->setIcon(QIcon::fromTheme(QStringLiteral("games-config-options"))); | ||
264 | m_ui.searchButton->setIcon(QIcon::fromTheme(QStringLiteral("edit-find"))); | 263 | m_ui.searchButton->setIcon(QIcon::fromTheme(QStringLiteral("edit-find"))); | ||
265 | m_ui.nextButton->setIcon(QIcon::fromTheme(QStringLiteral("go-down-search"))); | 264 | m_ui.nextButton->setIcon(QIcon::fromTheme(QStringLiteral("go-down-search"))); | ||
266 | m_ui.stopButton->setIcon(QIcon::fromTheme(QStringLiteral("process-stop"))); | 265 | m_ui.stopButton->setIcon(QIcon::fromTheme(QStringLiteral("process-stop"))); | ||
Show All 18 Lines | |||||
285 | KComboBox* cmbUrl = m_ui.folderRequester->comboBox(); | 284 | KComboBox* cmbUrl = m_ui.folderRequester->comboBox(); | ||
286 | cmbUrl->setDuplicatesEnabled(false); | 285 | cmbUrl->setDuplicatesEnabled(false); | ||
287 | cmbUrl->setEditable(true); | 286 | cmbUrl->setEditable(true); | ||
288 | m_ui.folderRequester->setMode(KFile::Directory | KFile::LocalOnly); | 287 | m_ui.folderRequester->setMode(KFile::Directory | KFile::LocalOnly); | ||
289 | KUrlCompletion* cmpl = new KUrlCompletion(KUrlCompletion::DirCompletion); | 288 | KUrlCompletion* cmpl = new KUrlCompletion(KUrlCompletion::DirCompletion); | ||
290 | cmbUrl->setCompletionObject(cmpl); | 289 | cmbUrl->setCompletionObject(cmpl); | ||
291 | cmbUrl->setAutoDeleteCompletionObject(true); | 290 | cmbUrl->setAutoDeleteCompletionObject(true); | ||
292 | 291 | | |||
293 | connect(m_ui.newTabButton, SIGNAL(clicked()), this, SLOT(addTab())); | 292 | connect(m_ui.newTabButton, &QToolButton::clicked, this, &KatePluginSearchView::addTab); | ||
294 | connect(m_ui.resultTabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(tabCloseRequested(int))); | 293 | connect(m_ui.resultTabWidget, &QTabWidget::tabCloseRequested, this, &KatePluginSearchView::tabCloseRequested); | ||
295 | connect(m_ui.resultTabWidget, SIGNAL(currentChanged(int)), this, SLOT(resultTabChanged(int))); | 294 | connect(m_ui.resultTabWidget, &QTabWidget::currentChanged, this, &KatePluginSearchView::resultTabChanged); | ||
296 | 295 | | |||
297 | connect(m_ui.folderUpButton, SIGNAL(clicked()), this, SLOT(navigateFolderUp())); | 296 | connect(m_ui.folderUpButton, &QToolButton::clicked, this, &KatePluginSearchView::navigateFolderUp); | ||
298 | connect(m_ui.currentFolderButton, SIGNAL(clicked()), this, SLOT(setCurrentFolder())); | 297 | connect(m_ui.currentFolderButton, &QToolButton::clicked, this, &KatePluginSearchView::setCurrentFolder); | ||
299 | connect(m_ui.expandResults, SIGNAL(clicked()), this, SLOT(expandResults())); | 298 | connect(m_ui.expandResults, &QToolButton::clicked, this, &KatePluginSearchView::expandResults); | ||
300 | 299 | | |||
301 | connect(m_ui.searchCombo, SIGNAL(editTextChanged(QString)), &m_changeTimer, SLOT(start())); | 300 | connect(m_ui.searchCombo, &QComboBox::editTextChanged, &m_changeTimer, static_cast<void (QTimer::*)()>(&QTimer::start)); | ||
302 | connect(m_ui.matchCase, SIGNAL(toggled(bool)), &m_changeTimer, SLOT(start())); | 301 | connect(m_ui.matchCase, &QToolButton::toggled, &m_changeTimer, static_cast<void (QTimer::*)()>(&QTimer::start)); | ||
303 | connect(m_ui.matchCase, &QToolButton::toggled, this, [this](bool) { | 302 | connect(m_ui.matchCase, &QToolButton::toggled, [=]{ | ||
304 | Results *res = qobject_cast<Results *>(m_ui.resultTabWidget->currentWidget()); | 303 | Results *res = qobject_cast<Results *>(m_ui.resultTabWidget->currentWidget()); | ||
305 | if (res) { | 304 | if (res) { | ||
306 | res->matchCase = m_ui.matchCase->isChecked(); | 305 | res->matchCase = m_ui.matchCase->isChecked(); | ||
307 | } | 306 | } | ||
308 | }); | 307 | }); | ||
309 | connect(m_ui.useRegExp, SIGNAL(toggled(bool)), &m_changeTimer, SLOT(start())); | 308 | connect(m_ui.useRegExp, &QToolButton::toggled, &m_changeTimer, static_cast<void (QTimer::*)()>(&QTimer::start)); | ||
310 | connect(m_ui.useRegExp, &QToolButton::toggled, this, [this](bool) { | 309 | connect(m_ui.useRegExp, &QToolButton::toggled, [=]{ | ||
311 | Results *res = qobject_cast<Results *>(m_ui.resultTabWidget->currentWidget()); | 310 | Results *res = qobject_cast<Results *>(m_ui.resultTabWidget->currentWidget()); | ||
312 | if (res) { | 311 | if (res) { | ||
313 | res->useRegExp = m_ui.useRegExp->isChecked(); | 312 | res->useRegExp = m_ui.useRegExp->isChecked(); | ||
314 | } | 313 | } | ||
315 | }); | 314 | }); | ||
316 | m_changeTimer.setInterval(300); | 315 | m_changeTimer.setInterval(300); | ||
317 | m_changeTimer.setSingleShot(true); | 316 | m_changeTimer.setSingleShot(true); | ||
318 | connect(&m_changeTimer, SIGNAL(timeout()), this, SLOT(startSearchWhileTyping())); | 317 | connect(&m_changeTimer, &QTimer::timeout, this, &KatePluginSearchView::startSearchWhileTyping); | ||
319 | 318 | | |||
320 | connect(m_ui.searchCombo->lineEdit(), SIGNAL(returnPressed()), this, SLOT(startSearch())); | 319 | connect(m_ui.searchCombo->lineEdit(), &QLineEdit::returnPressed, this, &KatePluginSearchView::startSearch); | ||
321 | // connecting to returnPressed() of the folderRequester doesn't work, I haven't found out why yet. But connecting to the linedit works: | 320 | // connecting to returnPressed() of the folderRequester doesn't work, I haven't found out why yet. But connecting to the linedit works: | ||
322 | connect(m_ui.folderRequester->comboBox()->lineEdit(), SIGNAL(returnPressed()), this, SLOT(startSearch())); | 321 | connect(m_ui.folderRequester->comboBox()->lineEdit(), &QLineEdit::returnPressed, this, &KatePluginSearchView::startSearch); | ||
323 | connect(m_ui.filterCombo, SIGNAL(returnPressed()), this, SLOT(startSearch())); | 322 | connect(m_ui.filterCombo, static_cast<void (KComboBox::*)()>(&KComboBox::returnPressed), this, &KatePluginSearchView::startSearch); | ||
324 | connect(m_ui.excludeCombo, SIGNAL(returnPressed()), this, SLOT(startSearch())); | 323 | connect(m_ui.excludeCombo, static_cast<void (KComboBox::*)()>(&KComboBox::returnPressed), this, &KatePluginSearchView::startSearch); | ||
325 | connect(m_ui.searchButton, SIGNAL(clicked()), this, SLOT(startSearch())); | 324 | connect(m_ui.searchButton, &QPushButton::clicked, this, &KatePluginSearchView::startSearch); | ||
326 | 325 | | |||
327 | connect(m_ui.displayOptions, SIGNAL(toggled(bool)), this, SLOT(toggleOptions(bool))); | 326 | connect(m_ui.displayOptions, &QToolButton::toggled, this, &KatePluginSearchView::toggleOptions); | ||
328 | connect(m_ui.searchPlaceCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(searchPlaceChanged())); | 327 | connect(m_ui.searchPlaceCombo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &KatePluginSearchView::searchPlaceChanged); | ||
329 | connect(m_ui.searchPlaceCombo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [this](int) { | 328 | connect(m_ui.searchPlaceCombo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [this](int) { | ||
330 | if (m_ui.searchPlaceCombo->currentIndex() == Folder) { | 329 | if (m_ui.searchPlaceCombo->currentIndex() == Folder) { | ||
331 | m_ui.displayOptions->setChecked(true); | 330 | m_ui.displayOptions->setChecked(true); | ||
332 | } | 331 | } | ||
333 | }); | 332 | }); | ||
334 | 333 | | |||
335 | connect(m_ui.stopButton, SIGNAL(clicked()), &m_searchOpenFiles, SLOT(cancelSearch())); | 334 | connect(m_ui.stopButton, &QPushButton::clicked, &m_searchOpenFiles, &SearchOpenFiles::cancelSearch); | ||
336 | connect(m_ui.stopButton, SIGNAL(clicked()), &m_searchDiskFiles, SLOT(cancelSearch())); | 335 | connect(m_ui.stopButton, &QPushButton::clicked, &m_searchDiskFiles, &SearchDiskFiles::cancelSearch); | ||
337 | connect(m_ui.stopButton, SIGNAL(clicked()), &m_folderFilesList, SLOT(cancelSearch())); | 336 | connect(m_ui.stopButton, &QPushButton::clicked, &m_folderFilesList, &FolderFilesList::cancelSearch); | ||
338 | connect(m_ui.stopButton, SIGNAL(clicked()), &m_replacer, SLOT(cancelReplace())); | 337 | connect(m_ui.stopButton, &QPushButton::clicked, &m_replacer, &ReplaceMatches::cancelReplace); | ||
339 | 338 | | |||
340 | connect(m_ui.nextButton, SIGNAL(clicked()), this, SLOT(goToNextMatch())); | 339 | connect(m_ui.newTabButton, &QToolButton::clicked, this, &KatePluginSearchView::goToNextMatch); | ||
341 | 340 | | |||
342 | connect(m_ui.replaceButton, SIGNAL(clicked(bool)), this, SLOT(replaceSingleMatch())); | 341 | connect(m_ui.replaceButton, &QPushButton::clicked, this, &KatePluginSearchView::replaceSingleMatch); | ||
343 | connect(m_ui.replaceCheckedBtn, SIGNAL(clicked(bool)), this, SLOT(replaceChecked())); | 342 | connect(m_ui.replaceCheckedBtn, &QPushButton::clicked, this, &KatePluginSearchView::replaceChecked); | ||
344 | connect(m_ui.replaceCombo->lineEdit(), SIGNAL(returnPressed()), this, SLOT(replaceChecked())); | 343 | connect(m_ui.replaceCombo->lineEdit(), &QLineEdit::returnPressed, this, &KatePluginSearchView::replaceChecked); | ||
345 | 344 | | |||
346 | 345 | | |||
347 | 346 | | |||
348 | m_ui.displayOptions->setChecked(true); | 347 | m_ui.displayOptions->setChecked(true); | ||
349 | 348 | | |||
350 | connect(&m_searchOpenFiles, SIGNAL(matchFound(QString,QString,int,int,QString,int)), | 349 | connect(&m_searchOpenFiles, &SearchOpenFiles::matchFound, this, &KatePluginSearchView::matchFound); | ||
351 | this, SLOT(matchFound(QString,QString,int,int,QString,int))); | 350 | connect(&m_searchOpenFiles, &SearchOpenFiles::searchDone, this, &KatePluginSearchView::searchDone); | ||
352 | connect(&m_searchOpenFiles, SIGNAL(searchDone()), this, SLOT(searchDone())); | 351 | connect(&m_searchOpenFiles, static_cast<void (SearchOpenFiles::*)(const QString&)>(&SearchOpenFiles::searching), this, &KatePluginSearchView::searching); | ||
353 | connect(&m_searchOpenFiles, SIGNAL(searching(QString)), this, SLOT(searching(QString))); | 352 | | ||
354 | 353 | connect(&m_folderFilesList, &FolderFilesList::finished, this, &KatePluginSearchView::folderFileListChanged); | |||
355 | connect(&m_folderFilesList, SIGNAL(finished()), this, SLOT(folderFileListChanged())); | 354 | connect(&m_folderFilesList, &FolderFilesList::searching, this, &KatePluginSearchView::searching); | ||
356 | connect(&m_folderFilesList, SIGNAL(searching(QString)), this, SLOT(searching(QString))); | 355 | | ||
357 | 356 | connect(&m_searchDiskFiles, &SearchDiskFiles::matchFound, this, &KatePluginSearchView::matchFound); | |||
358 | connect(&m_searchDiskFiles, SIGNAL(matchFound(QString,QString,int,int,QString,int)), | 357 | connect(&m_searchDiskFiles, &SearchDiskFiles::searchDone, this, &KatePluginSearchView::searchDone); | ||
359 | this, SLOT(matchFound(QString,QString,int,int,QString,int))); | 358 | connect(&m_searchDiskFiles, static_cast<void (SearchDiskFiles::*)(const QString&)>(&SearchDiskFiles::searching), this, &KatePluginSearchView::searching); | ||
360 | connect(&m_searchDiskFiles, SIGNAL(searchDone()), this, SLOT(searchDone())); | 359 | | ||
361 | connect(&m_searchDiskFiles, SIGNAL(searching(QString)), this, SLOT(searching(QString))); | 360 | connect(m_kateApp, &KTextEditor::Application::documentWillBeDeleted, &m_searchOpenFiles, &SearchOpenFiles::cancelSearch); | ||
362 | | ||||
363 | connect(m_kateApp, SIGNAL(documentWillBeDeleted(KTextEditor::Document*)), | | |||
364 | &m_searchOpenFiles, SLOT(cancelSearch())); | | |||
365 | 361 | | |||
366 | connect(m_kateApp, SIGNAL(documentWillBeDeleted(KTextEditor::Document*)), | 362 | connect(m_kateApp, &KTextEditor::Application::documentWillBeDeleted, &m_replacer, &ReplaceMatches::cancelReplace); | ||
367 | &m_replacer, SLOT(cancelReplace())); | | |||
368 | 363 | | |||
369 | connect(m_kateApp, SIGNAL(documentWillBeDeleted(KTextEditor::Document*)), | 364 | connect(m_kateApp, &KTextEditor::Application::documentWillBeDeleted, this, &KatePluginSearchView::clearDocMarks); | ||
370 | this, SLOT(clearDocMarks(KTextEditor::Document*))); | | |||
371 | 365 | | |||
372 | connect(&m_replacer, SIGNAL(matchReplaced(KTextEditor::Document*,int,int,int)), | 366 | connect(&m_replacer, &ReplaceMatches::matchReplaced, this, &KatePluginSearchView::addMatchMark); | ||
373 | this, SLOT(addMatchMark(KTextEditor::Document*,int,int,int))); | | |||
374 | 367 | | |||
375 | connect(&m_replacer, &ReplaceMatches::replaceStatus, this, &KatePluginSearchView::replaceStatus); | 368 | connect(&m_replacer, &ReplaceMatches::replaceStatus, this, &KatePluginSearchView::replaceStatus); | ||
376 | 369 | | |||
377 | // Hook into line edit context menus | 370 | // Hook into line edit context menus | ||
378 | m_ui.searchCombo->setContextMenuPolicy(Qt::CustomContextMenu); | 371 | m_ui.searchCombo->setContextMenuPolicy(Qt::CustomContextMenu); | ||
379 | connect(m_ui.searchCombo, SIGNAL(customContextMenuRequested(QPoint)), this, | 372 | connect(m_ui.searchButton, &QPushButton::customContextMenuRequested, this, &KatePluginSearchView::searchContextMenu); | ||
380 | SLOT(searchContextMenu(QPoint))); | | |||
381 | m_ui.searchCombo->completer()->setCompletionMode(QCompleter::PopupCompletion); | 373 | m_ui.searchCombo->completer()->setCompletionMode(QCompleter::PopupCompletion); | ||
382 | m_ui.searchCombo->completer()->setCaseSensitivity(Qt::CaseSensitive); | 374 | m_ui.searchCombo->completer()->setCaseSensitivity(Qt::CaseSensitive); | ||
383 | m_ui.searchCombo->setInsertPolicy(QComboBox::NoInsert); | 375 | m_ui.searchCombo->setInsertPolicy(QComboBox::NoInsert); | ||
384 | m_ui.searchCombo->lineEdit()->setClearButtonEnabled(true); | 376 | m_ui.searchCombo->lineEdit()->setClearButtonEnabled(true); | ||
385 | m_ui.searchCombo->setMaxCount(25); | 377 | m_ui.searchCombo->setMaxCount(25); | ||
386 | 378 | | |||
387 | m_ui.replaceCombo->completer()->setCompletionMode(QCompleter::PopupCompletion); | 379 | m_ui.replaceCombo->completer()->setCompletionMode(QCompleter::PopupCompletion); | ||
388 | m_ui.replaceCombo->completer()->setCaseSensitivity(Qt::CaseSensitive); | 380 | m_ui.replaceCombo->completer()->setCaseSensitivity(Qt::CaseSensitive); | ||
389 | m_ui.replaceCombo->setInsertPolicy(QComboBox::NoInsert); | 381 | m_ui.replaceCombo->setInsertPolicy(QComboBox::NoInsert); | ||
390 | m_ui.replaceCombo->lineEdit()->setClearButtonEnabled(true); | 382 | m_ui.replaceCombo->lineEdit()->setClearButtonEnabled(true); | ||
391 | m_ui.replaceCombo->setMaxCount(25); | 383 | m_ui.replaceCombo->setMaxCount(25); | ||
392 | 384 | | |||
393 | m_toolView->setMinimumHeight(container->sizeHint().height()); | 385 | m_toolView->setMinimumHeight(container->sizeHint().height()); | ||
394 | 386 | | |||
395 | connect(m_mainWindow, SIGNAL(unhandledShortcutOverride(QEvent*)), | 387 | connect(m_mainWindow, &KTextEditor::MainWindow::unhandledShortcutOverride, this, &KatePluginSearchView::handleEsc); | ||
396 | this, SLOT(handleEsc(QEvent*))); | | |||
397 | 388 | | |||
398 | // watch for project plugin view creation/deletion | 389 | // watch for project plugin view creation/deletion | ||
399 | connect(m_mainWindow, SIGNAL(pluginViewCreated (const QString &, QObject *)) | 390 | connect(m_mainWindow, &KTextEditor::MainWindow::pluginViewCreated, this, &KatePluginSearchView::slotPluginViewCreated); | ||
400 | , this, SLOT(slotPluginViewCreated (const QString &, QObject *))); | | |||
401 | 391 | | |||
402 | connect(m_mainWindow, SIGNAL(pluginViewDeleted (const QString &, QObject *)) | 392 | connect(m_mainWindow, &KTextEditor::MainWindow::pluginViewDeleted, this, &KatePluginSearchView::slotPluginViewDeleted); | ||
403 | , this, SLOT(slotPluginViewDeleted (const QString &, QObject *))); | | |||
404 | 393 | | |||
405 | connect(m_mainWindow, SIGNAL(viewChanged(KTextEditor::View *)), this, SLOT(docViewChanged())); | 394 | connect(m_mainWindow, &KTextEditor::MainWindow::viewChanged, this, &KatePluginSearchView::docViewChanged); | ||
406 | 395 | | |||
407 | 396 | | |||
408 | // update once project plugin state manually | 397 | // update once project plugin state manually | ||
409 | m_projectPluginView = m_mainWindow->pluginView (QStringLiteral("kateprojectplugin")); | 398 | m_projectPluginView = m_mainWindow->pluginView (QStringLiteral("kateprojectplugin")); | ||
410 | slotProjectFileNameChanged (); | 399 | slotProjectFileNameChanged (); | ||
411 | 400 | | |||
412 | m_replacer.setDocumentManager(m_kateApp); | 401 | m_replacer.setDocumentManager(m_kateApp); | ||
413 | connect(&m_replacer, SIGNAL(replaceDone()), this, SLOT(replaceDone())); | 402 | connect(&m_replacer, &ReplaceMatches::replaceDone, this, &KatePluginSearchView::replaceDone); | ||
414 | 403 | | |||
415 | searchPlaceChanged(); | 404 | searchPlaceChanged(); | ||
416 | 405 | | |||
417 | m_toolView->installEventFilter(this); | 406 | m_toolView->installEventFilter(this); | ||
418 | 407 | | |||
419 | m_mainWindow->guiFactory()->addClient(this); | 408 | m_mainWindow->guiFactory()->addClient(this); | ||
420 | } | 409 | } | ||
421 | 410 | | |||
▲ Show 20 Lines • Show All 1492 Lines • ▼ Show 20 Line(s) | 1899 | { | |||
1914 | { | 1903 | { | ||
1915 | return; | 1904 | return; | ||
1916 | } | 1905 | } | ||
1917 | 1906 | | |||
1918 | Results *res = new Results(); | 1907 | Results *res = new Results(); | ||
1919 | 1908 | | |||
1920 | res->tree->setRootIsDecorated(false); | 1909 | res->tree->setRootIsDecorated(false); | ||
1921 | 1910 | | |||
1922 | connect(res->tree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), | 1911 | connect(res->tree, &QTreeWidget::itemDoubleClicked, this, &KatePluginSearchView::itemSelected, Qt::UniqueConnection); | ||
1923 | this, SLOT (itemSelected(QTreeWidgetItem*)), Qt::QueuedConnection); | | |||
1924 | 1912 | | |||
1925 | res->searchPlaceIndex = m_ui.searchPlaceCombo->currentIndex(); | 1913 | res->searchPlaceIndex = m_ui.searchPlaceCombo->currentIndex(); | ||
1926 | res->useRegExp = m_ui.useRegExp->isChecked(); | 1914 | res->useRegExp = m_ui.useRegExp->isChecked(); | ||
1927 | res->matchCase = m_ui.matchCase->isChecked(); | 1915 | res->matchCase = m_ui.matchCase->isChecked(); | ||
1928 | m_ui.resultTabWidget->addTab(res, QString()); | 1916 | m_ui.resultTabWidget->addTab(res, QString()); | ||
1929 | m_ui.resultTabWidget->setCurrentIndex(m_ui.resultTabWidget->count()-1); | 1917 | m_ui.resultTabWidget->setCurrentIndex(m_ui.resultTabWidget->count()-1); | ||
1930 | m_ui.stackedWidget->setCurrentIndex(0); | 1918 | m_ui.stackedWidget->setCurrentIndex(0); | ||
1931 | m_ui.resultTabWidget->tabBar()->show(); | 1919 | m_ui.resultTabWidget->tabBar()->show(); | ||
▲ Show 20 Lines • Show All 260 Lines • Show Last 20 Lines |
which is ok - just remove this comment.