Converting to a QSet and back randomizes the order of the files. Just doing a linear scan and a QSet for speading up the contains() check should be enough and maintains the order.