Don't assume the manager and menu have the same lifetime
ClosedPublic

Authored by davidre on Jan 22 2020, 6:49 PM.

Details

Summary

The menu we retun can outlive the manager. So we can't use it or its members in
slots when connecting to signals of the menu or it's actions. This also switches
the actions' data() back to being the schemePaths instead of the rows of the
corresponding indices.

Test Plan

Open Labplot which currently triggers this crash.

Diff Detail

Repository
R265 KConfigWidgets
Branch
menumanager (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 21600
Build 21618: arc lint + arc unit
davidre created this revision.Jan 22 2020, 6:49 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptJan 22 2020, 6:49 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
davidre requested review of this revision.Jan 22 2020, 6:49 PM
anthonyfieroni added inline comments.
src/kcolorschememanager.cpp
191–192

You can connect to qApp

davidre added inline comments.Jan 23 2020, 3:56 PM
src/kcolorschememanager.cpp
191–192

What is meant by "connecting to qApp"? Just doing the scheme switching here? I wanted to avoid the duplication that's why I created the static helper method.

broulik added inline comments.Jan 23 2020, 3:56 PM
src/kcolorschememanager.cpp
191–192

Using qApp as context object

davidre added inline comments.Jan 23 2020, 4:05 PM
src/kcolorschememanager.cpp
191–192

Thanks! Makes sense!

davidre updated this revision to Diff 74271.Jan 23 2020, 8:02 PM

Use qApp as context

davidre marked 4 inline comments as done.Jan 24 2020, 9:00 AM
broulik accepted this revision.Jan 29 2020, 2:37 PM
This revision is now accepted and ready to land.Jan 29 2020, 2:37 PM
This revision was automatically updated to reflect the committed changes.