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

Authored by davidre on Wed, Jan 22, 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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidre created this revision.Wed, Jan 22, 6:49 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptWed, Jan 22, 6:49 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
davidre requested review of this revision.Wed, Jan 22, 6:49 PM
anthonyfieroni added inline comments.
src/kcolorschememanager.cpp
197–198

You can connect to qApp

davidre added inline comments.Thu, Jan 23, 3:56 PM
src/kcolorschememanager.cpp
197–198

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.Thu, Jan 23, 3:56 PM
src/kcolorschememanager.cpp
197–198

Using qApp as context object

davidre added inline comments.Thu, Jan 23, 4:05 PM
src/kcolorschememanager.cpp
197–198

Thanks! Makes sense!

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

Use qApp as context

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