refactor out common code of removeDirentsCache
fixed the way to get parent path

QFileInfo(path).absolutePath() is not cross-platform