Skip to content

Draft: Implement async metadata loading

Dāvis Mosāns requested to merge davism/dolphin:metadata into master

This MR contains 2 things:

  1. Replaces KBalooRolesProvider with Baloo::FileMetaDataRoles (implemented in libraries/baloo-widgets!29)
  2. Replaces Dolphin's Baloo metadata loading with smart Baloo::FileListMetaDataProvider that handles metadata loading for multiple files instead of Dolphin having it's own implementation

BalooWidgets already has Baloo::FileMetaDataProvider which could be used but it can only handle things by 1 file (or multiple file mode but that works differently) - also currently it's partly synchronous.

I have implemented FileListMetaDataProvider that loads metadata for multiple files in parallel (multi-threaded) asynchronously with very simple API:

  • FileListMetaDataProvider::refreshAll()
  • FileListMetaDataProvider::refreshItems(const KFileItemList &items) (will auto-add new items)
  • FileListMetaDataProvider::removeItems(const KFileItemList &items)
  • FileListMetaDataProvider::clearItems()
  • There are more methods but they're not used by Dolphin

This allows to remove some code from Dolphin as you can see in this MR and it also allows to load all metadata even when Baloo file indexing is disabled. And isSlow() calls could be removed aswell since it doesn't block UI.

Note that it will take me some while to clean it up so I haven't actually submited MR for it to BalooWidgets yet but this part can be already reviewed.

And in this video demonstration https://www.youtube.com/watch?v=OcMdayLzm0g you can see it in action.

cc @meven @chenxiaolong

Edited by Dāvis Mosāns

Merge request reports

Loading