]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Disallow renaming to names containing '/', names being equal to "." or "..".
authorMatthias Fuchs <mat69@gmx.net>
Fri, 27 May 2011 22:15:45 +0000 (00:15 +0200)
committerMatthias Fuchs <mat69@gmx.net>
Fri, 27 May 2011 23:31:45 +0000 (01:31 +0200)
BUG:211751
REVIEW:101454

src/views/renamedialog.cpp

index 810562a51a37b17e1c4bfbe0e0ece31283cd4cdf..a14ba77b7c4dca1b83bd1c0abf827506ad4e17fd 100644 (file)
@@ -148,7 +148,7 @@ void RenameDialog::slotButtonClicked(int button)
 
 void RenameDialog::slotTextChanged(const QString& newName)
 {
-    bool enable = !newName.isEmpty();
+    bool enable = !newName.isEmpty() && (newName != QLatin1String("..")) && (newName != QLatin1String(".")) && !newName.contains('/');
     if (enable) {
         if (m_renameOneItem) {
             enable = enable && (newName != m_newName);