┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2009-04-12 15:39:13 +0000
committerPeter Penz <[email protected]>2009-04-12 15:39:13 +0000
commitf2e7c6d0d92d00f8aa81fbe9e96f50c5b87277ed (patch)
tree39352fee0658de4293104d9b630abfb219afc4ae
parent5bd452a69dcf177090080e6d161ff7245dac8628 (diff)
Assure that the extension is added correctly when renaming multiple files even if the extension uses capital letters (e. g. .JPG instead of .jpg).
svn path=/trunk/KDE/kdebase/apps/; revision=952804
-rw-r--r--src/renamedialog.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/renamedialog.cpp b/src/renamedialog.cpp
index caa098a06..39e61c464 100644
--- a/src/renamedialog.cpp
+++ b/src/renamedialog.cpp
@@ -64,14 +64,17 @@ RenameDialog::RenameDialog(QWidget *parent, const KFileItemList& items) :
}
m_lineEdit = new KLineEdit(page);
- QString extension = KMimeType::extractKnownExtension(items[0].url().prettyUrl());
- if (extension.length() > 0) {
+
+ QString fileName = items[0].url().prettyUrl();
+ QString extension = KMimeType::extractKnownExtension(fileName.toLower());
+ if (!extension.isEmpty()) {
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.
for (int i = 1; i < itemCount; ++i) {
- if (!items[i].url().prettyUrl().contains(extension)) {
+ fileName = items[i].url().prettyUrl().toLower();
+ if (!fileName.endsWith(extension)) {
// at least one item does not have the same extension
extension.truncate(0);
break;