Simplify code in setDateModified

2 jobs for !80 with datemod in 7 minutes and 28 seconds (queued for 1 second)
detached
Status Job ID Name Coverage
  Build
passed #7041
linux kf5-qt5 qt5.10

00:06:44

25.0%
passed #7042
windows
windows kf5-qt5 qt5.11

00:07:28