From 60e109632fd63b335ca1cc037c5d5c3e291349f5 Mon Sep 17 00:00:00 2001 From: Méven Car Date: Sun, 2 Nov 2025 15:49:47 +0100 Subject: context menu: use selected item as containing folder for New file menu Use current view url as fallback. Don't update the selection after a directory is created, except if there was no selection. CCBUG: 508196 BUG: 512020 --- src/views/dolphinview.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/views/dolphinview.h') diff --git a/src/views/dolphinview.h b/src/views/dolphinview.h index 4a400ce2a..55b6b5829 100644 --- a/src/views/dolphinview.h +++ b/src/views/dolphinview.h @@ -166,6 +166,11 @@ public: */ int selectedItemsCount() const; + /** + * Returns the selected kfileitem if one is selected and only one + */ + std::optional firstSelectedItem() const; + /** * Marks the items indicated by \p urls to get selected after the * directory DolphinView::url() has been loaded. Note that nothing @@ -854,6 +859,8 @@ private Q_SLOTS: */ void observeCreatedItem(const QUrl &url); + void observeCreatedDirectory(const QUrl &url); + /** * Selects the next item after prev selection deleted/trashed */ @@ -953,6 +960,8 @@ private: bool tryShowNameToolTip(QHelpEvent *event); + void selectFileOnceAvailable(const QUrl &url, std::function condition); + private: void updatePalette(); void showLoadingPlaceholder(); -- cgit v1.3