From 7fbb09d4caa77616a0d01dd17881fdbe16be69bd Mon Sep 17 00:00:00 2001 From: Kimmo Pekkola Date: Sun, 2 Aug 2009 11:32:12 +0000 Subject: [PATCH] Updated the version number for the upcoming release candidate. --- Library/MeterWindow.cpp | 11 +++++++++-- Library/Rainmeter.h | 6 +++--- Library/UpdateCheck.cpp | 20 +++++++++++++++----- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/Library/MeterWindow.cpp b/Library/MeterWindow.cpp index b3761c2f..eff76b33 100644 --- a/Library/MeterWindow.cpp +++ b/Library/MeterWindow.cpp @@ -1311,8 +1311,15 @@ void CMeterWindow::ReadSkin() { WCHAR buffer[256]; std::wstring text; - wsprintf(buffer, L"%i.%i", appVersion / 1000, appVersion % 1000); - text = L"This skin needs Rainmeter version 0."; + if (appVersion % 1000 != 0) + { + wsprintf(buffer, L"%i.%i.%i", appVersion / 1000000, (appVersion / 1000) % 1000, appVersion % 1000); + } + else + { + wsprintf(buffer, L"%i.%i", appVersion / 1000000, appVersion / 1000); + } + text = L"This skin needs Rainmeter version "; text += buffer; text += L" or newer.\nIt might not function as well as it should.\nYou should get an updated version or Rainmeter\nfrom http://www.rainmeter.net"; MessageBox(m_Window, text.c_str(), L"Rainmeter", MB_OK); diff --git a/Library/Rainmeter.h b/Library/Rainmeter.h index 98cc3836..625c2413 100644 --- a/Library/Rainmeter.h +++ b/Library/Rainmeter.h @@ -29,16 +29,16 @@ #define MAX_LINE_LENGTH 4096 -#define MAKE_VER(major, minor) major * 1000 + minor +#define MAKE_VER(major, minor1, minor2) major * 1000000 + minor1 * 1000 + minor2 #define APPNAME L"Rainmeter" -#define APPVERSION L"0.14.1" +#define APPVERSION L"1.0" #ifdef _WIN64 #define APPBITS L"(64-bit)" #else #define APPBITS L"(32-bit)" #endif -#define RAINMETER_VERSION MAKE_VER(14, 1) +#define RAINMETER_VERSION MAKE_VER(1, 0, 0) enum PLATFORM { diff --git a/Library/UpdateCheck.cpp b/Library/UpdateCheck.cpp index 94fefeb0..3fe79860 100644 --- a/Library/UpdateCheck.cpp +++ b/Library/UpdateCheck.cpp @@ -52,13 +52,23 @@ void CheckVersion(void* dummy) size_t pos = verStr.find('.'); if (pos != std::wstring::npos) { - std::string verStr1 = verStr.substr(pos + 1); - version = atoi(verStr1.c_str()) * 1000; - pos = verStr.find('.', pos + 1); + std::string verMajor = verStr.substr(0, pos); + std::string verMinor = verStr.substr(pos + 1); + + version = atoi(verMajor.c_str()) * 1000000; + + pos = verMinor.find('.'); if (pos != std::wstring::npos) { - std::string verStr1 = verStr.substr(pos + 1); - version += atoi(verStr1.c_str()); + std::string verMinor1 = verMinor.substr(0, pos); + std::string verMinor2 = verMinor.substr(pos + 1); + + version += atoi(verMinor1.c_str()) * 1000; + version += atoi(verMinor2.c_str()); + } + else + { + version += atoi(verMinor.c_str()) * 1000; } }