From 7197141db82f7519ed707962a03f265f576516af Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Sun, 27 Jul 2014 09:48:19 +0000 Subject: restoring Wishmaster's PluginUpdater commits git-svn-id: http://svn.miranda-ng.org/main/trunk@9968 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/PluginUpdater/src/PluginUpdater.cpp | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'plugins/PluginUpdater/src/PluginUpdater.cpp') 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; } -- cgit v1.2.3