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:
Sean Rhea
2009-10-03 21:46:06 -04:00
parent 18916aea7f
commit a85c4fae65
2 changed files with 11 additions and 0 deletions

View File

@@ -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();
}
}

View File

@@ -81,6 +81,7 @@ class MainWindow : public QMainWindow
void importRideToDB();
void scanForMissing();
void generateWeeklySummary();
void saveAndOpenNotes();
void dateChanged(const QDate &);
protected: