diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index 9af387567..80e481315 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -18,7 +18,6 @@ */ #include -#include #include "rtwindow.h" #include "options.h" #include "preferences.h" @@ -315,37 +314,27 @@ void RTWindow::on_realize () // Display release notes only if new major version. // Pattern matches "5.1" from "5.1-23-g12345678" - std::string vs[] = {versionString, options.version}; - std::regex pat ("(^[0-9.]+).*"); - std::smatch sm; + const std::string vs[] = {versionString, options.version}; std::vector vMajor; - for (const auto &v : vs) { - if (std::regex_match (v, sm, pat)) { - if (sm.size() == 2) { - std::ssub_match smsub = sm[1]; - vMajor.push_back (smsub.str()); - } - } + for (const auto& v : vs) { + vMajor.emplace_back(v, 0, v.find_first_not_of("0123456789.")); } - if (vMajor.size() == 2) { - if (vMajor[0] != vMajor[1]) { + if (vMajor.size() == 2 && vMajor[0] != vMajor[1]) { + // Update the version parameter with the right value + options.version = versionString; - // Update the version parameter with the right value - options.version = versionString; + splash = new Splash (*this); + splash->set_transient_for (*this); + splash->signal_delete_event().connect ( sigc::mem_fun (*this, &RTWindow::splashClosed) ); - splash = new Splash (*this); - splash->set_transient_for (*this); - splash->signal_delete_event().connect ( sigc::mem_fun (*this, &RTWindow::splashClosed) ); - - if (splash->hasReleaseNotes()) { - splash->showReleaseNotes(); - splash->show (); - } else { - delete splash; - splash = nullptr; - } + if (splash->hasReleaseNotes()) { + splash->showReleaseNotes(); + splash->show (); + } else { + delete splash; + splash = nullptr; } } } diff --git a/rtgui/xtransprocess.cc b/rtgui/xtransprocess.cc index a663ac7c5..453f0a53d 100644 --- a/rtgui/xtransprocess.cc +++ b/rtgui/xtransprocess.cc @@ -19,7 +19,7 @@ #include "xtransprocess.h" #include "options.h" #include "guiutils.h" -#include + using namespace rtengine; using namespace rtengine::procparams; @@ -30,8 +30,30 @@ XTransProcess::XTransProcess () : FoldableToolPanel(this, "xtransprocess", M("TP method = Gtk::manage (new MyComboBoxText ()); for( size_t i = 0; i < procparams::RAWParams::XTransSensor::numMethods; i++) { - static const std::regex what ("[() -]"); - const std::string langKey = std::regex_replace (procparams::RAWParams::XTransSensor::methodstring[i], what, ""); + const std::string langKey = + [i]() -> std::string + { + const std::string str(procparams::RAWParams::XTransSensor::methodstring[i]); + + std::string res; + for (const auto& c : str) { + switch (c) { + case '(': + case ')': + case ' ': + case '-': { + continue; + } + + default: { + res += c; + break; + } + } + } + + return res; + }(); method->append(M("TP_RAW_" + Glib::ustring(langKey).uppercase())); }