diff --git a/krusader/Panel/panelfunc.cpp b/krusader/Panel/panelfunc.cpp --- a/krusader/Panel/panelfunc.cpp +++ b/krusader/Panel/panelfunc.cpp @@ -640,7 +640,21 @@ void ListPanelFunc::rename(const QString &oldname, const QString &newname) { if (oldname == newname) - return ; // do nothing + return; // do nothing + +#ifndef Q_WS_WIN + // If the item that is going to be renamed is also going to be hidden by default + if (newname.startsWith(QLatin1Char('.')) && !oldname.startsWith(QLatin1Char('.'))) { + // Note: Thanks to KDE Dolphin developers (https://phabricator.kde.org/D15980) + if (KMessageBox::warningContinueCancel(krMainWindow, + i18n("Adding a dot to the beginning of this item's name will hide it by default.\n" + "Do you still want to rename it?"), + i18n("Make this item hidden by default?") + ) != KMessageBox::Continue) { + return; + } + } +#endif // set current after rename panel->view->setNameToMakeCurrent(newname);