This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/114619/

This change has been marked as submitted.


Review request for Kate.
By Michal Humpula.

Updated Dec. 28, 2013, 2:38 p.m.

Repository: kate

Description

This is a little bit hackish, so second opinion is welcomed (required).

Back in KDE4 there was KGlobalSettings::kdisplayPaletteChanged() signal, which was generated, when DBus notification from kcontrol (?) arrived. Seems that with Qt5 QPA and its implementation in frameworks, this is gone. The recommended way is supossedly to

* Note: If you derive from a QWidget-based class, a faster method is to
*       reimplement QWidget::changeEvent() and catch QEvent::PaletteChange.
*       This is the preferred way to get informed about palette updates.

which doesn't work in a case of KateGlobal, which derives from QObject. So Loooking at the Qt5 kode, the QPA should send QEvent::ChangePallete to application object, which resends it to all widgets and to itself as QEvent::ApplicationChangePallete. So the solution simple taps to the event interface and listens for the right event.

Testing

none. `kcmshell5 colors` doesn't seems to change colors of running applications (at least for me and for now).

Diffs

  • part/utils/kateglobal.h (610be1d)
  • part/utils/kateglobal.cpp (f13e9a7)

View Diff