Make KDirListerCache thread local
The PlacesRunner uses this model, but instantiating it in the runners 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.
Please register or sign in to comment