Keep QIcon::fromTheme in main thread
ClosedPublic

Authored by davidedmundson on May 16 2017, 3:31 PM.

Details

Summary

QIcon::fromTheme is not thread safe, we can't have it done in the future watcher.
We can solve this by returning null in the watcher, and doing fromTheme in the main thread
when the watcher finishes if we don't have an icon.

(offtopic, I once made the obvious patch to Qt, but it was rejected with
the response that QIcon isn't entirely thread safe, and that apparently
meant none of it should be, which I don't fully agree with but whatever...)

Test Plan

Current unit tests still pass

Diff Detail

Repository
R127 KWayland
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
davidedmundson created this revision.May 16 2017, 3:31 PM
Restricted Application added projects: Plasma on Wayland, Frameworks. · View Herald TranscriptMay 16 2017, 3:31 PM
Restricted Application added subscribers: Frameworks, plasma-devel. · View Herald Transcript

simplify a line

Restricted Application edited projects, added Plasma; removed Plasma on Wayland. · View Herald TranscriptMay 16 2017, 3:32 PM
graesslin accepted this revision.May 16 2017, 7:54 PM
graesslin added a subscriber: graesslin.

Eh what? That is not thread save?!? Oh sh*** I didn't expect that. Good catch and a nice solution.

This revision is now accepted and ready to land.May 16 2017, 7:54 PM
This revision was automatically updated to reflect the committed changes.
This comment was removed by rikmills.