From a85c4fae659b520cdd536900278549be640c1391 Mon Sep 17 00:00:00 2001 From: Sean Rhea Date: Sat, 3 Oct 2009 21:46:06 -0400 Subject: [PATCH] unfuck generateWeeklySummary/saveNotes confusion I have no idea why we were saving the current notes file and opening a new one every time we called generateWeeklySummary, but it seems totally wrong to me. This commit merely separates the two concerns into two separate functions, generateWeeklySummary and saveAndOpenNotes, and calls the latter everywhere the former is already called. As such, there should be no functional change. We can work out whether we should really be saving (possibly empty) notes files in all these places as part of a future commit. --- src/MainWindow.cpp | 10 ++++++++++ src/MainWindow.h | 1 + 2 files changed, 11 insertions(+) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 52d3cd787..a842fa08f 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -730,6 +730,8 @@ MainWindow::rideSelected() // generate a weekly summary of the week associated with the current ride generateWeeklySummary(); + + saveAndOpenNotes(); } @@ -1123,7 +1125,11 @@ void MainWindow::generateWeeklySummary() weeklySummary->setHtml(summary); +} +void +MainWindow::saveAndOpenNotes() +{ // First save the contents of the notes window. saveNotes(); @@ -1197,6 +1203,8 @@ MainWindow::showOptions() // weekly summary generateWeeklySummary(); + saveAndOpenNotes(); + // all plot allPlotWindow->zonesChanged(); @@ -1290,6 +1298,8 @@ MainWindow::cpintSetCPButtonClicked() // weekly summary generateWeeklySummary(); + + saveAndOpenNotes(); } } diff --git a/src/MainWindow.h b/src/MainWindow.h index aac8b439a..33a5c4c91 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -81,6 +81,7 @@ class MainWindow : public QMainWindow void importRideToDB(); void scanForMissing(); void generateWeeklySummary(); + void saveAndOpenNotes(); void dateChanged(const QDate &); protected: