- QString postfix(items[0].prettyUrl().section('.', 1));
- if (postfix.length() > 0) {
- // The first item seems to have a postfix (e. g. 'jpg' or 'txt'). Now
- // check whether all other items have the same postfix. If this is the
- // case, add this postfix to the name suggestion.
- postfix.insert(0, '.');
+ QString extension = KMimeType::extractKnownExtension(items[0].url().prettyUrl());
+ if (extension.length() > 0) {
+ extension.insert(0, '.');
+ // The first item seems to have a extension (e. g. '.jpg' or '.txt'). Now
+ // check whether all other URLs have the same extension. If this is the
+ // case, add this extension to the name suggestion.