kdirwatch: fix a recently introduced crash
ClosedPublic

Authored by meven on Mar 31 2020, 8:18 AM.

Details

Summary

Prevent a crash when browsing nfs without FAM installed introduced in D28349

BUG: 419428

Diff Detail

Repository
R244 KCoreAddons
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
meven created this revision.Mar 31 2020, 8:18 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptMar 31 2020, 8:18 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
meven requested review of this revision.Mar 31 2020, 8:18 AM
iasensio accepted this revision.Mar 31 2020, 9:07 AM
iasensio mentioned this in D28349: Fix Warnings.

Thanks! It fixes BUG: 419428

This revision is now accepted and ready to land.Mar 31 2020, 9:09 AM
bruns added inline comments.Mar 31 2020, 10:27 AM
src/lib/io/kdirwatch.cpp
956

Can you change that to case KDirWatch::FAM: entryAdded = false; break to make it a little bit more explicit?

959–961

bonus points for adding

#else
case KDirWatch::INotify: entryAdded = false; break;

here (otherwise the switch may be incomplete), dito for QFSWatch below.

meven edited the summary of this revision. (Show Details)Mar 31 2020, 3:38 PM
meven updated this revision to Diff 79002.Mar 31 2020, 3:41 PM
meven marked 2 inline comments as done.

Add entryAdded = false to make things explicit and prevent warnings

bruns accepted this revision.Mar 31 2020, 4:01 PM

LGTM, thanks

This revision was automatically updated to reflect the committed changes.