mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 08:08:42 +00:00
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.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -81,6 +81,7 @@ class MainWindow : public QMainWindow
|
||||
void importRideToDB();
|
||||
void scanForMissing();
|
||||
void generateWeeklySummary();
|
||||
void saveAndOpenNotes();
|
||||
void dateChanged(const QDate &);
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user