From c2db2acd20da036f2a4b14d08e8f290c9c1034ca Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Thu, 2 May 2013 23:00:26 +0200 Subject: [PATCH] Now using a separate version/build number for the configuration, so INI settings don't get invalidated with each build. --- LameXP.rc | 3 ++- src/Config.h | 11 ++++++++--- src/Global.cpp | 8 ++++++-- src/Global.h | 1 + src/Model_Settings.cpp | 4 ++-- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/LameXP.rc b/LameXP.rc index b99a203e..7d4a0014 100644 --- a/LameXP.rc +++ b/LameXP.rc @@ -1,7 +1,8 @@ // Microsoft Visual C++ generated resource script. // -#include "src/Resource.h" +#define LAMEXP_INC_CONFIG #include "src/Config.h" +#include "src/Resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// diff --git a/src/Config.h b/src/Config.h index c3580044..bd8861a3 100644 --- a/src/Config.h +++ b/src/Config.h @@ -21,16 +21,21 @@ #pragma once +#ifndef LAMEXP_INC_CONFIG +#error Please do *not* include CONFIG.H directly! +#endif + /////////////////////////////////////////////////////////////////////////////// // LameXP Version Info /////////////////////////////////////////////////////////////////////////////// #define VER_LAMEXP_MAJOR 4 #define VER_LAMEXP_MINOR_HI 0 -#define VER_LAMEXP_MINOR_LO 7 -#define VER_LAMEXP_TYPE Final +#define VER_LAMEXP_MINOR_LO 8 +#define VER_LAMEXP_TYPE Alpha #define VER_LAMEXP_PATCH 1 -#define VER_LAMEXP_BUILD 1286 +#define VER_LAMEXP_BUILD 1288 +#define VER_LAMEXP_CONFG 1288 /////////////////////////////////////////////////////////////////////////////// // LameXP Build Options diff --git a/src/Global.cpp b/src/Global.cpp index 72e0e762..a1ed5d8d 100644 --- a/src/Global.cpp +++ b/src/Global.cpp @@ -50,6 +50,7 @@ #include //LameXP includes +#define LAMEXP_INC_CONFIG #include "Resource.h" #include "Config.h" #include "LockedFile.h" @@ -124,14 +125,16 @@ static const struct unsigned int ver_major; unsigned int ver_minor; unsigned int ver_build; + unsigned int ver_confg; char *ver_release_name; } g_lamexp_version = { VER_LAMEXP_MAJOR, - VER_LAMEXP_MINOR, + (10 * VER_LAMEXP_MINOR_HI) + VER_LAMEXP_MINOR_LO, VER_LAMEXP_BUILD, - VER_LAMEXP_RNAME + VER_LAMEXP_CONFG, + VER_LAMEXP_RNAME, }; //Build date @@ -349,6 +352,7 @@ const char* LAMEXP_DEFAULT_TRANSLATION = "LameXP_EN.qm"; unsigned int lamexp_version_major(void) { return g_lamexp_version.ver_major; } unsigned int lamexp_version_minor(void) { return g_lamexp_version.ver_minor; } unsigned int lamexp_version_build(void) { return g_lamexp_version.ver_build; } +unsigned int lamexp_version_confg(void) { return g_lamexp_version.ver_confg; } const char *lamexp_version_release(void) { return g_lamexp_version.ver_release_name; } const char *lamexp_version_time(void) { return g_lamexp_version_raw_time; } const char *lamexp_version_compiler(void) { return g_lamexp_version_compiler; } diff --git a/src/Global.h b/src/Global.h index 4591494e..5f8fcad8 100644 --- a/src/Global.h +++ b/src/Global.h @@ -96,6 +96,7 @@ lamexp_os_version_t; unsigned int lamexp_version_major(void); unsigned int lamexp_version_minor(void); unsigned int lamexp_version_build(void); +unsigned int lamexp_version_confg(void); const QDate &lamexp_version_date(void); const char *lamexp_version_time(void); const char *lamexp_version_release(void); diff --git a/src/Model_Settings.cpp b/src/Model_Settings.cpp index 21de4438..4340784b 100644 --- a/src/Model_Settings.cpp +++ b/src/Model_Settings.cpp @@ -176,7 +176,7 @@ SettingsModel::SettingsModel(void) } m_settings = new QSettings(configPath, QSettings::IniFormat); - const QString groupKey = QString().sprintf("LameXP_%u%02u%05u", lamexp_version_major(), lamexp_version_minor(), lamexp_version_build()); + const QString groupKey = QString().sprintf("LameXP_%u%02u%05u", lamexp_version_major(), lamexp_version_minor(), lamexp_version_confg()); QStringList childGroups = m_settings->childGroups(); while(!childGroups.isEmpty()) @@ -187,7 +187,7 @@ SettingsModel::SettingsModel(void) { bool ok = false; unsigned int temp = filter.cap(3).toUInt(&ok) + 10; - if(ok && (temp >= lamexp_version_build())) + if(ok && (temp >= lamexp_version_confg())) { continue; }