Bug 450702 - QtQuickDialogWrapper::exec is an anti pattern that allows the user to break most apps that use it
Summary: QtQuickDialogWrapper::exec is an anti pattern that allows the user to break m...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-knewstuff
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Dan Leinir Turthra Jensen
URL:
Keywords:
: 453397 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-02-22 13:01 UTC by Harald Sitter
Modified: 2022-05-05 22:06 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.94


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Sitter 2022-02-22 13:01:43 UTC
SUMMARY

STEPS TO REPRODUCE
1.  open parley
2.  click on >> get new collections <<
3.  close parley
4. observe the kns window still being open
5. close the kns window
6. crash

1. open systemsettings
2. open global theme kcm
3. click >> get new global themes <<
4. close systemsettings
5. observe ksn window closing
6. try to start systemsettings again - you can't it's still running without window 🤷‍♂️

SOFTWARE/OS VERSIONS
masterino on linux

ADDITIONAL INFORMATION
Nested eventloops are the devil. I would suggest to deprecate ::exec and drop it with kf6 entirely. Porting away from exec shouldn't be too much of a challenge, the few apps I've looked at mostly seem to reload their state when the dialog closes, that can easily be done in a lambda slot.
Comment 1 Alexander Lohnau 2022-04-26 03:56:42 UTC
Git commit 3dbdcc0385142dd5e117a99550e6504ecca8d8fd by Alexander Lohnau.
Committed on 26/04/2022 at 03:53.
Pushed by alex into branch 'master'.

Port away from using KNS3::QtQuickDialogWrapper::exec internally

M  +5    -0    src/qtquickdialogwrapper.cpp
M  +6    -0    src/qtquickdialogwrapper.h
M  +11   -8    src/widgets/action.cpp
M  +4    -1    src/widgets/button.cpp

https://invent.kde.org/frameworks/knewstuff/commit/3dbdcc0385142dd5e117a99550e6504ecca8d8fd
Comment 2 Alexander Lohnau 2022-04-26 03:56:50 UTC
Git commit 836a7b80f3c850f953e1b7ed229a2c3401ef015e by Alexander Lohnau.
Committed on 26/04/2022 at 03:53.
Pushed by alex into branch 'master'.

Deprecate KNS3::QtQuickDialogWrapper::exec

M  +1    -1    src/CMakeLists.txt
M  +2    -0    src/qtquickdialogwrapper.cpp
M  +5    -0    src/qtquickdialogwrapper.h

https://invent.kde.org/frameworks/knewstuff/commit/836a7b80f3c850f953e1b7ed229a2c3401ef015e
Comment 3 Nate Graham 2022-05-05 22:06:06 UTC
*** Bug 453397 has been marked as a duplicate of this bug. ***