FolderModel: When adding files, keep the current sorting
The sort mode got changed to unsorted if any file was added. This was probably due to the infinite while loop that would happen later when we're looking for a new blank spot from an index that does not exist: This would return an empty QVariant that is false by default.
We need to check if the index is valid. If it's not, we know it's a new index and can create one, so it is a blank spot.
BUG: 482470 FIXED-IN: 6.3.6
Edited by Akseli Lahtinen