This fixes notifications happening against our will given that inotify
is async.
Details
copying/deleting files in dolphin still updates the view
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.
It's kind of harmless i guess, but when doing a rename via F2 in dolphin we do stopDirScan on the url twice, one in CopyJobPrivate::startRenameJob and another in CopyJobPrivate::createNextDir
that means you get the following warning
org.kde.kcoreaddons: doesn't know "/home/tsdgeos/bcnfs.github.io/sponsoring/"
Do we care?
In fact, CopyJob has no way to know whether a view somewhere is watching that directory. When an app other than Dolphin uses CopyJob, there isn't going to be any watching, possibly.
So I think we need to remove the qDebug in KDirWatch so that removeDir is silent if the dir wasn't watched [this is faster than checking before removing, from the outside].
At the same time, this shows that the CopyJob handling of m_parentDirs can be improved a little bit. Posting an update.
About the code itself, it looks good, and i've tested dolphin with copy and removes and it seems ok, but on the other hand i understand this is mostly an optimization, so i'm not sure if i would be able to see if it wasn't working fine.
I'm going to say, if we don't have anyone else that can review this, take my +1.
If there's anyone else, i'd be happy to get a second opinion :)
I know what the problem is with this.
Previously, if nobody was watching the directory, stopDirScan/restartDirScan would basically do nothing.
Now, after running a kio job in that directory, KDirWatch will start watching it, for no purpose, due to the unconditional addDir().
I guess this needs checks with KDirWatch::contains() before removeDir to only call addDir on dirs that were actually watched in the first place...
Seems this needed changes, was pushed by mistake, then reverted and thus it stayed in the "albert needs to review" state instead of the "david needs to do changes" state.