This ensure hovering a broken mount will not freeze the UI.
I already optimized it in D11088 to avoid doing blocking calls for when the bar isn't shown but this patch makes it fully async now.
Moreover, refresh only every 60 seconds (it's what Dolphin as well as Plasma's free space warning do), currently it would refresh every frame
Details
- Reviewers
dfaure lbeltrame - Group Reviewers
Frameworks - Commits
- R241:933887dc334f: [KFilePlacesView] Use asynchronous KIO::FileSystemFreeSpaceJob
Capacity bar shows up for a mounted drive and updates after a while when you hover it again.
It doesn't update "live" but it never did that, only happened to because it was querying free space like a mad man.
In theory this would also enable free space bars for network shares but CapacityBarRecommendedRole is only for mounted local storage sans CD rom.
Diff Detail
- Repository
- R241 KIO
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
src/filewidgets/kfileplacesview.cpp | ||
---|---|---|
259 | No ignore it, it does not work. |
Are you sure? It didn't grow during my testing, even after moving places around and adding and removing items. It could always identify the same QPersistentModelIndex
src/filewidgets/kfileplacesview.cpp | ||
---|---|---|
1111 | I think David F means you should connect here and expunge dead entries. |
Hmm I see this is only about the (few) entries in the Places view, not about general navigation into subsubdirs. So my initial comment was a bit nonsense.
src/filewidgets/kfileplacesview.cpp | ||
---|---|---|
258 | Yes but he needs it for !info.job 3 lines above, to avoid starting multiple jobs for the same thing at the same time. | |
265 | Usually written as if (job->error()) | |
1111 | and clear the map in this method. But I see that calling setModel twice isn't really supported properly anyway (no disconnects). |