D9242: Implemented support for hide/show groups

Milian Wolff noreply at phabricator.kde.org
Fri Dec 8 12:35:43 GMT 2017


mwolff accepted this revision.
mwolff added a comment.


  I agree with the suggestion by Elvis, otherwise lgtm besides one more suggestion for potential cleanup

INLINE COMMENTS

> placesitemmodel.cpp:477
> +
> +    const KFilePlacesModel *model = qobject_cast<const KFilePlacesModel*>(index.model());
> +    if (model) {

usually it would be preferred if you could add a proper role for the group type. Then you could just do

  auto groupType = index.data(KFilePlacesModel::GroupTypeRole).value<KFilePlacesModel::GroupType>();
  item->setGroupHidden(model->isGrouHidden(groupType));

at this point, it's then even better to just make this possible:

  auto groupHidden = index.data(KFilePlacesModel::GroupHiddenRole).toBool();
  item->setGroupHidden(groupHidden);

REPOSITORY
  R318 Dolphin

REVISION DETAIL
  https://phabricator.kde.org/D9242

To: renatoo, franckarrecot, mlaurent, mwolff
Cc: mwolff, elvisangelaccio, ngraham, #dolphin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20171208/61e657f0/attachment.htm>


More information about the kfm-devel mailing list