]> cloud.milkyroute.net Git - dolphin.git/commit
Avoid KJob::exec() in DolphinView
authorFelix Ernst <fe.a.ernst@gmail.com>
Mon, 8 Feb 2021 21:32:10 +0000 (21:32 +0000)
committerElvis Angelaccio <elvis.angelaccio@kde.org>
Mon, 8 Feb 2021 21:32:10 +0000 (21:32 +0000)
commita825e1bd74246dc97dde3f48b1d9ead7a214b744
tree57158cf021f5db25b1f3740ec7db870569d2f622
parent7eae6bba5f2c9dbd9e40e1194e8455e9e4ed3f6d
Avoid KJob::exec() in DolphinView

This commit replaces an error-prone usage of KIO::StatJob::exec() in
DolphinView with the recommended KIO::StatJob::start().

The containing method DolphinView::statusBarText() is changed to be a
method without return value: requestStatusBarText()
The new status bar text is instead returned through a new
setStatusBarText() signal that will be emitted asynchronously if
necessary.

The calling code that deals with status bar text is refactored to
correctly work despite the new asynchronicity. The helper method
calculateItemCount() is moved into requestStatusBarText() and some
other code from requestStatusBarText() is moved into a new helper
method emitStatusBarText().

The documentation of KIO::KJob::exec() explains why it should be
avoided. A reproducible crash is the reason for this commit.
src/dolphinpart.cpp
src/dolphinviewcontainer.cpp
src/views/dolphinview.cpp
src/views/dolphinview.h