summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-24 16:18:00 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-24 16:18:00 +0000
commitcff526fc610fe0166b59c25bcb7730b92b481480 (patch)
treee6a4d06f31ac5134d67fee3405f37ebab1a5054d /src/modules
parent2e9daaee6cdf51423daa89b1dbae37e1424d549f (diff)
fix for the Sounds options
git-svn-id: http://svn.miranda-ng.org/main/trunk@604 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/button/button.cpp4
-rw-r--r--src/modules/clist/clc.cpp14
-rw-r--r--src/modules/contacts/contacts.cpp6
-rw-r--r--src/modules/ignore/ignore.cpp4
-rw-r--r--src/modules/json/JSONWriter.cpp50
-rw-r--r--src/modules/json/internalJSONNode.cpp54
-rw-r--r--src/modules/json/libJSON.cpp52
-rw-r--r--src/modules/langpack/langpack.cpp2
-rw-r--r--src/modules/netlib/netlibbind.cpp9
-rw-r--r--src/modules/netlib/netlibhttp.cpp4
-rw-r--r--src/modules/plugins/newplugins.cpp2
-rw-r--r--src/modules/skin/sounds.cpp18
-rw-r--r--src/modules/updatenotify/updatenotify.cpp18
-rw-r--r--src/modules/useronline/useronline.cpp2
-rw-r--r--src/modules/utils/path.cpp4
15 files changed, 119 insertions, 124 deletions
diff --git a/src/modules/button/button.cpp b/src/modules/button/button.cpp
index 6793391fe6..63519a9406 100644
--- a/src/modules/button/button.cpp
+++ b/src/modules/button/button.cpp
@@ -223,10 +223,10 @@ static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint)
sz.cx -= szHot.cx;
}
if (ctl->arrow) {
- DrawState(hdcMem, NULL, NULL, (LPARAM)ctl->arrow, 0, rcClient.right-rcClient.left-5-GetSystemMetrics(SM_CXSMICON)+( !ctl->hThemeButton&&ctl->stateId == PBS_PRESSED?1:0), (rcClient.bottom-rcClient.top)/2-GetSystemMetrics(SM_CYSMICON)/2+( !ctl->hThemeButton&&ctl->stateId == PBS_PRESSED?1:0), GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), IsWindowEnabled(ctl->hwnd)?DST_ICON:DST_ICON|DSS_DISABLED);
+ DrawState(hdcMem, NULL, NULL, (LPARAM)ctl->arrow, 0, rcClient.right-rcClient.left-5-GetSystemMetrics(SM_CXSMICON)+( !ctl->hThemeButton && ctl->stateId == PBS_PRESSED?1:0), (rcClient.bottom-rcClient.top)/2-GetSystemMetrics(SM_CYSMICON)/2+(!ctl->hThemeButton && ctl->stateId == PBS_PRESSED?1:0), GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), IsWindowEnabled(ctl->hwnd)?DST_ICON:DST_ICON|DSS_DISABLED);
}
SelectObject(hdcMem, ctl->hFont);
- DrawState(hdcMem, NULL, NULL, (LPARAM)szText, 0, (rcText.right-rcText.left-sz.cx)/2+( !ctl->hThemeButton&&ctl->stateId == PBS_PRESSED?1:0), ctl->hThemeButton?(rcText.bottom-rcText.top-sz.cy)/2:(rcText.bottom-rcText.top-sz.cy)/2-(ctl->stateId == PBS_PRESSED?0:1), sz.cx, sz.cy, IsWindowEnabled(ctl->hwnd) || ctl->hThemeButton?DST_PREFIXTEXT|DSS_NORMAL:DST_PREFIXTEXT|DSS_DISABLED);
+ DrawState(hdcMem, NULL, NULL, (LPARAM)szText, 0, (rcText.right-rcText.left-sz.cx)/2+( !ctl->hThemeButton && ctl->stateId == PBS_PRESSED?1:0), ctl->hThemeButton?(rcText.bottom-rcText.top-sz.cy)/2:(rcText.bottom-rcText.top-sz.cy)/2-(ctl->stateId == PBS_PRESSED?0:1), sz.cx, sz.cy, IsWindowEnabled(ctl->hwnd) || ctl->hThemeButton?DST_PREFIXTEXT|DSS_NORMAL:DST_PREFIXTEXT|DSS_DISABLED);
SelectObject(hdcMem, hOldFont);
}
BitBlt(hdcPaint, 0, 0, rcClient.right-rcClient.left, rcClient.bottom-rcClient.top, hdcMem, 0, 0, SRCCOPY);
diff --git a/src/modules/clist/clc.cpp b/src/modules/clist/clc.cpp
index 168fae2746..d68ad5a9b8 100644
--- a/src/modules/clist/clc.cpp
+++ b/src/modules/clist/clc.cpp
@@ -69,7 +69,6 @@ HMENU fnBuildGroupPopupMenu(struct ClcGroup* group)
static int ClcSettingChanged(WPARAM wParam, LPARAM lParam)
{
- char *szProto;
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *) lParam;
if ((HANDLE)wParam != NULL && !strcmp(cws->szModule, "CList")) {
if ( !strcmp(cws->szSetting, "MyHandle")) {
@@ -91,19 +90,18 @@ static int ClcSettingChanged(WPARAM wParam, LPARAM lParam)
cli.pfnClcBroadcast(INTM_GROUPSCHANGED, wParam, lParam);
}
else {
- szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ char* szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
if (szProto != NULL && (HANDLE) wParam != NULL) {
char *id = NULL;
- if ( !strcmp(cws->szModule, "Protocol") && !strcmp(cws->szSetting, "p")) {
+ if ( !strcmp(cws->szModule, "Protocol") && !strcmp(cws->szSetting, "p"))
cli.pfnClcBroadcast(INTM_PROTOCHANGED, wParam, lParam);
- }
+
// something is being written to a protocol module
if ( !strcmp(szProto, cws->szModule)) {
// was a unique setting key written?
id = (char *) CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
- if ((INT_PTR) id != CALLSERVICE_NOTFOUND && id != NULL && !strcmp(id, cws->szSetting)) {
+ if ((INT_PTR) id != CALLSERVICE_NOTFOUND && id != NULL && !strcmp(id, cws->szSetting))
cli.pfnClcBroadcast(INTM_PROTOCHANGED, wParam, lParam);
- }
}
}
if (szProto == NULL || strcmp(szProto, cws->szModule))
@@ -519,10 +517,10 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
else
status = DBGetContactSettingWord((HANDLE) wParam, szProto, "Status", ID_STATUS_OFFLINE);
+ // this means an offline msg is flashing, so the contact should be shown
DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE);
shouldShow = (style & CLS_SHOWHIDDEN || !DBGetContactSettingByte((HANDLE) wParam, "CList", "Hidden", 0))
- && ( !cli.pfnIsHiddenMode(dat, status)
- || CallService(MS_CLIST_GETCONTACTICON, wParam, 0) != lParam); // this means an offline msg is flashing, so the contact should be shown
+ && ( !cli.pfnIsHiddenMode(dat, status) || CallService(MS_CLIST_GETCONTACTICON, wParam, 0) != lParam);
if ( !cli.pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, &group, NULL)) {
if (shouldShow && CallService(MS_DB_CONTACT_IS, wParam, 0)) {
if (dat->selection >= 0 && cli.pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1)
diff --git a/src/modules/contacts/contacts.cpp b/src/modules/contacts/contacts.cpp
index a2959909a4..f6cbc2c889 100644
--- a/src/modules/contacts/contacts.cpp
+++ b/src/modules/contacts/contacts.cpp
@@ -198,7 +198,7 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam) {
case CNF_UNIQUEID:
{
char *uid = (char*)CallProtoService(ci->szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
- if ((INT_PTR)uid != CALLSERVICE_NOTFOUND&&uid)
+ if ((INT_PTR)uid != CALLSERVICE_NOTFOUND && uid)
if ( !ProcessDatabaseValueDefault(ci, uid))
return 0;
@@ -209,7 +209,7 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam) {
if ( !ProcessDatabaseValueDefault(ci, "display_uid"))
return 0;
char *uid = (char*)CallProtoService(ci->szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
- if ((INT_PTR)uid != CALLSERVICE_NOTFOUND&&uid)
+ if ((INT_PTR)uid != CALLSERVICE_NOTFOUND && uid)
if ( !ProcessDatabaseValueDefault(ci, uid))
return 0;
@@ -253,7 +253,7 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam) {
{
// protocol must define a PFLAG_UNIQUEIDSETTING
char *uid = (char*)CallProtoService(ci->szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
- if ((INT_PTR)uid != CALLSERVICE_NOTFOUND&&uid) {
+ if ((INT_PTR)uid != CALLSERVICE_NOTFOUND && uid) {
if ( !GetDatabaseString(ci, uid, &dbv)) {
if (dbv.type == DBVT_BYTE || dbv.type == DBVT_WORD || dbv.type == DBVT_DWORD) {
long value = (dbv.type == DBVT_BYTE) ? dbv.bVal:(dbv.type == DBVT_WORD ? dbv.wVal : dbv.dVal);
diff --git a/src/modules/ignore/ignore.cpp b/src/modules/ignore/ignore.cpp
index 4158925082..bc9cf143f8 100644
--- a/src/modules/ignore/ignore.cpp
+++ b/src/modules/ignore/ignore.cpp
@@ -126,7 +126,7 @@ static void SetIconsForColumn(HWND hwndList, HANDLE hItem, HANDLE hItemAll, int
itemType=SendMessage(hwndList, CLM_GETITEMTYPE, (WPARAM)hItem, 0);
if (itemType == CLCIT_CONTACT) {
int oldiImage = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, iColumn);
- if (oldiImage != 0xFF&&oldiImage != iImage)
+ if (oldiImage != 0xFF && oldiImage != iImage)
SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn, iImage));
}
else if (itemType == CLCIT_INFO) {
@@ -146,7 +146,7 @@ static void InitialiseItem(HWND hwndList, HANDLE hContact, HANDLE hItem, DWORD p
mask=GetMask(hContact);
for (i=0;i<IGNOREEVENT_MAX;i++)
- if ((ignoreIdToPf1[i] == 0xFFFFFFFF&&ignoreIdToPf4[i] == 0xFFFFFFFF) || (proto1Caps&ignoreIdToPf1[i] || proto4Caps&ignoreIdToPf4[i]))
+ if ((ignoreIdToPf1[i] == 0xFFFFFFFF && ignoreIdToPf4[i] == 0xFFFFFFFF) || (proto1Caps&ignoreIdToPf1[i] || proto4Caps&ignoreIdToPf4[i]))
SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(i, mask&(1<<i)?i+3:0));
SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(IGNOREEVENT_MAX, 1));
SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(IGNOREEVENT_MAX+1, 2));
diff --git a/src/modules/json/JSONWriter.cpp b/src/modules/json/JSONWriter.cpp
index f23798502b..ae95773f6d 100644
--- a/src/modules/json/JSONWriter.cpp
+++ b/src/modules/json/JSONWriter.cpp
@@ -1,28 +1,28 @@
-/*
-
-Miranda IM: the free IM client for Microsoft* Windows*
-
-Copyright 2000-2009 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
-listed in contributors.txt.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#include "..\..\core\commonheaders.h"
-
+/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2009 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include "..\..\core\commonheaders.h"
+
#include "JSONNode.h"
#ifdef JSON_WRITER
#include "JSONWorker.h"
diff --git a/src/modules/json/internalJSONNode.cpp b/src/modules/json/internalJSONNode.cpp
index 26e203b284..dfe4971827 100644
--- a/src/modules/json/internalJSONNode.cpp
+++ b/src/modules/json/internalJSONNode.cpp
@@ -1,30 +1,30 @@
-/*
-
-Miranda IM: the free IM client for Microsoft* Windows*
-
-Copyright 2000-2009 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
-listed in contributors.txt.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#include "..\..\core\commonheaders.h"
-#include <m_json.h>
-
-#include "libJSON.h"
+/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2009 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include "..\..\core\commonheaders.h"
+#include <m_json.h>
+
+#include "libJSON.h"
#include "internalJSONNode.h"
#include "NumberToString.h" //So that I can convert numbers into strings
#include "JSONNode.h" //To fill in the foreward declaration
diff --git a/src/modules/json/libJSON.cpp b/src/modules/json/libJSON.cpp
index a27461f275..a84d7bf7c0 100644
--- a/src/modules/json/libJSON.cpp
+++ b/src/modules/json/libJSON.cpp
@@ -1,29 +1,29 @@
-/*
-
-Miranda IM: the free IM client for Microsoft* Windows*
-
-Copyright 2000-2009 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
-listed in contributors.txt.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#include "..\..\core\commonheaders.h"
-
-#include "libJSON.h"
+/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2009 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include "..\..\core\commonheaders.h"
+
+#include "libJSON.h"
/*
This is the implementation of the C interface to libJSON
diff --git a/src/modules/langpack/langpack.cpp b/src/modules/langpack/langpack.cpp
index efa7e5da9b..ecc503f19f 100644
--- a/src/modules/langpack/langpack.cpp
+++ b/src/modules/langpack/langpack.cpp
@@ -71,7 +71,7 @@ static int IsEmpty(char *str)
while (str[i])
{
- if (str[i] != ' '&&str[i] != '\r'&&str[i] != '\n')
+ if (str[i] != ' ' && str[i] != '\r' && str[i] != '\n')
return 0;
i++;
}
diff --git a/src/modules/netlib/netlibbind.cpp b/src/modules/netlib/netlibbind.cpp
index ada02da36e..0b6aca709d 100644
--- a/src/modules/netlib/netlibbind.cpp
+++ b/src/modules/netlib/netlibbind.cpp
@@ -191,18 +191,15 @@ INT_PTR NetlibBindPort(WPARAM wParam, LPARAM lParam)
int foundPort = 0;
UINT dwThreadId;
- if (GetNetlibHandleType(nlu) != NLH_USER || !(nlu->user.flags & NUF_INCOMING) ||
+ if (GetNetlibHandleType(nlu) != NLH_USER || !(nlu->user.flags & NUF_INCOMING) ||
nlb == NULL || nlb->pfnNewConnection == NULL)
{
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
- if (nlb->cbSize != sizeof(NETLIBBIND) &&
- nlb->cbSize != NETLIBBIND_SIZEOF_V2 &&
- nlb->cbSize != NETLIBBIND_SIZEOF_V1)
- {
+ if (nlb->cbSize != sizeof(NETLIBBIND))
return 0;
- }
+
nlbp = (NetlibBoundPort*)mir_calloc(sizeof(NetlibBoundPort));
nlbp->handleType = NLH_BOUNDPORT;
nlbp->nlu = nlu;
diff --git a/src/modules/netlib/netlibhttp.cpp b/src/modules/netlib/netlibhttp.cpp
index 1805558ac3..520f371917 100644
--- a/src/modules/netlib/netlibhttp.cpp
+++ b/src/modules/netlib/netlibhttp.cpp
@@ -909,7 +909,7 @@ INT_PTR NetlibHttpRecvHeaders(WPARAM wParam, LPARAM lParam)
{
peol = strchr(pbuffer, '\n');
if (peol == NULL) break;
- if (peol == pbuffer || (peol == (pbuffer + 1) && *pbuffer == '\r'))
+ if (peol == pbuffer || (peol == (pbuffer + 1) && *pbuffer == '\r'))
{
bytesPeeked = peol - buffer + 1;
headersCompleted = true;
@@ -936,7 +936,7 @@ INT_PTR NetlibHttpRecvHeaders(WPARAM wParam, LPARAM lParam)
for (pbuffer = buffer, headersCount = 0;; pbuffer = peol + 1, ++headersCount)
{
peol = strchr(pbuffer, '\n');
- if (peol == NULL || peol == pbuffer || (peol == (pbuffer + 1) && *pbuffer == '\r')) break;
+ if (peol == NULL || peol == pbuffer || (peol == (pbuffer + 1) && *pbuffer == '\r')) break;
*peol = 0;
char *pColon = strchr(pbuffer, ':');
diff --git a/src/modules/plugins/newplugins.cpp b/src/modules/plugins/newplugins.cpp
index 52f3f32702..64eff30f5b 100644
--- a/src/modules/plugins/newplugins.cpp
+++ b/src/modules/plugins/newplugins.cpp
@@ -468,7 +468,7 @@ static BOOL scanPluginsDir(WIN32_FIND_DATA *fd, TCHAR *path, WPARAM, LPARAM)
if (pluginList_freeimg == NULL && lstrcmpi(fd->cFileName, _T("advaimg.dll")) == 0)
pluginList_freeimg = p;
- if (pluginList_crshdmp == NULL && lstrcmpi(fd->cFileName, _T("svc_crshdmp.dll")) == 0) {
+ if (pluginList_crshdmp == NULL && lstrcmpi(fd->cFileName, _T("svc_crshdmp.dll")) == 0) {
pluginList_crshdmp = p;
p->pclass |= PCLASS_LAST;
}
diff --git a/src/modules/skin/sounds.cpp b/src/modules/skin/sounds.cpp
index f0cfa1a62a..94da829145 100644
--- a/src/modules/skin/sounds.cpp
+++ b/src/modules/skin/sounds.cpp
@@ -209,7 +209,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
EnableWindow(GetDlgItem(hwndDlg, IDC_SOUNDTREE), 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)))
+ else if (TreeView_GetSelection(hwndTree) && TreeView_GetParent(hwndTree, TreeView_GetSelection(hwndTree)))
SendMessage(hwndDlg, DM_SHOWPANE, 0, 0);
break;
@@ -348,6 +348,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
case IDC_SOUNDTREE:
switch(((NMHDR*)lParam)->code) {
+ case TVN_SELCHANGEDW:
case TVN_SELCHANGEDA:
{
NMTREEVIEW *pnmtv = (NMTREEVIEW*)lParam;
@@ -357,7 +358,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
SendMessage(hwndDlg, DM_HIDEPANE, 0, 0);
else {
TCHAR buf[256];
- mir_sntprintf(buf, SIZEOF(buf), _T("%s: %s"), arSounds[tvi.lParam].ptszSection, arSounds[tvi.lParam].ptszDescription);
+ mir_sntprintf(buf, SIZEOF(buf), _T("%s: %s"), arSounds[tvi.lParam].getSection(), arSounds[tvi.lParam].getDescr());
SetDlgItemText(hwndDlg, IDC_NAMEVAL, buf);
if (arSounds[tvi.lParam].ptszTempFile)
SetDlgItemText(hwndDlg, IDC_LOCATION, arSounds[tvi.lParam].ptszTempFile);
@@ -376,24 +377,23 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
case TVN_KEYDOWN:
{
NMTVKEYDOWN* ptkd = (NMTVKEYDOWN*)lParam;
-
- if (ptkd&&ptkd->wVKey == VK_SPACE&&TreeView_GetSelection(ptkd->hdr.hwndFrom))
+ if (ptkd && ptkd->wVKey == VK_SPACE && TreeView_GetSelection(ptkd->hdr.hwndFrom))
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
break;
case NM_CLICK:
{
TVHITTESTINFO hti;
- hti.pt.x=(short)LOWORD(GetMessagePos());
- hti.pt.y=(short)HIWORD(GetMessagePos());
+ hti.pt.x = (short)LOWORD(GetMessagePos());
+ hti.pt.y = (short)HIWORD(GetMessagePos());
ScreenToClient(((LPNMHDR)lParam)->hwndFrom, &hti.pt);
if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &hti))
if (hti.flags & (TVHT_ONITEM | TVHT_ONITEMSTATEICON))
if (TreeView_GetParent(hwndTree, hti.hItem) != NULL)
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- } }
- break;
+ }
+ break;
+ }
}
break;
diff --git a/src/modules/updatenotify/updatenotify.cpp b/src/modules/updatenotify/updatenotify.cpp
index 50129c960a..e27bd5503e 100644
--- a/src/modules/updatenotify/updatenotify.cpp
+++ b/src/modules/updatenotify/updatenotify.cpp
@@ -381,13 +381,13 @@ static int UpdateNotifyMakeRequest(UpdateNotifyData *und) {
rdAlphaValid = UpdateNotifyReleaseDataValid(&rdAlpha);
if (isBetaCheck) {
- if ( !rdBetaValid&&rdStableValid) {
+ if ( !rdBetaValid && rdStableValid) {
UpdateNotifyReleaseLogUpdate(&rdStable);
if (UpdateNotifyIsNewer(dwVersion, rdStable.dwVersion))
resUpdate = 1;
UpdateNotifyReleaseCopyData(&rdStable, und);
}
- else if (rdBetaValid&&rdStableValid&&UpdateNotifyIsNewer(rdBeta.dwVersion, rdStable.dwVersion)) {
+ else if (rdBetaValid && rdStableValid && UpdateNotifyIsNewer(rdBeta.dwVersion, rdStable.dwVersion)) {
UpdateNotifyReleaseLogUpdate(&rdStable);
if (UpdateNotifyIsNewer(dwVersion, UpdateNotifyMakeVersion(rdStable.szVersion)))
resUpdate = 1;
@@ -401,7 +401,7 @@ static int UpdateNotifyMakeRequest(UpdateNotifyData *und) {
}
}
else if (isAlphaCheck) {
- if ( !rdAlphaValid&&rdStableValid) {
+ if ( !rdAlphaValid && rdStableValid) {
if (UpdateNotifyIsNewer(rdStable.dwVersion, rdAlpha.dwVersion)) {
UpdateNotifyReleaseLogUpdate(&rdAlpha);
if (UpdateNotifyIsNewer(dwVersion, rdAlpha.dwVersion))
@@ -415,13 +415,13 @@ static int UpdateNotifyMakeRequest(UpdateNotifyData *und) {
UpdateNotifyReleaseCopyData(&rdStable, und);
}
}
- else if (rdAlphaValid&&rdStableValid&&UpdateNotifyIsNewer(rdAlpha.dwVersion, rdStable.dwVersion)) {
+ else if (rdAlphaValid && rdStableValid && UpdateNotifyIsNewer(rdAlpha.dwVersion, rdStable.dwVersion)) {
UpdateNotifyReleaseLogUpdate(&rdStable);
if (UpdateNotifyIsNewer(dwVersion, rdStable.dwVersion))
resUpdate = 1;
UpdateNotifyReleaseCopyData(&rdStable, und);
}
- else if ( !rdAlphaValid&&rdBetaValid&&rdStableValid) {
+ else if ( !rdAlphaValid && rdBetaValid && rdStableValid) {
if (UpdateNotifyIsNewer(rdStable.dwVersion, rdBeta.dwVersion)) {
UpdateNotifyReleaseLogUpdate(&rdBeta);
if (UpdateNotifyIsNewer(dwVersion, rdBeta.dwVersion))
@@ -474,7 +474,7 @@ static int UpdateNotifyMakeRequest(UpdateNotifyData *und) {
mir_free(tmp);
}
}
- if (resUpdate&&und->version&&und->versionReal&&und->notesUrl&&und->downloadUrl) {
+ if (resUpdate && und->version && und->versionReal && und->notesUrl && und->downloadUrl) {
Netlib_Logf(hNetlibUser, "A new version of Miranda IM is available: %s", und->version);
und->isNew = 1;
}
@@ -586,14 +586,14 @@ static INT_PTR CALLBACK UpdateNotifyProc(HWND hwndDlg, UINT msg, WPARAM wParam,
case IDC_VERSION:
{
UpdateNotifyData *und = (UpdateNotifyData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- if (und&&und->notesUrl)
+ if (und && und->notesUrl)
CallService(MS_UTILS_OPENURL, 1, (LPARAM)und->notesUrl);
break;
}
case IDC_DOWNLOAD:
{
UpdateNotifyData *und = (UpdateNotifyData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- if (und&&und->downloadUrl) {
+ if (und && und->downloadUrl) {
CallService(MS_UTILS_OPENURL, 1, (LPARAM)und->downloadUrl);
DestroyWindow(hwndDlg);
}
@@ -640,7 +640,7 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar
case WM_NOTIFY:
{
NMHDR *hdr = (NMHDR *)lParam;
- if (hdr&&hdr->code == PSN_APPLY) {
+ if (hdr && hdr->code == PSN_APPLY) {
DBWriteContactSettingByte(NULL, UN_MOD, UN_ENABLE, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ENABLEUPDATES)));
if (IsDlgButtonChecked(hwndDlg, IDC_ENABLESTABLE))
DBWriteContactSettingByte(NULL, UN_MOD, UN_NOTIFYTYPE, UN_NOTIFYTYPE_STABLE);
diff --git a/src/modules/useronline/useronline.cpp b/src/modules/useronline/useronline.cpp
index d89dddb2ac..3097db834a 100644
--- a/src/modules/useronline/useronline.cpp
+++ b/src/modules/useronline/useronline.cpp
@@ -35,7 +35,7 @@ static int UserOnlineSettingChanged(WPARAM wParam, LPARAM lParam)
DBWriteContactSettingWord((HANDLE)wParam, "UserOnline", "OldStatus", (WORD)newStatus);
if (CallService(MS_IGNORE_ISIGNORED, wParam, IGNOREEVENT_USERONLINE)) return 0;
if (DBGetContactSettingByte((HANDLE)wParam, "CList", "Hidden", 0)) return 0;
- if (newStatus == ID_STATUS_OFFLINE&&oldStatus != ID_STATUS_OFFLINE) {
+ if (newStatus == ID_STATUS_OFFLINE && oldStatus != ID_STATUS_OFFLINE) {
// Remove the event from the queue if it exists since they are now offline
int lastEvent = (int)DBGetContactSettingDword((HANDLE)wParam, "UserOnline", "LastEvent", 0);
diff --git a/src/modules/utils/path.cpp b/src/modules/utils/path.cpp
index c38f09bcf5..b31267ad2a 100644
--- a/src/modules/utils/path.cpp
+++ b/src/modules/utils/path.cpp
@@ -35,7 +35,7 @@ static int pathIsAbsolute(const char *path)
{
if (strlen(path) <= 2)
return 0;
- if ((path[1] == ':'&&path[2] == '\\') || (path[0] == '\\'&&path[1] == '\\'))
+ if ((path[1] == ':' && path[2] == '\\') || (path[0] == '\\' && path[1] == '\\'))
return 1;
return 0;
}
@@ -136,7 +136,7 @@ static int pathIsAbsoluteW(const TCHAR *path)
{
if (lstrlen(path) <= 2)
return 0;
- if ((path[1] == ':'&&path[2] == '\\') || (path[0] == '\\'&&path[1] == '\\'))
+ if ((path[1] == ':' && path[2] == '\\') || (path[0] == '\\' && path[1] == '\\'))
return 1;
return 0;
}