diff options
author | George Hazan <ghazan@miranda.im> | 2017-07-30 21:40:51 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-07-30 21:40:51 +0300 |
commit | 81af1660759b655e0e65bf2f955ef50e87975a13 (patch) | |
tree | 3fe4b9669bd6232abb99725ed1fa7560e6f19584 /src/mir_app | |
parent | d049eb6dd9de7f10469b62e67afc1485d832b0c3 (diff) |
minor code cleaning
Diffstat (limited to 'src/mir_app')
-rw-r--r-- | src/mir_app/src/hotkeys.cpp | 4 | ||||
-rw-r--r-- | src/mir_app/src/skin.h | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/mir_app/src/hotkeys.cpp b/src/mir_app/src/hotkeys.cpp index b2b0247ab7..66993b6011 100644 --- a/src/mir_app/src/hotkeys.cpp +++ b/src/mir_app/src/hotkeys.cpp @@ -210,9 +210,7 @@ MIR_APP_DLL(int) Hotkey_Unregister(const char *pszName) cbNamePrefix = mir_strlen(pszNamePrefix);
for (int i = 0; i < hotkeys.getCount(); i++) {
- char *pszCurrentName = hotkeys[i]->rootHotkey ?
- hotkeys[i]->rootHotkey->pszName :
- hotkeys[i]->pszName;
+ char *pszCurrentName = hotkeys[i]->getName();
if (!pszCurrentName)
continue;
diff --git a/src/mir_app/src/skin.h b/src/mir_app/src/skin.h index 2ad06ff79b..602b3bb3d3 100644 --- a/src/mir_app/src/skin.h +++ b/src/mir_app/src/skin.h @@ -37,8 +37,8 @@ struct THotkeyBoxData struct THotkeyItem
{
THotkeyType type;
- char *pszService, *pszName; // pszName is valid _only_ for "root" hotkeys
- wchar_t *pwszSection, *pwszDescription;
+ char *pszService, *pszName; // pszName is valid _only_ for "root" hotkeys
+ wchar_t *pwszSection, *pwszDescription;
LPARAM lParam;
WORD DefHotkey, Hotkey;
bool Enabled;
@@ -56,6 +56,8 @@ struct THotkeyItem bool UnregisterHotkey; // valid only during WM_APP message in options UI, used to remove unregistered hotkeys from options
+ __inline char* getName() const { return (rootHotkey) ? rootHotkey->pszName : pszName; }
+
__inline wchar_t* getSection() const { return TranslateW_LP(pwszSection, hLangpack); }
__inline wchar_t* getDescr() const { return TranslateW_LP(pwszDescription, hLangpack); }
};
|