Question concerning KFileItemModel::setExpanded()

Frank Reininghaus frank78ac at googlemail.com
Fri Feb 3 18:08:50 GMT 2012


Hi,

Am 24. Januar 2012 16:07 schrieb Peter Penz:
[...]
>> Maybe we should modify KFileItemModel::setExpanded() such that it
>> really only expands the parents of the given URLs? In that case, maybe
>> we should also change the name of the function to avoid confustion.
>
> Hm, I currently see two options:
> 1. We leave the name + implementation, fix the documentation to match the implementation and adjust the calling code to pass the parent URLs instead.
> 2. We leave the documentation, fix the implementation so that it only expands the parents and rename the method to avoid confusion (= your suggestion).
>
> When I wrote setExpanded(const QSet<KUrl>& urls) I had in mind to expand only the parent items like said in the documentation. I tend to go for your suggestion, as I also think the two overloaded setExpanded() methods are confusing. I'm not sure about the name - expandParentItems() or setParentItemsExpanded(...)? As we don't have a getter-method and this is no property I'd tend to go for void expandParentItems(const QSet<KUrl>& urls). Do you probably have a better suggestion?

I just noticed that KFileItemModel::setExpanded(const QSet<KUrl>&
urls) is also called in FoldersPanel::setHiddenFilesShown(),
apparently to restore expanded folders when the hidden files setting
is toggled. However, I don't really see why this is necessary, and it
seems that commenting out that line has no effect here. Peter, can you
comment on why that call is made there?

Thanks,
Frank




More information about the kfm-devel mailing list