appDisplay: Re-add _getCategories

It was introduced by one of the commits reverted by 812a61939e2d06,
but is now used for app folders as well; add it back.