Bug 386648 - project manager doesn't always reload emptied directories
Summary: project manager doesn't always reload emptied directories
Status: RESOLVED FIXED
Alias: None
Product: kdevplatform
Classification: Developer tools
Component: project (show other bugs)
Version: unspecified
Platform: Compiled Sources All
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-08 13:37 UTC by RJVB
Modified: 2017-11-12 21:38 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.2.1


Attachments
fix (831 bytes, text/plain)
2017-11-08 13:37 UTC, RJVB
Details

Note You need to log in before you can comment on or make changes to this bug.
Description RJVB 2017-11-08 13:37:21 UTC
Created attachment 108745 [details]
fix

I've been noticing an issue that appears to express itself more easily with directories called "devel" than others (but that ought to be just an artefact):

For a tree structure loaded in a KDevelop project, do

> touch /path/to/project/a/b/files/devel/aaa

An item `a/b/files/devel/aaa` will show up in the project tree

Now do

> rm /path/to/project/a/b/files/devel/aaa

The item will disappear but only if it isn't the last item in the directory.

This glitch is fixed when I remove 3 old (7y) lines from AFMPP::addJobItems(); see the attached patch. Seems rather self-evident: that function should not return without having removed stale/obsolete entries from the directory if no other function takes care of that housekeeping.
Comment 1 Sven Brauch 2017-11-08 15:16:22 UTC
I didn't look at the context, but what you say makes sense given the described bug. If you checked that nothing in the function relies on the list not being empty, please submit. Thanks!

Also, patches are easier to review on phabricator ;)
Comment 2 RJVB 2017-11-08 16:25:58 UTC
Yeah, I know, but this is a bug and I didn't want to pretend I was 100% certain of my fix.

Anyway, the list is only used in a foreach loop, so removing the check should be safe.
Comment 3 RJVB 2017-11-08 16:32:11 UTC
Git commit 54ab8b8c6717dec9087aa8482b735571a170e5e3 by R.J.V. Bertin.
Committed on 08/11/2017 at 16:31.
Pushed by rjvbb into branch '5.2'.

don't skip empty directories

AbstractFileManagerPluginPrivate::addJobItems() returned immediately
when called with an empty entries list, thus failing to do required
houskeeping. As a result the project manager would continue to show the
last file deleted from now empty directories.

M  +0    -4    kdevplatform/project/abstractfilemanagerplugin.cpp

https://commits.kde.org/kdevelop/54ab8b8c6717dec9087aa8482b735571a170e5e3