Merge branch 'lessrelnotes' into dev
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
|
||||
#include <gtkmm.h>
|
||||
#include <regex>
|
||||
#include "rtwindow.h"
|
||||
#include "options.h"
|
||||
#include "preferences.h"
|
||||
@@ -319,8 +320,23 @@ void RTWindow::on_realize ()
|
||||
|
||||
mainWindowCursorManager.init(get_window());
|
||||
|
||||
// Check if first run of this version, then display the Release Notes text
|
||||
if (options.version != versionString) {
|
||||
// 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;
|
||||
std::vector<std::string> 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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (vMajor.size() == 2) {
|
||||
if (vMajor[0] != vMajor[1]) {
|
||||
|
||||
// Update the version parameter with the right value
|
||||
options.version = versionString;
|
||||
@@ -337,6 +353,7 @@ void RTWindow::on_realize ()
|
||||
splash = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool RTWindow::on_window_state_event(GdkEventWindowState* event)
|
||||
|
Reference in New Issue
Block a user