D25433: KActionCollection: provide a changed() signal as a replacement for removed()

David Faure noreply at phabricator.kde.org
Wed Nov 20 23:11:21 GMT 2019


dfaure created this revision.
dfaure added reviewers: kossebau, mart, davidedmundson.
Herald added a project: Frameworks.
Herald added a subscriber: kde-frameworks-devel.
dfaure requested review of this revision.

REVISION SUMMARY
  removed() is deprecated since 5.0 because the code has to downcast a partially
  destroyed QObject back to a QAction (from the slot connected to
  destroyed()). This is very dangerous, calling QAction methods will just
  crash.
  
  plasma-framework/src/scriptengines/qml/plasmoid/containmentinterface.cpp
  is using that removed() signal, but doesn't care about the argument,
  it's connecting both inserted() and removed() to a generic changed
  signal used to notify QML.
  
  For this use case, all we need in KActionCollection is a changed() signal
  with no argument, emitted for both insertion and removal.
  
  This makes me wonder if inserted() still is useful at all, but well, it
  doesn't hurt to keep it.

TEST PLAN
  Builds, new test method passes

REPOSITORY
  R263 KXmlGui

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D25433

AFFECTED FILES
  autotests/kactioncollectiontest.cpp
  autotests/kactioncollectiontest.h
  src/kactioncollection.cpp
  src/kactioncollection.h

To: dfaure, kossebau, mart, davidedmundson
Cc: kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20191120/6f7270a8/attachment.html>


More information about the Kde-frameworks-devel mailing list