Question about KDirLister and hiding expanded directories

David Faure faure at kde.org
Sun Jan 6 11:04:06 GMT 2013


On Saturday 05 January 2013 14:49:11 Frank Reininghaus wrote:
> after debugging a Dolphin crash,

Hi Frank, nice piece of debugging :)

> https://bugs.kde.org/show_bug.cgi?id=311947
> 
> I have another question about KDirLister. The problem is the
> following: assuming we have folders ~/a and ~/a/b, renaming ~/a to
> ~/.a (and thus hiding it) will have the following effects:
> 
> 1. KDirLister's refreshItems signal reports that the name of ~/a/b
> changes to ~/.a/b.
> 2. It then reports that ~/a has been deleted.

I assume KDirLister's builtin "hiding of dot files" is being used, then.

> KDirModel does not suffer from this problem because each
> KDirModelDirNode node keeps a list of its children, so the
> parent-child relationship is not affected by the ~/a/b -> ~/.a/b
> change.

One day we should merge KDirLister and KDirModel's data structures...

> So my question is: Would you agree that emitting the refreshItems
> signal for a child of the directory that is being hidden is sort of
> unexpected? 

Yes, I guess I agree. Even though the directory was effectively renamed on 
disk, in a KDirLister which is set to "hiding dot files", the outside view (for 
the user of KDirLister) is that the directory was "removed".

> And if yes, is there an easy way to fix this?

I'll need to look into that.

> The alternative might be to move the entire "hidden files" filtering
> to the model. Given that we already do filtering by name and mime type
> inside the model, this looks more consistent anyway.

Which model? The dolphin-specific one? Doesn't seem like the right layer for 
the fix.

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE, in particular KDE Frameworks 5





More information about the kfm-devel mailing list