From f4fbbf8f517f4c53df997ad974533c0bbc174615 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 27 Jul 2014 07:55:14 +0000 Subject: fix for the PU settings upgrade git-svn-id: http://svn.miranda-ng.org/main/trunk@9960 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/PluginUpdater/src/PluginUpdater.cpp | 30 ++++++++++++----------------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/plugins/PluginUpdater/src/PluginUpdater.cpp b/plugins/PluginUpdater/src/PluginUpdater.cpp index 4644d6d13e..cbaacb6f7e 100644 --- a/plugins/PluginUpdater/src/PluginUpdater.cpp +++ b/plugins/PluginUpdater/src/PluginUpdater.cpp @@ -140,27 +140,21 @@ extern "C" __declspec(dllexport) int Load(void) SkinAddNewSoundEx("updatefailed",LPGEN("Plugin Updater"),LPGEN("Update failed")); // Upgrade old settings - if(!db_set_b(0,MODNAME,"UpdateMode",UPDATE_MODE_STABLE)) - { - DBVARIANT dbvUpdateURL; - if (!db_get_s(0,MODNAME, "UpdateURL",&dbvUpdateURL)) - { - if (!strcmp(dbvUpdateURL.pszVal, DEFAULT_UPDATE_URL)) - { - db_set_b(0,MODNAME,"UpdateMode",UPDATE_MODE_STABLE); - db_unset(0,MODNAME, "UpdateURL"); + if (!db_get_b(0, MODNAME, "UpdateMode", UPDATE_MODE_STABLE)) { + 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.pszVal, 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)) { + db_set_b(0, MODNAME, "UpdateMode", UPDATE_MODE_TRUNK); + db_unset(0, MODNAME, "UpdateURL"); } - else if (!strcmp(dbvUpdateURL.pszVal, DEFAULT_UPDATE_URL_TRUNK_SYMBOLS"/")) - { - db_set_b(0,MODNAME,"UpdateMode",UPDATE_MODE_TRUNK_SYMBOLS); - 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"); } - db_free(&dbvUpdateURL); } } return 0; -- cgit v1.2.3