Changeset View
Changeset View
Standalone View
Standalone View
krusader/BookMan/krbookmarkhandler.cpp
Show First 20 Lines • Show All 466 Lines • ▼ Show 20 Line(s) | 441 | if (SPECIAL_BOOKMARKS) { | |||
---|---|---|---|---|---|
467 | } | 467 | } | ||
468 | 468 | | |||
469 | if (hasJumpback) { | 469 | if (hasJumpback) { | ||
470 | menu->addSeparator(); | 470 | menu->addSeparator(); | ||
471 | 471 | | |||
472 | ListPanelActions *actions = _mainWindow->listPanelActions(); | 472 | ListPanelActions *actions = _mainWindow->listPanelActions(); | ||
473 | 473 | | |||
474 | auto action = KrBookmark::jumpBackAction(_privateCollection, true, actions); | 474 | auto action = KrBookmark::jumpBackAction(_privateCollection, true, actions); | ||
475 | if (action) { | 475 | if (action) { | ||
martinkostolny: inside the if:
```
connect(action, &QAction::triggered, this, [=] {
if (_mainBookmarkPopup… | |||||
476 | menu->addAction(action); | 476 | menu->addAction(action); | ||
477 | _specialBookmarks.append(action); | 477 | _specialBookmarks.append(action); | ||
478 | } | 478 | } | ||
479 | 479 | | |||
480 | action = KrBookmark::jumpBackAction(_privateCollection, false, actions); | 480 | action = KrBookmark::jumpBackAction(_privateCollection, false, actions); | ||
481 | if (action) { | 481 | if (action) { | ||
same here: connect(action, &QAction::triggered, this, [=] { if (_mainBookmarkPopup && !_mainBookmarkPopup->isHidden()) { _mainBookmarkPopup->close(); } }); martinkostolny: same here:
```
connect(action, &QAction::triggered, this, [=] {
if (_mainBookmarkPopup && ! | |||||
482 | menu->addAction(action); | 482 | menu->addAction(action); | ||
483 | _specialBookmarks.append(action); | 483 | _specialBookmarks.append(action); | ||
484 | } | 484 | } | ||
485 | } | 485 | } | ||
486 | } | 486 | } | ||
487 | 487 | | |||
488 | menu->addSeparator(); | 488 | menu->addSeparator(); | ||
489 | menu->addAction(KrActions::actAddBookmark); | 489 | menu->addAction(KrActions::actAddBookmark); | ||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | 526 | { | |||
531 | 531 | | |||
532 | // Having it occur on keypress is consistent with other shortcuts, | 532 | // Having it occur on keypress is consistent with other shortcuts, | ||
533 | // such as Ctrl+W and accelerator keys | 533 | // such as Ctrl+W and accelerator keys | ||
534 | if (ev->type() == QEvent::KeyPress && obj->inherits("QMenu")) { | 534 | if (ev->type() == QEvent::KeyPress && obj->inherits("QMenu")) { | ||
535 | QKeyEvent *kev = static_cast<QKeyEvent *>(ev); | 535 | QKeyEvent *kev = static_cast<QKeyEvent *>(ev); | ||
536 | QMenu *menu = static_cast<QMenu *>(obj); | 536 | QMenu *menu = static_cast<QMenu *>(obj); | ||
537 | QList<QAction *> acts = menu->actions(); | 537 | QList<QAction *> acts = menu->actions(); | ||
538 | bool quickSearchStarted = false; | 538 | bool quickSearchStarted = false; | ||
539 | bool searchInSpecialItems = KConfigGroup(krConfig, "Look&Feel").readEntry("Search in special items", false); | ||||
539 | 540 | | |||
540 | if (kev->key() == Qt::Key_Left && kev->modifiers() == Qt::NoModifier) { | 541 | if (kev->key() == Qt::Key_Left && kev->modifiers() == Qt::NoModifier) { | ||
541 | menu->close(); | 542 | menu->close(); | ||
542 | return true; | 543 | return true; | ||
543 | } | 544 | } | ||
544 | 545 | | |||
545 | if (kev->modifiers() != Qt::NoModifier || | 546 | if (kev->modifiers() != Qt::NoModifier || | ||
546 | kev->text().isEmpty() || | 547 | kev->text().isEmpty() || | ||
Show All 26 Lines | |||||
573 | // match actions | 574 | // match actions | ||
574 | QAction *matchedAction = nullptr; | 575 | QAction *matchedAction = nullptr; | ||
575 | int nMatches = 0; | 576 | int nMatches = 0; | ||
576 | for (auto act : acts) { | 577 | for (auto act : acts) { | ||
577 | if (act->isSeparator() || act->text() == "") { | 578 | if (act->isSeparator() || act->text() == "") { | ||
578 | continue; | 579 | continue; | ||
579 | } | 580 | } | ||
580 | 581 | | |||
582 | if (!searchInSpecialItems && _specialBookmarks.contains(act)) { | ||||
583 | continue; | ||||
584 | } | ||||
585 | | ||||
581 | if (quickSearchStarted) { | 586 | if (quickSearchStarted) { | ||
582 | // if the first key press is an accelerator key, let the accelerator handler process this event | 587 | // if the first key press is an accelerator key, let the accelerator handler process this event | ||
583 | if (act->text().contains('&' + kev->text(), Qt::CaseInsensitive)) { | 588 | if (act->text().contains('&' + kev->text(), Qt::CaseInsensitive)) { | ||
584 | qDebug() << "Bookmark search: hit accelerator key of" << act; | 589 | qDebug() << "Bookmark search: hit accelerator key of" << act; | ||
585 | _setQuickSearchText(""); | 590 | _setQuickSearchText(""); | ||
586 | return QObject::eventFilter(obj, ev); | 591 | return QObject::eventFilter(obj, ev); | ||
587 | } | 592 | } | ||
588 | 593 | | |||
▲ Show 20 Lines • Show All 231 Lines • Show Last 20 Lines |
inside the if: