[Bug 855473]

David Faure faure at kde.org
Thu Nov 29 17:11:05 UTC 2012


Git commit 75da8e8129f6bc152a781ff47fb8e741c65b584e by David Faure.
Committed on 29/11/2012 at 17:49.
Pushed by dfaure into branch 'KDE/4.9'.

Fix KDirLister forgetting to watch a directory after listing it from the
cache.

Many many thanks to Frank Reininghaus for the unittest that finally made
this issue reproduceable, based on feedback from users in the bug report.

The issue: whether to watch a directory with KDirWatch is refcounted.
Each lister showing the dir counts as one, the cache itself can add one,
and does so initially. If a dir is modified while it's only in the cache,
we mark it as dirty, stop watching, and we'll simply update the directory
when showing it to the user again later. At that point we need to start
watching it again. The old code would do decr+incr, I "optimized" this in
7b9cafaaf6af (oct 2010) to fix the bug that (with an initial refcount of 1),
decr would lead to 0 temporarily.
However if the item wasn't watched anymore (initial refcount of 0), the decr
would do nothing (if (c<0) c=0), and the incr would start the watching.
With 7b9cafaaf6af this all went away (I thought decr+incr==noop), so no watching.
The proper solution is obviously incr+decr_if_not_done_before_already
(when the cache stops watching the dir because a change happened).
FIXED-IN: 4.9.4

M  +15   -7    kio/kio/kdirlister.cpp
M  +4    -0    kio/kio/kdirlister_p.h
M  +70   -2    kio/tests/kdirlistertest.cpp
M  +1    -0    kio/tests/kdirlistertest.h

http://commits.kde.org/kdelibs/75da8e8129f6bc152a781ff47fb8e741c65b584e

-- 
You received this bug notification because you are a member of Kubuntu
Bugs, which is subscribed to kde4libs in Ubuntu.
https://bugs.launchpad.net/bugs/855473

Title:
  File list not updated in dolphin

To manage notifications about this bug go to:
https://bugs.launchpad.net/kdelibs/+bug/855473/+subscriptions




More information about the kubuntu-bugs mailing list