From de89da97f4c2fb73426697a16cf8027490e91bae Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 29 Aug 2022 01:12:46 +0200 Subject: Make find_release_notes() more testable. --- src/lib/release_notes.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/lib/release_notes.cc') diff --git a/src/lib/release_notes.cc b/src/lib/release_notes.cc index b1eb95257..face4df2c 100644 --- a/src/lib/release_notes.cc +++ b/src/lib/release_notes.cc @@ -31,19 +31,21 @@ using boost::optional; optional -find_release_notes() +find_release_notes(optional current) { auto last = Config::instance()->last_release_notes_version(); - auto current = string(dcpomatic_version); - if (last && *last == current) { + if (!current) { + current = string(dcpomatic_version); + } + if (last && *last == *current) { return {}; } - Config::instance()->set_last_release_notes_version(current); + Config::instance()->set_last_release_notes_version(*current); - const string header = String::compose("

DCP-o-matic %1 release notes

", current); + const string header = String::compose("

DCP-o-matic %1 release notes

", *current); - if (current == "2.16.18") { + if (*current == "2.16.18") { return header + _("In this version there are changes to the way that subtitles are positioned. " "Positioning should now be more correct, with respect to the standards, but you " -- cgit v1.2.3