diff options
author | George Hazan <ghazan@miranda.im> | 2022-08-18 13:35:39 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-08-18 13:35:39 +0300 |
commit | 1c43614d3c482ce931d55f9a86cac8fbb0852792 (patch) | |
tree | a723248115b2e37e2e71cbbcb211e314ea796ce2 /protocols | |
parent | 47802c95395c5b812c8c0bcc286d4da985f9992d (diff) |
code cleaning
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/CurrencyRates/src/Forex.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/protocols/CurrencyRates/src/Forex.cpp b/protocols/CurrencyRates/src/Forex.cpp index f36ecad292..cd4982e42d 100644 --- a/protocols/CurrencyRates/src/Forex.cpp +++ b/protocols/CurrencyRates/src/Forex.cpp @@ -26,14 +26,14 @@ static THandles g_ahThreads; static HGENMENU g_hEnableDisableMenu; static HANDLE g_hTBButton; -static void UpdateMenu(bool bAutoUpdate) +static void UpdateMenu() { - if (bAutoUpdate) // to enable auto-update + if (g_bAutoUpdate) // to enable auto-update Menu_ModifyItem(g_hEnableDisableMenu, LPGENW("Auto Update Enabled"), g_plugin.getIconHandle(IDI_ICON_MAIN)); else // to disable auto-update Menu_ModifyItem(g_hEnableDisableMenu, LPGENW("Auto Update Disabled"), g_plugin.getIconHandle(IDI_ICON_DISABLED)); - CallService(MS_TTB_SETBUTTONSTATE, reinterpret_cast<WPARAM>(g_hTBButton), !bAutoUpdate ? TTBST_PUSHED : 0); + CallService(MS_TTB_SETBUTTONSTATE, reinterpret_cast<WPARAM>(g_hTBButton), g_bAutoUpdate ? 0 : TTBST_PUSHED); } static INT_PTR CurrencyRatesMenu_RefreshAll(WPARAM, LPARAM) @@ -45,7 +45,7 @@ static INT_PTR CurrencyRatesMenu_RefreshAll(WPARAM, LPARAM) static INT_PTR CurrencyRatesMenu_EnableDisable(WPARAM, LPARAM) { - g_bAutoUpdate = (g_bAutoUpdate) ? false : true; + g_bAutoUpdate = !g_bAutoUpdate; g_plugin.setByte(DB_STR_AUTO_UPDATE, g_bAutoUpdate); for (auto &pProvider : g_apProviders) { @@ -54,7 +54,7 @@ static INT_PTR CurrencyRatesMenu_EnableDisable(WPARAM, LPARAM) pProvider->RefreshAllContacts(); } - UpdateMenu(g_bAutoUpdate); + UpdateMenu(); return 0; } @@ -72,7 +72,7 @@ void InitMenu() mi.pszService = MS_FOREX_ENABLE; g_hEnableDisableMenu = Menu_AddMainMenuItem(&mi); CreateServiceFunction(mi.pszService, CurrencyRatesMenu_EnableDisable); - UpdateMenu(g_bAutoUpdate); + UpdateMenu(); SET_UID(mi, 0x91cbabf6, 0x5073, 0x4a78, 0x84, 0x8, 0x34, 0x61, 0xc1, 0x8a, 0x34, 0xd9); mi.name.w = LPGENW("Refresh All Rates"); |