- // Iterate through all items and rename them...
- int index = m_spinBox->value();
- foreach (const KFileItem& item, m_items) {
- QString newName = indexedName(m_newName, index, QLatin1Char('#'));
- ++index;
-
- const QUrl oldUrl = item.url();
- QMimeDatabase db;
- const QString extension = db.suffixForFileName(oldUrl.path().toLower());
- if (!extension.isEmpty()) {
- newName.append(QLatin1Char('.'));
- newName.append(extension);
- }
-
- if (oldUrl.fileName() != newName) {
- renameItem(item, newName);
- }
- }