Refactor path building from QStandardPath

The duplicated logic was made apparent by the merge conflict
resolution.

Change-Id: Ib4558ca0b6b5084f851282916cbc9a6615ed33f9
Reviewed-by: Andras Becsi <andras.becsi@digia.com>