From kde-commits Tue May 31 21:52:36 2011 From: Matthias Fuchs Date: Tue, 31 May 2011 21:52:36 +0000 To: kde-commits Subject: =?utf-8?q?=5Bkde-baseapps/KDE/4=2E6=5D_dolphin/src/views=3A_Impr?= Message-Id: <20110531215236.18CCFA60A4 () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=130687879215601 Git commit 680b8f918900b2b8b99fe5046806ca1b032867e3 by Matthias Fuchs. Committed on 31/05/2011 at 23:50. Pushed by mfuchs into branch 'KDE/4.6'. Improves 8dbc4b0752dc12121c37000c764a7e025daae4b7 by allowing "/" in file names. Though here "/" is not the ascii char '/' but the "unicode fraction slash" one, thus it is not taken as directory command. CCBUG:211751 REVIEW:101454 M +2 -2 dolphin/src/views/renamedialog.cpp http://commits.kde.org/kde-baseapps/680b8f918900b2b8b99fe5046806ca1b032867e3 diff --git a/dolphin/src/views/renamedialog.cpp b/dolphin/src/views/renamedialog.cpp index 5d1673a..5ddd1e4 100644 --- a/dolphin/src/views/renamedialog.cpp +++ b/dolphin/src/views/renamedialog.cpp @@ -139,7 +139,7 @@ void RenameDialog::slotButtonClicked(int button) void RenameDialog::slotTextChanged(const QString& newName) { - bool enable = !newName.isEmpty() && (newName != QLatin1String("..")) && (newName != QLatin1String(".")) && !newName.contains('/'); + bool enable = !newName.isEmpty() && (newName != QLatin1String("..")) && (newName != QLatin1String(".")); if (enable) { if (m_renameOneItem) { enable = enable && (newName != m_newName); @@ -176,7 +176,7 @@ void RenameDialog::renameItems() const KUrl oldUrl = item.url(); if (oldUrl.fileName() != newName) { KUrl newUrl = oldUrl; - newUrl.setFileName(newName); + newUrl.setFileName(KIO::encodeFileName(newName)); KonqOperations::rename(this, oldUrl, newUrl); } }