Refactor: Move Semver from slice3r to libslic3r

A static symbol Slic3r::SEMVER is introduced, which holds
the running slicer's Semver object.

This is mainly done to make testing updater behaviour
_much_ easier. Additionaly to cleanup some questionable code
(Semver was being parsed multiple times / in multiple places
in the frontend.)
This commit is contained in:
Vojtech Kral 2019-08-09 17:01:37 +02:00
parent b5dd13b987
commit 745182988d
13 changed files with 21 additions and 27 deletions

View file

@ -366,7 +366,7 @@ const Snapshot& SnapshotDB::take_snapshot(const AppConfig &app_config, Snapshot:
// Snapshot header.
snapshot.time_captured = Slic3r::Utils::get_current_time_utc();
snapshot.id = Slic3r::Utils::format_time_ISO8601Z(snapshot.time_captured);
snapshot.slic3r_version_captured = *Semver::parse(SLIC3R_VERSION); // XXX: have Semver Slic3r version
snapshot.slic3r_version_captured = Slic3r::SEMVER;
snapshot.comment = comment;
snapshot.reason = reason;
// Active presets at the time of the snapshot.