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