summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/src/modern_clisttray.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-01-04 11:29:41 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-01-04 11:29:41 +0000
commitfe2291a04dc5e9273fc430820b5c4151b0a3a1bb (patch)
treebf3f51a5ad9478ed9d3f6bf924486f0a430fe9e0 /plugins/Clist_modern/src/modern_clisttray.cpp
parent1e20b1b154d9716f9ff9fcc9c4398eb3f5762bf1 (diff)
fix for the options conversion in clist_modern
git-svn-id: http://svn.miranda-ng.org/main/trunk@11765 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/src/modern_clisttray.cpp')
-rw-r--r--plugins/Clist_modern/src/modern_clisttray.cpp41
1 files changed, 14 insertions, 27 deletions
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp
index 9f41e7cf91..33dae2a0a1 100644
--- a/plugins/Clist_modern/src/modern_clisttray.cpp
+++ b/plugins/Clist_modern/src/modern_clisttray.cpp
@@ -407,15 +407,20 @@ VOID CALLBACK cliTrayCycleTimerProc(HWND, UINT, UINT_PTR, DWORD)
void SettingsMigrate(void)
{
BYTE TrayIcon = db_get_b(NULL, "CList", "TrayIcon", 0);
- BYTE AlwaysPrimary = db_get_b(NULL, "CList", "AlwaysPrimary", 1);
+ BYTE AlwaysPrimary = db_get_b(NULL, "CList", "AlwaysPrimary", 0);
BYTE AlwaysMulti = db_get_b(NULL, "CList", "AlwaysMulti", 0);
- char *PrimaryStatus = db_get_sa(NULL, "CList", "PrimaryStatus");
+ ptrA PrimaryStatus(db_get_sa(NULL, "CList", "PrimaryStatus"));
// these strings must always be set
- db_set_s(NULL, "CList", "tiAccS", "");
- db_set_s(NULL, "CList", "tiAccV", "");
+ if (PrimaryStatus) {
+ db_set_s(NULL, "CList", "tiAccS", PrimaryStatus);
+ db_set_s(NULL, "CList", "tiAccV", PrimaryStatus);
+ }
+ else {
+ db_set_s(NULL, "CList", "tiAccS", "");
+ db_set_s(NULL, "CList", "tiAccV", "");
+ }
- // Нужно вычислить новый режим.
switch (TrayIcon) {
case 0: // global or single acc
if (AlwaysPrimary) {
@@ -426,21 +431,11 @@ void SettingsMigrate(void)
else { // single acc always
db_set_b(NULL, "CList", "tiModeS", TRAY_ICON_MODE_ACC);
db_set_b(NULL, "CList", "tiModeV", TRAY_ICON_MODE_ACC);
- db_set_s(NULL, "CList", "tiAccS", PrimaryStatus);
- db_set_s(NULL, "CList", "tiAccV", PrimaryStatus);
}
}
else {
- if (!PrimaryStatus) { // global if differ
- db_set_b(NULL, "CList", "tiModeS", TRAY_ICON_MODE_ALL);
- db_set_b(NULL, "CList", "tiModeV", TRAY_ICON_MODE_GLOBAL);
- }
- else { // single acc if differ
- db_set_b(NULL, "CList", "tiModeS", TRAY_ICON_MODE_GLOBAL);
- db_set_b(NULL, "CList", "tiModeV", TRAY_ICON_MODE_ACC);
- db_set_s(NULL, "CList", "tiAccS", PrimaryStatus);
- db_set_s(NULL, "CList", "tiAccV", PrimaryStatus);
- }
+ db_set_b(NULL, "CList", "tiModeS", TRAY_ICON_MODE_GLOBAL);
+ db_set_b(NULL, "CList", "tiModeV", (PrimaryStatus) ? TRAY_ICON_MODE_ACC : TRAY_ICON_MODE_GLOBAL);
}
break;
@@ -450,16 +445,8 @@ void SettingsMigrate(void)
break;
case 2: // multiple
- switch (AlwaysMulti) {
- case 0: // all accs if differ
- db_set_b(NULL, "CList", "tiModeS", TRAY_ICON_MODE_GLOBAL);
- db_set_b(NULL, "CList", "tiModeV", TRAY_ICON_MODE_ALL);
- break;
- case 1: // all accs always
- db_set_b(NULL, "CList", "tiModeS", TRAY_ICON_MODE_ALL);
- db_set_b(NULL, "CList", "tiModeV", TRAY_ICON_MODE_ALL);
- break;
- }
+ db_set_b(NULL, "CList", "tiModeS", (AlwaysMulti) ? TRAY_ICON_MODE_ALL : TRAY_ICON_MODE_GLOBAL);
+ db_set_b(NULL, "CList", "tiModeV", TRAY_ICON_MODE_ALL);
break;
}
}