Support middle clicking of Back/Forward/Up/Home toolbar buttons
ClosedPublic

Authored by broulik on Aug 18 2017, 2:56 PM.

Details

Summary

This opens the resulting page in a new tab.

BUG: 358649

Test Plan

Middle clicked back, forward, up, home, and they all opened in a new tab.
Also fixed an issue in the previous goHome(Qt::MouseButton) function

Diff Detail

Repository
R318 Dolphin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Aug 18 2017, 2:56 PM
Restricted Application added a subscriber: Konqueror. · View Herald TranscriptAug 18 2017, 2:56 PM
elvisangelaccio requested changes to this revision.Aug 18 2017, 4:06 PM

I didn't figure out how to tell when the kxmlgui's toolBar is setup, so I have a timer hack in there, please tell me how to fix it :D

The toolbar is created by the setupGUI() call in the mainwindow constructor, so you need to install the event filter after that.

src/dolphinmainwindow.cpp
1109

We could just compare it with backAction (using [=] in the lambda). Same below.

This revision now requires changes to proceed.Aug 18 2017, 4:06 PM
broulik updated this revision to Diff 18606.Aug 23 2017, 3:51 PM
broulik edited edge metadata.
broulik edited the test plan for this revision. (Show Details)
  • Put stuff after setupGUI
  • Split lambda into its own method
elvisangelaccio accepted this revision.Aug 24 2017, 1:30 PM
This revision is now accepted and ready to land.Aug 24 2017, 1:30 PM
This revision was automatically updated to reflect the committed changes.

Nice addition :)

src/middleclickactioneventfilter.cpp
41

This is dangerous if watched isn't a QToolbar or a subclass of it.