summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-06-02 16:25:11 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-06-02 16:25:11 +0300
commitbbd407248cc32744fcbbaec5c0700d9309fa5567 (patch)
treee5cadcc414808138178cd60217704e1039c62157
parente8ab6cc70a81644e01527753c81790de2b609841 (diff)
fixes #3085 (Миранда отказывается обновиться с ночника на стабильную версию)
-rw-r--r--plugins/PluginUpdater/src/Options.cpp13
-rw-r--r--plugins/PluginUpdater/src/PluginUpdater.cpp1
-rw-r--r--plugins/PluginUpdater/src/Utils.cpp5
-rw-r--r--plugins/PluginUpdater/src/stdafx.h2
-rw-r--r--plugins/PluginUpdater/src/version.h2
5 files changed, 11 insertions, 12 deletions
diff --git a/plugins/PluginUpdater/src/Options.cpp b/plugins/PluginUpdater/src/Options.cpp
index 77ba888162..5ca1a139bb 100644
--- a/plugins/PluginUpdater/src/Options.cpp
+++ b/plugins/PluginUpdater/src/Options.cpp
@@ -21,14 +21,14 @@ Boston, MA 02111-1307, USA.
static int GetUpdateMode()
{
- int UpdateMode = g_plugin.getByte(DB_SETTING_UPDATE_MODE, -1);
+ int UpdateMode = g_plugin.iUpdateMode;
// Check if there is url for custom mode
if (UpdateMode == UPDATE_MODE_CUSTOM) {
ptrW url(g_plugin.getWStringA(DB_SETTING_UPDATE_URL));
if (url == NULL || !wcslen(url)) {
// No url for custom mode, reset that setting so it will be determined automatically
- g_plugin.delSetting(DB_SETTING_UPDATE_MODE);
+ g_plugin.iUpdateMode.Delete();
UpdateMode = -1;
}
}
@@ -162,9 +162,8 @@ public:
chkStable.Disable();
// Reset setting if needed
- int UpdateMode = g_plugin.getByte(DB_SETTING_UPDATE_MODE, UPDATE_MODE_STABLE);
- if (UpdateMode == UPDATE_MODE_STABLE)
- g_plugin.setByte(DB_SETTING_UPDATE_MODE, UPDATE_MODE_TRUNK);
+ if (g_plugin.iUpdateMode == UPDATE_MODE_STABLE)
+ g_plugin.iUpdateMode = UPDATE_MODE_TRUNK;
chkStable.SetText(LPGENW("Stable version (incompatible with current development version)"));
}
@@ -245,8 +244,8 @@ public:
bool bStartUpdate = false;
// Repository was changed, force recheck
- if (g_plugin.getByte(DB_SETTING_UPDATE_MODE, UPDATE_MODE_STABLE) != iNewMode) {
- g_plugin.setByte(DB_SETTING_UPDATE_MODE, iNewMode);
+ if (g_plugin.iUpdateMode != iNewMode) {
+ g_plugin.iUpdateMode = iNewMode;
if (!bNoSymbols)
g_plugin.bForceRedownload = true;
bStartUpdate = true;
diff --git a/plugins/PluginUpdater/src/PluginUpdater.cpp b/plugins/PluginUpdater/src/PluginUpdater.cpp
index 71d9992092..53afcf5fae 100644
--- a/plugins/PluginUpdater/src/PluginUpdater.cpp
+++ b/plugins/PluginUpdater/src/PluginUpdater.cpp
@@ -62,6 +62,7 @@ CMPlugin::CMPlugin() :
iPeriod(MODULENAME, "Period", 1),
iPeriodMeasure(MODULENAME, "PeriodMeasure", 1),
iNumberBackups(MODULENAME, "NumberOfBackups", 3),
+ iUpdateMode(MODULENAME, "UpdateMode", -1),
dwLastUpdate(MODULENAME, "LastUpdate", 0)
{
}
diff --git a/plugins/PluginUpdater/src/Utils.cpp b/plugins/PluginUpdater/src/Utils.cpp
index f448eabc11..0ba835a2e0 100644
--- a/plugins/PluginUpdater/src/Utils.cpp
+++ b/plugins/PluginUpdater/src/Utils.cpp
@@ -113,9 +113,8 @@ bool ParseHashes(const wchar_t *pwszUrl, ptrW &baseUrl, SERVLIST &arHashes)
if (bDoNotSwitchToStable) {
g_plugin.setByte(DB_SETTING_DONT_SWITCH_TO_STABLE, 1);
// Reset setting if needed
- int UpdateMode = g_plugin.getByte(DB_SETTING_UPDATE_MODE, UPDATE_MODE_STABLE);
- if (UpdateMode == UPDATE_MODE_STABLE)
- g_plugin.setByte(DB_SETTING_UPDATE_MODE, UPDATE_MODE_TRUNK);
+ if (g_plugin.iUpdateMode == UPDATE_MODE_STABLE)
+ g_plugin.iUpdateMode = UPDATE_MODE_TRUNK;
}
else g_plugin.setByte(DB_SETTING_DONT_SWITCH_TO_STABLE, 0);
diff --git a/plugins/PluginUpdater/src/stdafx.h b/plugins/PluginUpdater/src/stdafx.h
index 56ba6951ff..1b12ca6606 100644
--- a/plugins/PluginUpdater/src/stdafx.h
+++ b/plugins/PluginUpdater/src/stdafx.h
@@ -132,7 +132,6 @@ enum
UPDATE_MODE_MAX_VALUE // leave this variable last in the list
};
-#define DB_SETTING_UPDATE_MODE "UpdateMode"
#define DB_SETTING_UPDATE_URL "UpdateURL"
#define DB_SETTING_DONT_SWITCH_TO_STABLE "DontSwitchToStable"
@@ -181,6 +180,7 @@ struct CMPlugin : public PLUGIN<CMPlugin>
// common options
CMOption<bool> bUpdateOnStartup, bUpdateOnPeriod, bOnlyOnceADay, bSilentMode, bBackup, bChangePlatform, bAutoRestart, bNeedRestart;
CMOption<int> iPeriod, iPeriodMeasure, iNumberBackups;
+ CMOption<uint8_t> iUpdateMode;
CMOption<uint32_t> dwLastUpdate;
// popup options
diff --git a/plugins/PluginUpdater/src/version.h b/plugins/PluginUpdater/src/version.h
index dc65e6a1bc..2e3c23b608 100644
--- a/plugins/PluginUpdater/src/version.h
+++ b/plugins/PluginUpdater/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 2
#define __RELEASE_NUM 1
-#define __BUILD_NUM 2
+#define __BUILD_NUM 3
#include <stdver.h>