Ignore .!qB when extracting file extensions

QString::endWith() should be used. If true you should QString::chop() off the last 4 chars. Or instead of chopping use left()/right()/mid() which are const and will return a new qstring. (chop operates on the same string and in this case you'll need to copy it).