D24962: [DeleteJob] Use a separate worker thread to run actual IO operation
Méven Car
noreply at phabricator.kde.org
Mon Oct 28 09:19:20 GMT 2019
meven added a comment.
In D24962#554961 <https://phabricator.kde.org/D24962#554961>, @dfaure wrote:
> Any reason why you didn't implement my suggestion of
>
> DeleteJobIOWorker *ioworker() {
> if (!m_ioworker) {
> ...
> }
> return m_ioworker;
> }
> [...]
> QMetaObject::invokeMethod(ioworker(), "rmfile", [...]);
>
>
> ?
> A call to an initSomething() method can easily be forgotten, while an on-demand getter ensure that the worker is created when it's needed (for the first time).
> Sorry for the nitpicking :-)
Since m_ioworker is accessible where worker() would be needed, nothing keeps the user to use m_ioworker instead of worker() which is in the end is equivalent to forget to call initSomething.
It was my own habit to use a init or ensureInit function in such cases, and is the main reason I was using one.
But it is more explicit to have an accessor and for code coherence I have changed the code to have a *worker() function.
INLINE COMMENTS
> dfaure wrote in deletejob.cpp:412
> marked as done but I still see removeFirst, I'm confused.
I missed this line, I did it line 430.
REPOSITORY
R241 KIO
REVISION DETAIL
https://phabricator.kde.org/D24962
To: meven, dfaure
Cc: kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20191028/f903bdd3/attachment-0001.html>
More information about the Kde-frameworks-devel
mailing list