From ae1d441dacef7e52984201abdc9a918ce060021c Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Tue, 13 Oct 2020 11:51:59 -0600 Subject: Show home folder if needed after unmounting mounted disk Right now, when you unmount a device that any active view containers are displaying, nothing in the view changes. As a result, it's possible to try to navigate to files or folders in that view, which cannot be done because the disk that the files or folders are located on has been unmounted! With this commit, we detect that case and switch the view containers to show the home folder after the disk whose contents they are displaying gets unmounted. BUG: 158934 FIXED-IN: 20.12 --- src/dolphinmainwindow.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/dolphinmainwindow.h') diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h index c03eb1be0..80d0f891a 100644 --- a/src/dolphinmainwindow.h +++ b/src/dolphinmainwindow.h @@ -92,7 +92,15 @@ public: */ KNewFileMenu* newFileMenu() const; - void setTabsToHomeIfMountPathOpen(const QString& mountPath); + /** + * Switch the window's view containers' locations to display the home path + * for any which are currently displaying a location corresponding to or + * within mountPath. + * + * This typically done after unmounting a disk at mountPath to ensure that + * the window is not displaying an invalid location. + */ + void setViewsToHomeIfMountPathOpen(const QString& mountPath); public slots: /** -- cgit v1.3