diff options
author | Robert Pösel <robyer@seznam.cz> | 2014-10-07 18:41:08 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2014-10-07 18:41:08 +0000 |
commit | e7a40f49fabfb003a2603b08a59f205ba1a1a478 (patch) | |
tree | e1e04e7d3ef0b5c8e04f62e4659e508cdec58cab /plugins/PluginUpdater/src/PluginUpdater.cpp | |
parent | b4b974a256953c3e97a7e7b8426740e98fd4541f (diff) |
PluginUpdater:
- Fix setting custom URL ("UpdateURL" is not same as "UpdateUrl")
- Use constants for often used db setting names
- Version bump
git-svn-id: http://svn.miranda-ng.org/main/trunk@10733 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/PluginUpdater/src/PluginUpdater.cpp')
-rw-r--r-- | plugins/PluginUpdater/src/PluginUpdater.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/plugins/PluginUpdater/src/PluginUpdater.cpp b/plugins/PluginUpdater/src/PluginUpdater.cpp index 7ae7d8a48f..281c04e623 100644 --- a/plugins/PluginUpdater/src/PluginUpdater.cpp +++ b/plugins/PluginUpdater/src/PluginUpdater.cpp @@ -72,7 +72,7 @@ extern "C" __declspec(dllexport) int Load(void) InitServices();
#endif
- db_set_b(NULL, MODNAME, "NeedRestart", 0);
+ db_set_b(NULL, MODNAME, DB_SETTING_NEED_RESTART, 0);
DWORD dwLen = GetTempPath( SIZEOF(tszTempPath), tszTempPath);
if (tszTempPath[dwLen-1] == '\\')
@@ -121,22 +121,22 @@ extern "C" __declspec(dllexport) int Load(void) 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 (-1 == db_get_b(0, MODNAME, DB_SETTING_UPDATE_MODE, -1)) {
+ ptrT dbvUpdateURL(db_get_tsa(0, MODNAME, DB_SETTING_UPDATE_URL));
if (dbvUpdateURL) {
- if (!strcmp(dbvUpdateURL, DEFAULT_UPDATE_URL)) {
- db_set_b(0, MODNAME, "UpdateMode", UPDATE_MODE_STABLE);
- db_unset(0, MODNAME, "UpdateURL");
+ if (!_tcscmp(dbvUpdateURL, _T(DEFAULT_UPDATE_URL))) {
+ db_set_b(0, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_STABLE);
+ db_unset(0, MODNAME, DB_SETTING_UPDATE_URL);
}
- else if (!strcmp(dbvUpdateURL, DEFAULT_UPDATE_URL_TRUNK)) {
- db_set_b(0, MODNAME, "UpdateMode", UPDATE_MODE_TRUNK);
- db_unset(0, MODNAME, "UpdateURL");
+ else if (!_tcscmp(dbvUpdateURL, _T(DEFAULT_UPDATE_URL_TRUNK))) {
+ db_set_b(0, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_TRUNK);
+ db_unset(0, MODNAME, DB_SETTING_UPDATE_URL);
}
- 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 if (!_tcscmp(dbvUpdateURL, _T(DEFAULT_UPDATE_URL_TRUNK_SYMBOLS)_T("/"))) {
+ db_set_b(0, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_TRUNK_SYMBOLS);
+ db_unset(0, MODNAME, DB_SETTING_UPDATE_URL);
}
- else db_set_b(0, MODNAME, "UpdateMode", UPDATE_MODE_CUSTOM);
+ else db_set_b(0, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_CUSTOM);
}
}
return 0;
|