Replace recursive isDirHidden with iterative one, allow const argument
Summary:
The non-unix implementation modifies its QDir argument to walk up the
tree. Create a copy instead.
The copy cost is amortized by no longer having to reset the dir in the
calling code, for the unix-code it is a net win.
Reviewers: Baloo, Frameworks, poboiko, ngraham
Reviewed By: Baloo, ngraham
Subscribers: kde-frameworks-devel
Tags: Frameworks, Baloo
Differential Revision: https://phabricator.kde.org/D18825