Changeset View
Changeset View
Standalone View
Standalone View
src/core/batchrenamejob.cpp
Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Line(s) | 46 | { | |||
---|---|---|---|---|---|
54 | // In this case nothing is substituted and all files have the same $newName. | 54 | // In this case nothing is substituted and all files have the same $newName. | ||
55 | // 4. At least two files have same extension and $newName contains an invalid placeholder. | 55 | // 4. At least two files have same extension and $newName contains an invalid placeholder. | ||
56 | // In this case $index is appended to $newName. | 56 | // In this case $index is appended to $newName. | ||
57 | 57 | | |||
58 | 58 | | |||
59 | // Check for extensions. | 59 | // Check for extensions. | ||
60 | QSet<QString> extensions; | 60 | QSet<QString> extensions; | ||
61 | QMimeDatabase db; | 61 | QMimeDatabase db; | ||
62 | foreach (const QUrl &url, m_srcList) { | 62 | for (const QUrl &url : qAsConst(m_srcList)) { | ||
63 | const QString extension = db.suffixForFileName(url.toDisplayString().toLower()); | 63 | const QString extension = db.suffixForFileName(url.toDisplayString().toLower()); | ||
64 | if (extensions.contains(extension)) { | 64 | if (extensions.contains(extension)) { | ||
65 | m_allExtensionsDifferent = false; | 65 | m_allExtensionsDifferent = false; | ||
66 | break; | 66 | break; | ||
67 | } | 67 | } | ||
68 | 68 | | |||
69 | extensions.insert(extension); | 69 | extensions.insert(extension); | ||
70 | } | 70 | } | ||
▲ Show 20 Lines • Show All 142 Lines • Show Last 20 Lines |