summaryrefslogtreecommitdiff
path: root/plugins/PluginUpdater/src/PluginUpdater.cpp
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2014-07-27 09:48:19 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2014-07-27 09:48:19 +0000
commit7197141db82f7519ed707962a03f265f576516af (patch)
treee9dc4b7e51ae3232a781da9e7a86ca83279d2859 /plugins/PluginUpdater/src/PluginUpdater.cpp
parentc4a90717ac0b7813d24d30920f1fccab0e638162 (diff)
restoring Wishmaster's PluginUpdater commits
git-svn-id: http://svn.miranda-ng.org/main/trunk@9968 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/PluginUpdater/src/PluginUpdater.cpp')
-rw-r--r--plugins/PluginUpdater/src/PluginUpdater.cpp27
1 files changed, 24 insertions, 3 deletions
diff --git a/plugins/PluginUpdater/src/PluginUpdater.cpp b/plugins/PluginUpdater/src/PluginUpdater.cpp
index 5e14fddd70..d0678e91e5 100644
--- a/plugins/PluginUpdater/src/PluginUpdater.cpp
+++ b/plugins/PluginUpdater/src/PluginUpdater.cpp
@@ -135,9 +135,30 @@ extern "C" __declspec(dllexport) int Load(void)
InitEvents();
- //add sounds
- SkinAddNewSoundEx("updatecompleted",LPGEN("Plugin Updater"),LPGEN("Update completed"));
- SkinAddNewSoundEx("updatefailed",LPGEN("Plugin Updater"),LPGEN("Update failed"));
+ // add sounds
+ SkinAddNewSoundEx("updatecompleted", LPGEN("Plugin Updater"), LPGEN("Update completed"));
+ SkinAddNewSoundEx("updatefailed", LPGEN("Plugin Updater"), LPGEN("Update failed"));
+
+ // Upgrade old settings
+ if (-1 == db_get_b(0, MODNAME, "UpdateMode", -1)) {
+ ptrA dbvUpdateURL(db_get_sa(0, MODNAME, "UpdateURL"));
+ if (dbvUpdateURL) {
+ if (!strcmp(dbvUpdateURL, DEFAULT_UPDATE_URL)) {
+ db_set_b(0, MODNAME, "UpdateMode", UPDATE_MODE_STABLE);
+ db_unset(0, MODNAME, "UpdateURL");
+ }
+ else if (!strcmp(dbvUpdateURL, DEFAULT_UPDATE_URL_TRUNK)) {
+ db_set_b(0, MODNAME, "UpdateMode", UPDATE_MODE_TRUNK);
+ db_unset(0, MODNAME, "UpdateURL");
+ }
+ else if (!strcmp(dbvUpdateURL, DEFAULT_UPDATE_URL_TRUNK_SYMBOLS"/")) {
+ db_set_b(0, MODNAME, "UpdateMode", UPDATE_MODE_TRUNK_SYMBOLS);
+ db_unset(0, MODNAME, "UpdateURL");
+ }
+ else db_set_b(0, MODNAME, "UpdateMode", UPDATE_MODE_CUSTOM);
+ }
+ else db_set_b(0, MODNAME, "UpdateMode", UPDATE_MODE_STABLE);
+ }
return 0;
}