isDesktopFile() of KDesktopFile only looks at the file extension. This is not sufficient in a lot of cases, i.e. if you create a 'Link to Location' with dolphin it creates a desktop file without the .desktop extension. isDesktopFile check of KFileItem seems to working better and doesn't just look at the file suffix.