Parse unnecessary extensions away from filename

task-number: QTBUG-39219

Change-Id: If89f3af95d342591171bfeda7bbdf6604532c4f8
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>