From 0cab1f1762d1cf2aca473d47f0cb0f060b9d709c Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 9 May 2019 10:17:02 +0200 Subject: [PATCH] Fix directory used for "Find in This Directory" If the input already is a directory, we want to search in that, not the parent. Fixes: QTCREATORBUG-22079 Change-Id: If47435ecf2ffba088d50b57c18c8b1ee444fd718 Reviewed-by: Christian Kandeler --- src/plugins/coreplugin/editormanager/editormanager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index a0fd5bdc7e8..1dc2236873b 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -2296,7 +2296,9 @@ void EditorManagerPrivate::findInDirectory() { if (!d->m_contextMenuEntry || d->m_contextMenuEntry->fileName().isEmpty()) return; - emit m_instance->findOnFileSystemRequest(d->m_contextMenuEntry->fileName().parentDir().toString()); + const FileName path = d->m_contextMenuEntry->fileName(); + emit m_instance->findOnFileSystemRequest( + (path.toFileInfo().isDir() ? path : path.parentDir()).toString()); } void EditorManagerPrivate::split(Qt::Orientation orientation)