[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    =?utf-8?q?=5Bkdelibs/KDE/4=2E6=5D_kio/kio=3A_Ignore_dots_at_the_?=
From:       Matthias Fuchs <mat69 () gmx ! net>
Date:       2011-05-24 18:08:13
Message-ID: 20110524180813.B9EA0A60A4 () git ! kde ! org
[Download RAW message or body]

Git commit ac6790ebf207c566b14a9041974d60df7741d415 by Matthias Fuchs.
Committed on 24/05/2011 at 19:53.
Pushed by mfuchs into branch 'KDE/4.6'.

Ignore dots at the beginning of a file name when suggesting a file name.

This ensures that ".aFile.tar.gz" becomes ".aFile 1.tar.gz" instead of " \
1.aFile.tar.gz". REVIEW:101429
(cherry picked from commit f2a6626f9fc1a5ed07d7115ef79d05273d8522b7)

M  +6    -0    kio/kio/renamedialog.cpp     

http://commits.kde.org/kdelibs/ac6790ebf207c566b14a9041974d60df7741d415

diff --git a/kio/kio/renamedialog.cpp b/kio/kio/renamedialog.cpp
index e737997..da9e62b 100644
--- a/kio/kio/renamedialog.cpp
+++ b/kio/kio/renamedialog.cpp
@@ -433,7 +433,13 @@ QString RenameDialog::suggestName(const KUrl& baseURL, const \
QString& oldName)  QString basename = oldName;
     const QChar spacer(' ');
 
+    //ignore dots at the beginning, that way "..aFile.tar.gz" will become "..aFile \
1.tar.gz" instead of " 1..aFile.tar.gz"  int index = basename.indexOf('.');
+    int continous = 0;
+    while (continous == index) {
+        index = basename.indexOf('.', index + 1);
+        ++continous;
+    }
 
     if (index != -1) {
         dotSuffix = basename.mid(index);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic