diff options
author | George Hazan <george.hazan@gmail.com> | 2014-01-21 20:04:48 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-01-21 20:04:48 +0000 |
commit | d154673f93ad95197bce8cadb995daa5bc39f5d8 (patch) | |
tree | 191522aa88f9f845a9c27b1ddb86116b87033c4b /src/modules/skin | |
parent | be50a70bfd8b3f3daf0c3351fdce6e2fea515bd7 (diff) |
minor code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@7820 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/skin')
-rw-r--r-- | src/modules/skin/hotkey_opts.cpp | 30 | ||||
-rw-r--r-- | src/modules/skin/hotkeys.cpp | 14 | ||||
-rw-r--r-- | src/modules/skin/skinicons.cpp | 6 | ||||
-rw-r--r-- | src/modules/skin/sounds.cpp | 10 |
4 files changed, 30 insertions, 30 deletions
diff --git a/src/modules/skin/hotkey_opts.cpp b/src/modules/skin/hotkey_opts.cpp index ef9f4fe690..53c7ba77fe 100644 --- a/src/modules/skin/hotkey_opts.cpp +++ b/src/modules/skin/hotkey_opts.cpp @@ -175,7 +175,7 @@ static void sttOptionsSetupItem(HWND hwndList, int idx, THotkeyItem *item) LVITEM lvi = {0};
lvi.iItem = idx;
- if ( !item->rootHotkey) {
+ if (!item->rootHotkey) {
lvi.mask = LVIF_TEXT|LVIF_IMAGE;
lvi.iSubItem = COL_NAME;
lvi.pszText = item->getDescr();
@@ -245,16 +245,16 @@ static int CALLBACK sttOptionsSortList(LPARAM lParam1, LPARAM lParam2, LPARAM lP if (ListView_GetItem((HWND)lParamSort, &lvi))
item2 = (THotkeyItem *)lvi.lParam;
- if ( !item1 && !item2)
+ if (!item1 && !item2)
return lstrcmp(title1, title2);
- if ( !item1) {
+ if (!item1) {
if (res = lstrcmp(title1, item2->getSection()))
return res;
return -1;
}
- if ( !item2) {
+ if (!item2) {
if (res = lstrcmp(item1->getSection(), title2))
return res;
return 1;
@@ -314,7 +314,7 @@ static void sttOptionsSaveItem(THotkeyItem *item) char buf[MAXMODULELABELLENGTH];
if (item->rootHotkey) return;
- if ( !item->OptChanged) return;
+ if (!item->OptChanged) return;
item->Hotkey = item->OptHotkey;
item->type = item->OptType;
@@ -356,7 +356,7 @@ static void sttBuildHotkeyList(HWND hwndList) if (item->OptDeleted)
continue;
- if ( !i || lstrcmp(item->ptszSection, hotkeys[i-1]->ptszSection)) {
+ if (!i || lstrcmp(item->ptszSection, hotkeys[i-1]->ptszSection)) {
lvi.mask = LVIF_TEXT|LVIF_PARAM;
lvi.iItem = nItems++;
lvi.iSubItem = 0;
@@ -537,7 +537,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, lvi.mask = LVIF_PARAM;
for (lvi.iItem = 0; lvi.iItem < count; ++lvi.iItem) {
ListView_GetItem(hwndHotkey, &lvi);
- if ( !lvi.lParam) continue;
+ if (!lvi.lParam) continue;
if (((THotkeyItem *)lvi.lParam)->UnregisterHotkey) {
ListView_DeleteItem(hwndHotkey, lvi.iItem);
@@ -609,7 +609,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, ShowWindow( GetDlgItem(hwndDlg, IDC_HOTKEY), SW_HIDE);
SetFocus(hwndHotkey);
- if ( !wHotkey || (wHotkey == VK_ESCAPE) || (HIWORD(wParam) != 0))
+ if (!wHotkey || (wHotkey == VK_ESCAPE) || (HIWORD(wParam) != 0))
break;
lvi.mask = LVIF_PARAM;
@@ -637,7 +637,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, lvi.mask = LVIF_PARAM;
ListView_GetItem(hwndList, &lvi);
- if ( !(item = (THotkeyItem *)lvi.lParam)) return FALSE;
+ if (!(item = (THotkeyItem *)lvi.lParam)) return FALSE;
if ((pt.x == -1) && (pt.y == -1)) {
RECT rc;
@@ -667,7 +667,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, (UINT_PTR)MI_LOCAL, TranslateT("Miranda scope"));
}
AppendMenu(hMenu, MF_SEPARATOR, 0, NULL);
- if ( !item->rootHotkey)
+ if (!item->rootHotkey)
AppendMenu(hMenu, MF_STRING, (UINT_PTR)MI_ADD, TranslateT("Add binding"));
else
AppendMenu(hMenu, MF_STRING, (UINT_PTR)MI_REMOVE, TranslateT("Remove"));
@@ -775,7 +775,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, ListView_HitTest(lpnmia->hdr.hwndFrom, &lvhti);
if (item &&
- ( !item->rootHotkey && (lpnmia->iSubItem == COL_NAME) && ((lvhti.flags & LVHT_ONITEM) == LVHT_ONITEMICON) ||
+ (!item->rootHotkey && (lpnmia->iSubItem == COL_NAME) && ((lvhti.flags & LVHT_ONITEM) == LVHT_ONITEMICON) ||
item->rootHotkey && (lpnmia->iSubItem == COL_TYPE)) &&
((item->OptType == HKT_GLOBAL) || (item->OptType == HKT_LOCAL)))
{
@@ -846,7 +846,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, {
LPNMLISTVIEW param = (LPNMLISTVIEW)lParam;
THotkeyItem *item = (THotkeyItem *)param->lParam;
- if ( !initialized || (param->uNewState>>12 == param->uOldState>>12))
+ if (!initialized || (param->uNewState>>12 == param->uOldState>>12))
break;
if (item && !item->rootHotkey) {
@@ -854,7 +854,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, sttOptionsSetChanged(item);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
- else if ( !item) {
+ else if (!item) {
TCHAR buf[256];
LVITEM lvi = {0};
lvi.mask = LVIF_TEXT;
@@ -871,8 +871,8 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, THotkeyItem *item;
ListView_GetItem(lpnmhdr->hwndFrom, &lvi);
item = (THotkeyItem *)lvi.lParam;
- if ( !item) continue;
- if ( !lstrcmp( item->getSection(), buf)) {
+ if (!item) continue;
+ if (!lstrcmp( item->getSection(), buf)) {
ListView_DeleteItem(lpnmhdr->hwndFrom, lvi.iItem);
--lvi.iItem;
--count;
diff --git a/src/modules/skin/hotkeys.cpp b/src/modules/skin/hotkeys.cpp index 279466dbf7..adab1fda71 100644 --- a/src/modules/skin/hotkeys.cpp +++ b/src/modules/skin/hotkeys.cpp @@ -33,7 +33,7 @@ static int sttCompareHotkeys(const THotkeyItem *p1, const THotkeyItem *p2) return res;
if (res = lstrcmp(p1->ptszDescription, p2->ptszDescription))
return res;
- if ( !p1->rootHotkey && p2->rootHotkey)
+ if (!p1->rootHotkey && p2->rootHotkey)
return -1;
if (p1->rootHotkey && !p2->rootHotkey)
return 1;
@@ -189,14 +189,14 @@ static INT_PTR svcHotkeyRegister(WPARAM wParam, LPARAM lParam) hotkeys.insert(item);
- if ( !item->rootHotkey) {
+ if (!item->rootHotkey) {
/* try to load alternatives from db */
int count, i;
mir_snprintf(buf, SIZEOF(buf), "%s$count", item->pszName);
count = (int)db_get_dw(NULL, DBMODULENAME, buf, -1);
for (i=0; i < count; i++) {
mir_snprintf(buf, SIZEOF(buf), "%s$%d", item->pszName, i);
- if ( !db_get_w(NULL, DBMODULENAME, buf, 0))
+ if (!db_get_w(NULL, DBMODULENAME, buf, 0))
continue;
svcHotkeyRegister(wParam, lParam);
@@ -225,7 +225,7 @@ static INT_PTR svcHotkeyUnregister(WPARAM, LPARAM lParam) char *pszCurrentName = hotkeys[i]->rootHotkey ?
hotkeys[i]->rootHotkey->pszName :
hotkeys[i]->pszName;
- if ( !pszCurrentName) continue;
+ if (!pszCurrentName) continue;
hotkeys[i]->UnregisterHotkey =
!lstrcmpA(pszCurrentName, pszName) ||
@@ -265,8 +265,8 @@ static INT_PTR svcHotkeyCheck(WPARAM wParam, LPARAM lParam) BYTE hkMod, hkVk;
if ((item->type != HKT_MANUAL) || lstrcmp(pszSection, item->ptszSection)) continue;
sttWordToModAndVk(item->Hotkey, &hkMod, &hkVk);
- if ( !hkVk) continue;
- if ( !item->Enabled) continue;
+ if (!hkVk) continue;
+ if (!item->Enabled) continue;
if ((vk == hkVk) && (mod == hkMod)) {
mir_free(pszSection);
return item->lParam;
@@ -391,7 +391,7 @@ int LoadSkinHotkeys(void) void UnloadSkinHotkeys(void)
{
- if ( !bModuleInitialized)
+ if (!bModuleInitialized)
return;
DestroyHookableEvent(hEvChanged);
diff --git a/src/modules/skin/skinicons.cpp b/src/modules/skin/skinicons.cpp index 3da738b389..2e6e071f02 100644 --- a/src/modules/skin/skinicons.cpp +++ b/src/modules/skin/skinicons.cpp @@ -136,7 +136,7 @@ static HICON LoadSmallIcon(HINSTANCE hInstance, LPCTSTR lpIconName) HICON LoadIconEx(HINSTANCE hInstance, LPCTSTR lpIconName, BOOL bShared)
{
HICON hResIcon = bShared ? LoadSmallIcon(hInstance, lpIconName) : LoadSmallIconShared(hInstance, lpIconName);
- if ( !hResIcon) { //Icon not found in hInstance lets try to load it from core
+ if (!hResIcon) { //Icon not found in hInstance lets try to load it from core
HINSTANCE hCoreInstance = hInst;
if (hCoreInstance != hInstance)
hResIcon = bShared ? LoadSmallIcon(hCoreInstance, lpIconName) : LoadSmallIconShared(hCoreInstance, lpIconName);
@@ -243,7 +243,7 @@ HICON LoadSkinProtoIcon(const char *szProto, int status, bool big) if (statusIndx == -1)
return NULL;
- if ( !szProto) {
+ if (!szProto) {
// Only return a protocol specific icon if there is only one protocol
// Otherwise return the global icon. This affects the global status menu mainly.
if (accounts.getCount() == 1) {
@@ -385,7 +385,7 @@ static void convertOneProtocol(char *moduleName, char *iconName) _itoa(statusIcons[i].id, pm, 10);
DBVARIANT dbv;
- if ( !db_get_ts(NULL, "Icons", moduleName, &dbv)) {
+ if (!db_get_ts(NULL, "Icons", moduleName, &dbv)) {
_itoa(i, pi, 10);
db_set_ts(NULL, "SkinIcons", iconName, dbv.ptszVal);
diff --git a/src/modules/skin/sounds.cpp b/src/modules/skin/sounds.cpp index e6aa790610..6cd4266c0f 100644 --- a/src/modules/skin/sounds.cpp +++ b/src/modules/skin/sounds.cpp @@ -191,7 +191,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM TreeView_SetItem(hwndTree, &tvis.item);
}
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
- tvis.item.state = INDEXTOSTATEIMAGEMASK( !db_get_b(NULL, "SkinSoundsOff", arSounds[i].name, 0)?2:1);
+ tvis.item.state = INDEXTOSTATEIMAGEMASK(!db_get_b(NULL, "SkinSoundsOff", arSounds[i].name, 0)?2:1);
tvis.item.lParam = i;
tvis.item.pszText = arSounds[i].getDescr();
TreeView_InsertItem(hwndTree, &tvis);
@@ -235,7 +235,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case DM_CHECKENABLED:
EnableWindow( GetDlgItem(hwndDlg, IDC_SOUNDTREE), IsDlgButtonChecked(hwndDlg, IDC_ENABLESOUNDS));
- if ( !IsDlgButtonChecked(hwndDlg, IDC_ENABLESOUNDS))
+ if (!IsDlgButtonChecked(hwndDlg, IDC_ENABLESOUNDS))
SendMessage(hwndDlg, DM_HIDEPANE, 0, 0);
else if (TreeView_GetSelection(hwndTree) && TreeView_GetParent(hwndTree, TreeView_GetSelection(hwndTree)))
SendMessage(hwndDlg, DM_SHOWPANE, 0, 0);
@@ -262,7 +262,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM NotifyEventHooks(hPlayEvent, 1, (LPARAM)arSounds[tvi.lParam].ptszTempFile);
else {
DBVARIANT dbv;
- if ( !db_get_ts(NULL, "SkinSounds", arSounds[tvi.lParam].name, &dbv)) {
+ if (!db_get_ts(NULL, "SkinSounds", arSounds[tvi.lParam].name, &dbv)) {
TCHAR szPathFull[MAX_PATH];
PathToAbsoluteT(dbv.ptszVal, szPathFull);
NotifyEventHooks(hPlayEvent, 1, (LPARAM)szPathFull);
@@ -324,7 +324,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM ofn.nMaxFile = SIZEOF(str);
ofn.nMaxFileTitle = MAX_PATH;
ofn.lpstrDefExt = _T("wav");
- if ( !GetOpenFileName(&ofn))
+ if (!GetOpenFileName(&ofn))
break;
PathToRelativeT(str, strFull);
@@ -392,7 +392,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM SetDlgItemText(hwndDlg, IDC_LOCATION, arSounds[tvi.lParam].ptszTempFile);
else {
DBVARIANT dbv;
- if ( !db_get_ts(NULL, "SkinSounds", arSounds[tvi.lParam].name, &dbv)) {
+ if (!db_get_ts(NULL, "SkinSounds", arSounds[tvi.lParam].name, &dbv)) {
SetDlgItemText(hwndDlg, IDC_LOCATION, dbv.ptszVal);
db_free(&dbv);
}
|