Or scrap the whole function body and use `return QFileInfo(filePath()).fileName();` instead of re-implementing `basename(3)`.