From 099662023c89f5bb0a3e2e1b803de22d56b20f6b Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 11 Dec 2017 23:20:18 +0100 Subject: Move resetting of current file out of clear_dive_file_data() This is the only case where C-code sets the current file. Remove this call for a better separation of C-backend and C++-frontend parts. There were four callers of clear_dive_file_data(). Two of them would call set_filename() anyway. For the remaining two add an explicit call to set_filename(). This commit fixes a bug introduced in commit b3901aa8f90499ee2a34efdddc2463105afc53f1: The cloud-online menu entry was still enabled after "closing" the cloud storage. Signed-off-by: Berthold Stoeger --- desktop-widgets/mainwindow.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'desktop-widgets') diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 4aa4aa1b6..b13980c85 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -746,6 +746,7 @@ void MainWindow::closeCurrentFile() /* free the dives and trips */ clear_git_id(); clear_dive_file_data(); + setCurrentFile(NULL); cleanUpEmpty(); mark_divelist_changed(false); -- cgit v1.2.3-70-g09d2