Skip to content

Make KDirListerCache thread local

Alexander Lohnau requested to merge work/alex/placesmodel into master
The PlacesRunner uses this model, but instantiating it in the runner's
thread causes a crash, because the cache lived in a different thread.

This can be solved my making the cache thread-local and thus the runner
thread has its own cache.

According to https://doc.qt.io/qt-6.2/qthreadstorage.html#localData, a
new value will be created when we don't have a thread-local instance.
This means we do not need to check if the value is present or not and
also don't need to explicitly store a pointer.

Merge request reports

Loading