diff --git a/src/filewidgets/knewfilemenu.cpp b/src/filewidgets/knewfilemenu.cpp
--- a/src/filewidgets/knewfilemenu.cpp
+++ b/src/filewidgets/knewfilemenu.cpp
@@ -858,18 +858,18 @@
url = QUrl::fromLocalFile(name);
} else {
if (name == QLatin1String(".") || name == QLatin1String("..")) {
- KGuiItem cancelGuiItem(KStandardGuiItem::cancel());
- cancelGuiItem.setText(i18nc("@action:button", "Enter a Different Name"));
- cancelGuiItem.setIcon(QIcon::fromTheme(QStringLiteral("edit-rename")));
+ KGuiItem enterNewNameGuiItem(KStandardGuiItem::ok());
+ enterNewNameGuiItem.setText(i18nc("@action:button", "Enter a Different Name"));
+ enterNewNameGuiItem.setIcon(QIcon::fromTheme(QStringLiteral("edit-rename")));
QDialog *confirmDialog = new QDialog(m_parentWidget);
confirmDialog->setWindowTitle(i18n("Invalid Directory Name"));
confirmDialog->setModal(m_modal);
confirmDialog->setAttribute(Qt::WA_DeleteOnClose);
QDialogButtonBox *buttonBox = new QDialogButtonBox(confirmDialog);
- buttonBox->setStandardButtons(QDialogButtonBox::Cancel);
- KGuiItem::assign(buttonBox->button(QDialogButtonBox::Cancel), cancelGuiItem);
+ buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
+ KGuiItem::assign(buttonBox->button(QDialogButtonBox::Ok), enterNewNameGuiItem);
KMessageBox::createKMessageBox(confirmDialog, buttonBox, QMessageBox::Critical,
xi18n("Could not create a folder with the name %1because it is reserved for use by the operating system.", name),
@@ -879,7 +879,7 @@
KMessageBox::NoExec,
QString());
- QObject::connect(buttonBox, SIGNAL(rejected()), q, SLOT(createDirectory()));
+ QObject::connect(buttonBox, SIGNAL(accepted()), q, SLOT(createDirectory()));
m_fileDialog = confirmDialog;
confirmDialog->show();
_k_slotAbortDialog();