summaryrefslogtreecommitdiff
path: root/src/lib/release_notes.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-08-29 01:12:46 +0200
committerCarl Hetherington <cth@carlh.net>2022-08-29 01:12:46 +0200
commitde89da97f4c2fb73426697a16cf8027490e91bae (patch)
treec19bb8e9291757ea819e9d67a619e9919e6ae67a /src/lib/release_notes.cc
parenta64f55f3a55ae8db95022ff8b5574c1eb4f2dc9f (diff)
Make find_release_notes() more testable.
Diffstat (limited to 'src/lib/release_notes.cc')
-rw-r--r--src/lib/release_notes.cc14
1 files changed, 8 insertions, 6 deletions
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<string>
-find_release_notes()
+find_release_notes(optional<string> 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("<h1>DCP-o-matic %1 release notes</h1>", current);
+ const string header = String::compose("<h1>DCP-o-matic %1 release notes</h1>", *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 "