share code between file scanners
Summary: move most of the scanning of files to the helper file so that it can be shared and allow subsequent improvements to both code paths
Test Plan: indexing still works correctly
Reviewers: Elisa, mgallien
Reviewed By: Elisa, mgallien
Subscribers: mgallien
Tags: Elisa
Differential Revision: https://phabricator.kde.org/D12718