Commit fb190faa authored by Emmanuel Pescosta's avatar Emmanuel Pescosta

Fix Bug 240820 - [Usability Bug] Handling Bad Filenames, dolphin gives unclear error message

Fix Bug 308597 - Regression: Renaming a file/folder to something that contains a "/" will result in several message boxes

Uses the same solution as Dolphin-Rename-Dialog does. (KIO::encodeFileName)

BUG: 240820
BUG: 308597
REVIEW: 107681
FIXED-IN: 4.9.5
parent 2ec0a675
......@@ -20,6 +20,7 @@
#include "kitemlistroleeditor.h"
#include <KDebug>
#include <kio/global.h>
#include <QKeyEvent>
KItemListRoleEditor::KItemListRoleEditor(QWidget *parent) :
......@@ -93,7 +94,7 @@ void KItemListRoleEditor::keyPressEvent(QKeyEvent* event)
// a roleEditingFinished signal (see KItemListRoleEditor::event),
// which is not wanted in this case.
m_blockFinishedSignal = true;
emit roleEditingCanceled(m_index, m_role, toPlainText());
emit roleEditingCanceled(m_index, m_role, KIO::encodeFileName(toPlainText()));
m_blockFinishedSignal = false;
event->accept();
return;
......@@ -137,7 +138,7 @@ void KItemListRoleEditor::autoAdjustSize()
void KItemListRoleEditor::emitRoleEditingFinished()
{
if (!m_blockFinishedSignal) {
emit roleEditingFinished(m_index, m_role, toPlainText());
emit roleEditingFinished(m_index, m_role, KIO::encodeFileName(toPlainText()));
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment