┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMéven Car <[email protected]>2025-11-02 13:13:43 +0000
committerMéven Car <[email protected]>2025-11-02 13:13:43 +0000
commita9cbac74aafe1ce3c5ec37010b84ea8a40035941 (patch)
tree2a36b988dbbe246b3507071ae04d61304c6b713b /src
parent7658269f73e21ac27b81e9743770bf5db5f5a8e8 (diff)
Revert "Make create folder use selected directory !1026"
This reverts merge request !1035 65bb95f5 This simply made an unexpected behavior change, opposite to most users expectations. https://discuss.kde.org/t/slightly-strange-behaviour-in-dolphin/40209/33 Disregarding https://en.wikipedia.org/wiki/Principle_of_least_astonishment (Occam's razor) Having different behavior when there a folder selected + shortcut, and a folder selected + context menu should be considered different use case. One has a strong context established, the other has no context from the user perspective. BUG: 510757 CCBUG: 508196 It re-introduces 508196
Diffstat (limited to 'src')
-rw-r--r--src/dolphinmainwindow.cpp22
1 files changed, 2 insertions, 20 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index 7d8e406c2..dd11b67f7 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -830,16 +830,7 @@ void DolphinMainWindow::createDirectory()
// just check if we are already running one. This prevents opening multiple
// dialogs. BUG:481401
if (!m_newFileMenu->isCreateDirectoryRunning()) {
- QUrl targetDirectory = activeViewContainer()->url();
-
- // Check if there's a single selected directory to create the new folder inside
- // This makes Ctrl+Shift+N behavior consistent with right-click context menu
- const KFileItemList selectedItems = m_activeViewContainer->view()->selectedItems();
- if (selectedItems.count() == 1 && selectedItems.first().isDir()) {
- targetDirectory = selectedItems.first().url();
- }
-
- m_newFileMenu->setWorkingDirectory(targetDirectory);
+ m_newFileMenu->setWorkingDirectory(activeViewContainer()->url());
m_newFileMenu->createDirectory();
}
}
@@ -848,16 +839,7 @@ void DolphinMainWindow::createFile()
{
// Use the same logic as in createDirectory()
if (!m_newFileMenu->isCreateFileRunning()) {
- QUrl targetDirectory = activeViewContainer()->url();
-
- // Check if there's a single selected directory to create the new file inside
- // This makes the create file action consistent with create directory
- const KFileItemList selectedItems = m_activeViewContainer->view()->selectedItems();
- if (selectedItems.count() == 1 && selectedItems.first().isDir()) {
- targetDirectory = selectedItems.first().url();
- }
-
- m_newFileMenu->setWorkingDirectory(targetDirectory);
+ m_newFileMenu->setWorkingDirectory(activeViewContainer()->url());
m_newFileMenu->createFile();
}
}