diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -1574,6 +1574,30 @@ QUrl newUrl = oldUrl.adjusted(QUrl::RemoveFilename); newUrl.setPath(newUrl.path() + KIO::encodeFileName(newName)); +#ifndef Q_OS_WIN + //Confirm hiding file/folder by renaming renameInline + if (newName.startsWith(QChar('.')) && !oldItem.name().startsWith(QChar('.'))) { + const QString item = oldItem.isFile() ? QLatin1String("file") : QLatin1String("folder"); + KGuiItem continueGuiItem(KStandardGuiItem::cont()); + continueGuiItem.setText(i18nc("@action:button", "Rename and hide")); + const int code = KMessageBox::warningContinueCancel(nullptr, + i18n("The %1 name starts with a dot, hence it will be hidden by default.", item), + i18n("Hide this %1?", item), + continueGuiItem, + KStandardGuiItem::cancel(), + i18n(":Don not ask again"), + KMessageBox::Notify + ); + if (code == KMessageBox::Continue) { + goto label; + } else { + return; + } + } +#endif + + label: + const bool newNameExistsAlready = (m_model->index(newUrl) >= 0); if (!newNameExistsAlready) { // Only change the data in the model if no item with the new name