summaryrefslogtreecommitdiff
path: root/plugins/UserInfoEx/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-04-11 16:47:12 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-04-11 16:47:12 +0000
commit52fe3f7be13509bd336c5efa28b8310a23211034 (patch)
tree70e0948e92b71cd09367545f9655dc343c5cc862 /plugins/UserInfoEx/src
parentfa837bfbc2a705947b14f1ce8ba36d996bb11104 (diff)
- Srmm_ModifyIcon helper applied instead of CallService(MS_MSG_MODIFYICON)
- various fixes related to SRMM icons; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@4426 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/UserInfoEx/src')
-rw-r--r--plugins/UserInfoEx/src/Flags/svc_flags.cpp44
-rw-r--r--plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp52
-rw-r--r--plugins/UserInfoEx/src/classMAnnivDate.cpp4
-rw-r--r--plugins/UserInfoEx/src/classPsTree.cpp2
-rw-r--r--plugins/UserInfoEx/src/classPsTreeItem.cpp6
-rw-r--r--plugins/UserInfoEx/src/commonheaders.h1
-rw-r--r--plugins/UserInfoEx/src/ctrl_tzcombo.cpp8
-rw-r--r--plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp4
-rw-r--r--plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp12
-rw-r--r--plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp4
-rw-r--r--plugins/UserInfoEx/src/init.cpp5
-rw-r--r--plugins/UserInfoEx/src/mir_db.cpp14
-rw-r--r--plugins/UserInfoEx/src/mir_string.cpp4
-rw-r--r--plugins/UserInfoEx/src/psp_contact.cpp4
-rw-r--r--plugins/UserInfoEx/src/psp_options.cpp6
-rw-r--r--plugins/UserInfoEx/src/psp_origin.cpp2
-rw-r--r--plugins/UserInfoEx/src/svc_contactinfo.cpp8
-rw-r--r--plugins/UserInfoEx/src/svc_refreshci.cpp2
18 files changed, 90 insertions, 92 deletions
diff --git a/plugins/UserInfoEx/src/Flags/svc_flags.cpp b/plugins/UserInfoEx/src/Flags/svc_flags.cpp
index 19375c7fb7..55c56e2bdc 100644
--- a/plugins/UserInfoEx/src/Flags/svc_flags.cpp
+++ b/plugins/UserInfoEx/src/Flags/svc_flags.cpp
@@ -89,9 +89,9 @@ static void CALLBACK BufferedProcTimer(HWND hwnd, UINT msg, UINT idTimer, DWORD
MoveMemory(&callList[i],&callList[i+1],((nCallListCount-i-1)*sizeof(struct BufferedCallData)));
--nCallListCount;
--i; /* reiterate current */
- if(nCallListCount) {
+ if (nCallListCount) {
buf=(struct BufferedCallData*)mir_realloc(callList,nCallListCount*sizeof(struct BufferedCallData));
- if(buf!=NULL) callList=buf;
+ if (buf!=NULL) callList=buf;
} else {
mir_free(callList);
callList=NULL;
@@ -108,7 +108,7 @@ static void CALLBACK BufferedProcTimer(HWND hwnd, UINT msg, UINT idTimer, DWORD
}
/* set next timer */
- if(nCallListCount) {
+ if (nCallListCount) {
#ifdef _DEBUG
mir_snprintf(szDbgLine,sizeof(szDbgLine),"next buffered timeout: %ums\n",uElapseNext); /* all ascii */
OutputDebugStringA(szDbgLine);
@@ -135,16 +135,16 @@ void _CallFunctionBuffered(BUFFEREDPROC pfnBuffProc,LPARAM lParam,BOOL fAccumula
/* find existing */
for(i=0;i<nCallListCount;++i)
- if(callList[i].pfnBuffProc==pfnBuffProc)
+ if (callList[i].pfnBuffProc==pfnBuffProc)
if (!fAccumulateSameParam || callList[i].lParam==lParam) {
data=&callList[i];
break;
}
/* append new */
- if(data==NULL) {
+ if (data==NULL) {
/* resize storage array */
data=(struct BufferedCallData*)mir_realloc(callList,(nCallListCount+1)*sizeof(struct BufferedCallData));
- if(data==NULL) return;
+ if (data==NULL) return;
callList=data;
data=&callList[nCallListCount];
++nCallListCount;
@@ -166,7 +166,7 @@ void _CallFunctionBuffered(BUFFEREDPROC pfnBuffProc,LPARAM lParam,BOOL fAccumula
}
#endif
/* set next timer */
- if(idBufferedTimer) uElapse=USER_TIMER_MINIMUM; /* will get recalculated */
+ if (idBufferedTimer) uElapse=USER_TIMER_MINIMUM; /* will get recalculated */
idBufferedTimer=SetTimer(NULL,idBufferedTimer,uElapse,(TIMERPROC)BufferedProcTimer);
}
@@ -181,7 +181,7 @@ void PrepareBufferedFunctions()
// assumes to be called in context of main thread
void KillBufferedFunctions()
{
- if(idBufferedTimer) KillTimer(NULL,idBufferedTimer);
+ if (idBufferedTimer) KillTimer(NULL,idBufferedTimer);
nCallListCount=0;
mir_free(callList); /* does NULL check */
}
@@ -207,7 +207,7 @@ static INT_PTR ServiceDetectContactOriginCountry(WPARAM wParam,LPARAM lParam)
else if (countryNumber = (int)DB::Setting::GetWord((HANDLE)wParam,pszProto,"CompanyCountry",0))
return (INT_PTR)countryNumber;
/* fallback ip detect
- else if(countryNumber==0xFFFF && db_get_b(NULL,"Flags","UseIpToCountry",SETTING_USEIPTOCOUNTRY_DEFAULT)) {
+ else if (countryNumber==0xFFFF && db_get_b(NULL,"Flags","UseIpToCountry",SETTING_USEIPTOCOUNTRY_DEFAULT)) {
countryNumber=ServiceIpToCountry(db_get_dw((HANDLE)wParam,pszProto,"RealIP",0),0);
}*/
@@ -275,10 +275,10 @@ static int OnExtraIconSvcChanged(WPARAM wParam,LPARAM lParam)
bEnable = -1;
break;
}
- if(bEnable == -1)
+ if (bEnable == -1)
return 0;
- if(bEnable && !hApplyIconHook)
+ if (bEnable && !hApplyIconHook)
hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, OnCListApplyIcons);
else if (!bEnable && hApplyIconHook)
UnhookEvent(hApplyIconHook); hApplyIconHook = NULL;
@@ -350,7 +350,7 @@ void MsgWndData::FlagsIconSet()
sid.szModule = MODNAMEFLAGS;
sid.hIconDisabled = sid.hIcon = LoadFlagIcon(m_countryID);
sid.szTooltip = Translate((char*)CallService(MS_UTILS_GETCOUNTRYBYNUMBER,m_countryID,0));
- CallService(MS_MSG_MODIFYICON, (WPARAM)m_hContact, (LPARAM)&sid);
+ Srmm_ModifyIcon(m_hContact, &sid);
}
}
@@ -359,7 +359,7 @@ void MsgWndData::FlagsIconUnset()
StatusIconData sid = { sizeof(sid) };
sid.szModule = MODNAMEFLAGS;
sid.flags = MBF_HIDDEN;
- CallService(MS_MSG_MODIFYICON,(WPARAM)m_hContact,(LPARAM)&sid);
+ Srmm_ModifyIcon(m_hContact, &sid);
}
static int CompareMsgWndData(const MsgWndData* p1, const MsgWndData* p2)
@@ -413,7 +413,7 @@ static __inline int MessageAPI_AddIcon(const char* pszName, const char* szModul/
IconList* p = new IconList(&sid);
if (!p->m_ID)delete p;
else res = gIListMW.insert(p);
- if(res == -1)delete p;
+ if (res == -1)delete p;
return res;
}
@@ -433,14 +433,14 @@ void CALLBACK UpdateStatusIcons(LPARAM lParam) {
static int OnMsgWndEvent(WPARAM wParam,LPARAM lParam) {
MessageWindowEventData *msgwe=(MessageWindowEventData*)lParam;
/* sanity check */
- if(msgwe->hContact==NULL)
+ if (msgwe->hContact==NULL)
return 0;
switch(msgwe->uType) {
case MSG_WINDOW_EVT_OPENING:
{
MsgWndData* msgwnd = gMsgWndList.find((MsgWndData*)&msgwe->hContact);
- if(msgwnd == NULL) {
+ if (msgwnd == NULL) {
msgwnd = new MsgWndData(msgwe->hwndWindow, msgwe->hContact);
gMsgWndList.insert(msgwnd);
}
@@ -461,8 +461,9 @@ static int OnMsgWndEvent(WPARAM wParam,LPARAM lParam) {
}
//hookProc ME_SKIN2_ICONSCHANGED
-static int OnStatusIconsChanged(WPARAM wParam,LPARAM lParam) {
- if(myGlobals.MsgAddIconExist && gFlagsOpts.bShowStatusIconFlag)
+static int OnStatusIconsChanged(WPARAM wParam,LPARAM lParam)
+{
+ if (gFlagsOpts.bShowStatusIconFlag)
CallFunctionBuffered(UpdateStatusIcons,0,FALSE,STATUSICON_REFRESHDELAY);
return 0;
}
@@ -499,7 +500,7 @@ static int OnContactSettingChanged(WPARAM wParam,LPARAM lParam) {
/* Extra Image */
CallFunctionBuffered(SetExtraImage,(LPARAM)wParam,TRUE,EXTRAIMAGE_REFRESHDELAY);
/* Status Icon */
- if(hMsgWndEventHook) {
+ if (hMsgWndEventHook) {
int i = gMsgWndList.getIndex((MsgWndData*)&wParam);
if (i != -1) {
gMsgWndList[i]->ContryIDchange((int)ServiceDetectContactOriginCountry(wParam,0));
@@ -525,7 +526,7 @@ static int OnContactSettingChanged(WPARAM wParam,LPARAM lParam) {
void SvcFlagsLoadModule()
{
PrepareBufferedFunctions();
- if(CallService(MS_UTILS_GETCOUNTRYLIST,(WPARAM)&nCountriesCount,(LPARAM)&countries))
+ if (CallService(MS_UTILS_GETCOUNTRYLIST,(WPARAM)&nCountriesCount,(LPARAM)&countries))
nCountriesCount=0;
InitIcons(); /* load in iconlib */
//InitIpToCountry(); /* not implementet */
@@ -551,8 +552,7 @@ void SvcFlagsOnModulesLoaded()
SvcFlagsEnableExtraIcons(DB::Setting::GetByte(SET_CLIST_EXTRAICON_FLAGS2, 0), FALSE);
/* Status Icon */
- if(myGlobals.MsgAddIconExist)
- hMsgWndEventHook = HookEvent(ME_MSG_WINDOWEVENT, OnMsgWndEvent);
+ hMsgWndEventHook = HookEvent(ME_MSG_WINDOWEVENT, OnMsgWndEvent);
}
/**
diff --git a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp
index 2dd4b1ce73..7bc1e5a0ba 100644
--- a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp
+++ b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp
@@ -106,17 +106,17 @@ static int CountryNumberToBitmapIndex(int countryNumber)
int i,high/*,low=0*/;
high=SIZEOF(BitmapIndexMap);
/*old code need sortet BitmapIndexMap*/
- /*if(countryNumber<=BitmapIndexMap[high])
+ /*if (countryNumber<=BitmapIndexMap[high])
while(low<=high) {
i=low+((high-low)/2);
// never happens
- if(i<0 || i>=SIZEOF(BitmapIndexMap)) DebugBreak();
- if(BitmapIndexMap[i]==countryNumber) return i;
- if(countryNumber>BitmapIndexMap[i]) low=i+1;
+ if (i<0 || i>=SIZEOF(BitmapIndexMap)) DebugBreak();
+ if (BitmapIndexMap[i]==countryNumber) return i;
+ if (countryNumber>BitmapIndexMap[i]) low=i+1;
else high=i-1;
}*/
for ( i=0; i < high; i++ ) {
- if(BitmapIndexMap[i]==countryNumber) return i;
+ if (BitmapIndexMap[i]==countryNumber) return i;
}
}
/* Other,Unknown,Unspecified */
@@ -149,8 +149,8 @@ int CountryNumberToIndex(int countryNumber)
{
int nf=0;
for(int i=0; i < nCountriesCount; i++) {
- if(countries[i].id == countryNumber) return i;
- if(countries[i].id == 0xFFFF) nf=i;
+ if (countries[i].id == countryNumber) return i;
+ if (countries[i].id == 0xFFFF) nf=i;
}
return nf; /* Unknown */
}
@@ -161,12 +161,12 @@ FIBITMAP* ConvertTo(FIBITMAP* dib, UINT destBits, bool greyscale)
switch (destBits) {
case 8:
// convert to 8Bits
- if(greyscale) {
+ if (greyscale) {
dib_res = FIP->FI_ConvertTo8Bits(dib);
}
else {
FIBITMAP* dib_tmp = FIP->FI_ConvertTo24Bits(dib);
- if(dib_tmp) {
+ if (dib_tmp) {
dib_res = FIP->FI_ColorQuantize(dib_tmp, FIQ_WUQUANT/*FIQ_NNQUANT*/);
FIP->FI_Unload(dib_tmp);
}
@@ -193,7 +193,7 @@ FIBITMAP* ConvertTo(FIBITMAP* dib, UINT destBits, bool greyscale)
FIBITMAP* LoadResource(UINT ID, LPTSTR lpType)
{
FIBITMAP *dib = NULL;
- if(lpType) {
+ if (lpType) {
HRSRC hResInfo = FindResource(ghInst,MAKEINTRESOURCE(ID),lpType);
DWORD ResSize = SizeofResource(ghInst,hResInfo);
HGLOBAL hRes = LoadResource(ghInst,hResInfo);
@@ -215,7 +215,7 @@ FIBITMAP* LoadResource(UINT ID, LPTSTR lpType)
}
else {
HBITMAP hScrBM = 0;
- if(NULL == (hScrBM = (HBITMAP)LoadImage(ghInst,MAKEINTRESOURCE(ID), IMAGE_BITMAP, 0, 0,LR_SHARED)))
+ if (NULL == (hScrBM = (HBITMAP)LoadImage(ghInst,MAKEINTRESOURCE(ID), IMAGE_BITMAP, 0, 0,LR_SHARED)))
return dib;
dib = FIP->FI_CreateDIBFromHBITMAP(hScrBM);
DeleteObject(hScrBM);
@@ -229,7 +229,7 @@ static INT_PTR ServiceLoadFlagIcon(WPARAM wParam,LPARAM lParam)
{
/* return handle */
if ((BOOL)lParam) {
- if(phIconHandles==NULL) return NULL;
+ if (phIconHandles==NULL) return NULL;
return (INT_PTR)phIconHandles[CountryNumberToIndex((int)wParam)];
}
/* return icon */
@@ -248,24 +248,24 @@ static INT_PTR ServiceCreateMergedFlagIcon(WPARAM wParam,LPARAM lParam)
HRGN hrgn;
HBITMAP hbmPrev;
/* load both icons */
- if(NULL == (hLowerIcon=(HICON)ServiceLoadFlagIcon((WPARAM)lParam,0))) return NULL;
+ if (NULL == (hLowerIcon=(HICON)ServiceLoadFlagIcon((WPARAM)lParam,0))) return NULL;
hUpperIcon=(HICON)ServiceLoadFlagIcon(wParam,0);
/* merge them */
- if(GetIconInfo(hLowerIcon,&icoi)) {
- if(hUpperIcon!=NULL && GetObject(icoi.hbmColor,sizeof(bm),&bm)) {
+ if (GetIconInfo(hLowerIcon,&icoi)) {
+ if (hUpperIcon!=NULL && GetObject(icoi.hbmColor,sizeof(bm),&bm)) {
hdc=CreateCompatibleDC(NULL);
- if(hdc!=NULL) {
+ if (hdc!=NULL) {
ZeroMemory(&aptTriangle,sizeof(aptTriangle));
aptTriangle[1].y=bm.bmHeight-1;
aptTriangle[2].x=bm.bmWidth-1;
hrgn=CreatePolygonRgn(aptTriangle,SIZEOF(aptTriangle),WINDING);
- if(hrgn!=NULL) {
+ if (hrgn!=NULL) {
SelectClipRgn(hdc,hrgn);
DeleteObject(hrgn);
hbmPrev=(HBITMAP)SelectObject(hdc,icoi.hbmColor);
- if(hbmPrev!=NULL) { /* error on select? */
- if(DrawIconEx(hdc,0,0,hUpperIcon,bm.bmWidth,bm.bmHeight,0,NULL,DI_NOMIRROR|DI_IMAGE)) {
- if(SelectObject(hdc,icoi.hbmMask)!=NULL) /* error on select? */
+ if (hbmPrev!=NULL) { /* error on select? */
+ if (DrawIconEx(hdc,0,0,hUpperIcon,bm.bmWidth,bm.bmHeight,0,NULL,DI_NOMIRROR|DI_IMAGE)) {
+ if (SelectObject(hdc,icoi.hbmMask)!=NULL) /* error on select? */
DrawIconEx(hdc,0,0,hUpperIcon,bm.bmWidth,bm.bmHeight,0,NULL,DI_NOMIRROR|DI_MASK);
}
SelectObject(hdc,hbmPrev);
@@ -299,7 +299,7 @@ void InitIcons()
// FREE_IMAGE_FORMAT fif = FIP->FI_GetFIFFromFilename("dummy.bmp");
/* all those flag icons storing in a large 24bit opaque bitmap to reduce file size */
- if(NULL == (dib = LoadResource(IDB_FLAGSPNG,_T("PNG"))))
+ if (NULL == (dib = LoadResource(IDB_FLAGSPNG,_T("PNG"))))
return;
if (IsWinVerXPPlus()) bitDest = bit = ILC_COLOR32;
@@ -321,7 +321,7 @@ void InitIcons()
}
// res = FIP->FI_IsTransparent(dib_ico);
- if(bit<32) {
+ if (bit<32) {
//disable transparency
FIP->FI_SetTransparent(dib, FALSE);
FIP->FI_SetTransparent(dib_ico, FALSE);
@@ -333,7 +333,7 @@ void InitIcons()
UINT b = t + FIP->FI_GetHeight(dib);
//copy dib to new dib_ico (centered)
- if(FIP->FI_Paste(dib_ico, dib, 0, t-1, 255+1)) {
+ if (FIP->FI_Paste(dib_ico, dib, 0, t-1, 255+1)) {
FIP->FI_Unload(dib); dib = NULL;
switch (bitDest) {
case 8:
@@ -342,7 +342,7 @@ void InitIcons()
{//transparency by 1bit monocrome icon mask (for bit < 32)
BYTE value;
FIBITMAP *dib_mask;
- if(NULL == (dib_mask = FIP->FI_Allocate(w, h, 1, 0, 0, 0))) {
+ if (NULL == (dib_mask = FIP->FI_Allocate(w, h, 1, 0, 0, 0))) {
FIP->FI_Unload(dib_ico);
return;
}
@@ -357,7 +357,7 @@ void InitIcons()
//convert to target resolution
if (!hbmMask || !(dib_ico = ConvertTo(dib_ico, bitDest, 0))) {
FIP->FI_Unload(dib_ico);
- if(hbmMask) DeleteObject(hbmMask);
+ if (hbmMask) DeleteObject(hbmMask);
return;
}
} break;
@@ -421,7 +421,7 @@ void InitIcons()
index = CountryNumberToIndex(countries[i].id);
phIconHandles[index] = Skin_AddIcon(&sid);
- if(sid.hDefaultIcon!=NULL) DestroyIcon(sid.hDefaultIcon);
+ if (sid.hDefaultIcon!=NULL) DestroyIcon(sid.hDefaultIcon);
mir_free(sid.ptszDescription); sid.ptszDescription = NULL;
}
}
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.cpp b/plugins/UserInfoEx/src/classMAnnivDate.cpp
index bce176197d..1325b86958 100644
--- a/plugins/UserInfoEx/src/classMAnnivDate.cpp
+++ b/plugins/UserInfoEx/src/classMAnnivDate.cpp
@@ -537,7 +537,7 @@ int MAnnivDate::DBMoveBirthDate(HANDLE hContact, BYTE bOld, BYTE bNew) {
switch(bOld) {
case 0: //MOD_MBIRTHDAY
if (!DBGetDate(hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR)) {
- if(DBWriteDate(hContact, USERINFO, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR))
+ if (DBWriteDate(hContact, USERINFO, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR))
return 1;
DBDeleteDate(hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR);
DB::Setting::Delete(hContact, MOD_MBIRTHDAY, "BirthMode");
@@ -545,7 +545,7 @@ int MAnnivDate::DBMoveBirthDate(HANDLE hContact, BYTE bOld, BYTE bNew) {
break;
case 1: //USERINFO
if (!DBGetDate(hContact, USERINFO, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR)) {
- if(DBWriteDate(hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR))
+ if (DBWriteDate(hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR))
return 1;
DB::Setting::WriteByte(hContact, MOD_MBIRTHDAY, "BirthMode", 2);
DBDeleteDate(hContact, USERINFO, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR);
diff --git a/plugins/UserInfoEx/src/classPsTree.cpp b/plugins/UserInfoEx/src/classPsTree.cpp
index b1564eb650..2a26926a35 100644
--- a/plugins/UserInfoEx/src/classPsTree.cpp
+++ b/plugins/UserInfoEx/src/classPsTree.cpp
@@ -663,7 +663,7 @@ int CPsTree::BeginLabelEdit(HTREEITEM hItem)
NULL,
ghInst,
NULL );
- if(_hLabelEdit)
+ if (_hLabelEdit)
{
_hDragItem = hItem;
SetUserData(_hLabelEdit, this);
diff --git a/plugins/UserInfoEx/src/classPsTreeItem.cpp b/plugins/UserInfoEx/src/classPsTreeItem.cpp
index 348f468031..513bfa3d7f 100644
--- a/plugins/UserInfoEx/src/classPsTreeItem.cpp
+++ b/plugins/UserInfoEx/src/classPsTreeItem.cpp
@@ -226,12 +226,12 @@ BYTE CPsTreeItem::HasName(const LPCSTR pszName) const
**/
void CPsTreeItem::Rename(const LPTSTR pszLabel)
{
- if(pszLabel && *pszLabel)
+ if (pszLabel && *pszLabel)
{
LPTSTR pszDup = mir_tcsdup(pszLabel);
- if(pszDup)
+ if (pszDup)
{
- if(_ptszLabel)
+ if (_ptszLabel)
{
mir_free(_ptszLabel);
}
diff --git a/plugins/UserInfoEx/src/commonheaders.h b/plugins/UserInfoEx/src/commonheaders.h
index 8baa7f1eb9..32d50e43c9 100644
--- a/plugins/UserInfoEx/src/commonheaders.h
+++ b/plugins/UserInfoEx/src/commonheaders.h
@@ -173,7 +173,6 @@ typedef struct _MGLOBAL
{
DWORD mirandaVersion; // mirandaVersion
BYTE CanChangeDetails : 1; // is service to upload own contact information for icq present?
- BYTE MsgAddIconExist : 1; // Messsage Window support status Icon
BYTE TzIndexExist : 1; // Win Reg has Timzone Index Info
BYTE PopUpActionsExist : 1; // Popup++ or MS_POPUP_REGISTERACTIONS exist
BYTE ShowPropsheetColours : 1; // cached SET_PROPSHEET_SHOWCOLOURS database value
diff --git a/plugins/UserInfoEx/src/ctrl_tzcombo.cpp b/plugins/UserInfoEx/src/ctrl_tzcombo.cpp
index b9ac970183..ee20dd2bbd 100644
--- a/plugins/UserInfoEx/src/ctrl_tzcombo.cpp
+++ b/plugins/UserInfoEx/src/ctrl_tzcombo.cpp
@@ -55,7 +55,7 @@ CBaseCtrl* CTzCombo::CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting)
ctrl = new CTzCombo(hDlg, idCtrl, pszSetting);
if (ctrl) {
//use new core tz interface
- if(tmi.prepareList) {
+ if (tmi.prepareList) {
//set the adress of our timezone handle as itemdata
//caller can obtain the handle htz to extract all relevant information
ctrl->_curSel = 0;
@@ -161,7 +161,7 @@ BOOL CTzCombo::OnInfoChanged(HANDLE hContact, LPCSTR pszProto)
{
if (!_Flags.B.hasChanged) {
//use new core tz interface to change the cbbox
- if(tmi.storeListResults) {
+ if (tmi.storeListResults) {
_curSel = CB_ERR;
// _curSel = tmi.selectListItem(hContact, _hwnd, TZF_PLF_CB);
//dident work well, coz no fallback to proto setting.
@@ -205,7 +205,7 @@ void CTzCombo::OnApply(HANDLE hContact, LPCSTR pszProto)
const char* pszModule = hContact ? USERINFO : pszProto;
if (_Flags.B.hasCustom || !hContact) {
//use new core tz interface
- if(tmi.storeListResults) {
+ if (tmi.storeListResults) {
tmi.storeListResults(hContact, _hwnd, TZF_PLF_CB);
if (!hContact) {
_Flags.B.hasCustom = 0;
@@ -276,7 +276,7 @@ void CTzCombo::OnChangedByUser(WORD wChangedMsg)
void CTzCombo::GetTime(LPTSTR szTime, WORD cchTime)
{
//use new core tz interface
- if(tmi.printDateTime) {
+ if (tmi.printDateTime) {
tmi.printDateTime((HANDLE)ComboBox_GetItemData(_hwnd, _curSel), _T("t"), szTime, cchTime, 0);
}
//fallback use old UIEX method
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp
index 16cd75e6d7..aea0d35064 100644
--- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp
+++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp
@@ -250,7 +250,7 @@ HANDLE CExImContactBase::toDB()
// create new contact if none exists
if (_hContact == INVALID_HANDLE_VALUE && _pszProto && _pszUIDKey && _dbvUID.type != DBVT_DELETED) {
PROTOACCOUNT* pszAccount = 0;
- if(NULL == (pszAccount = ProtoGetAccount( _pszProto ))) {
+ if (NULL == (pszAccount = ProtoGetAccount( _pszProto ))) {
//account does not exist
_hContact = INVALID_HANDLE_VALUE;
return INVALID_HANDLE_VALUE;
@@ -394,7 +394,7 @@ BYTE CExImContactBase::compareUID(DBVARIANT *dbv)
hash = hashSettingW_M2((const char *)tmp);
mir_free(tmp);
}
- if(hash == _dbvUIDHash) return TRUE;
+ if (hash == _dbvUIDHash) return TRUE;
break;
case DBVT_BLOB: //'n' cpbVal and pbVal are valid
if (_dbvUID.type == dbv->type &&
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp
index 6ec7ac7bdd..04ac62cb3b 100644
--- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp
+++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp
@@ -376,7 +376,7 @@ int CExImContactXML::ExportSetting(TiXmlElement *xmlModule, LPCSTR pszModule, LP
break;
case DBVT_ASCIIZ: //'s' pszVal is valid
{
- if(mir_IsEmptyA(dbv.pszVal)) break;
+ if (mir_IsEmptyA(dbv.pszVal)) break;
DB::Variant::ConvertString(&dbv, DBVT_UTF8);
if (str = (LPSTR)mir_alloc(mir_strlen(dbv.pszVal) + 2)) {
str[0] = 's';
@@ -388,7 +388,7 @@ int CExImContactXML::ExportSetting(TiXmlElement *xmlModule, LPCSTR pszModule, LP
}
case DBVT_UTF8: //'u' pszVal is valid
{
- if(mir_IsEmptyA(dbv.pszVal)) break;
+ if (mir_IsEmptyA(dbv.pszVal)) break;
if (str = (LPSTR)mir_alloc(mir_strlen(dbv.pszVal) + 2)) {
str[0] = 'u';
mir_strcpy(&str[1], dbv.pszVal);
@@ -399,7 +399,7 @@ int CExImContactXML::ExportSetting(TiXmlElement *xmlModule, LPCSTR pszModule, LP
}
case DBVT_WCHAR: //'u' pwszVal is valid
{
- if(mir_IsEmptyW(dbv.pwszVal)) break;
+ if (mir_IsEmptyW(dbv.pwszVal)) break;
DB::Variant::ConvertString(&dbv, DBVT_UTF8);
if (str = (LPSTR)mir_alloc(mir_strlen(dbv.pszVal) + 2)) {
str[0] = 'u';
@@ -912,7 +912,7 @@ int CExImContactXML::ImportModule(TiXmlNode* xmlModule)
continue;
}
// just ignore MetaModule on Meta to avoid errors (only import spetial keys)
- else if(isProtoModule && isMetaModule) {
+ else if (isProtoModule && isMetaModule) {
if (!mir_stricmp(xKey->Attribute("key"),"Nick") ||
!mir_stricmp(xKey->Attribute("key"),"TzName") ||
!mir_stricmp(xKey->Attribute("key"),"Timezone")) {
@@ -1030,12 +1030,12 @@ int CExImContactXML::ImportSetting(LPCSTR pszModule, TiXmlElement *xmlEntry)
if (CallService(MS_DB_CONTACT_WRITESETTING, (WPARAM)_hContact, (LPARAM)&cws)) {
//if (cws.value.pbVal>0)
mir_free(cws.value.pbVal);
- if(cws.value.type == DBVT_ASCIIZ || cws.value.type == DBVT_UTF8) mir_free(cws.value.pszVal);
+ if (cws.value.type == DBVT_ASCIIZ || cws.value.type == DBVT_UTF8) mir_free(cws.value.pszVal);
return ERROR_NOT_ADDED;
}
//if (cws.value.pbVal>0)
mir_free(cws.value.pbVal);
- if(cws.value.type == DBVT_ASCIIZ || cws.value.type == DBVT_UTF8) mir_free(cws.value.pszVal);
+ if (cws.value.type == DBVT_ASCIIZ || cws.value.type == DBVT_UTF8) mir_free(cws.value.pszVal);
return ERROR_OK;
}
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp
index e3a1ecdf8d..6899903e3e 100644
--- a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp
+++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp
@@ -104,7 +104,7 @@ CProgress::CProgress()
**/
CProgress::~CProgress()
{
- if(IsWindow(_hDlg)) DestroyWindow(_hDlg);
+ if (IsWindow(_hDlg)) DestroyWindow(_hDlg);
}
/**
@@ -224,7 +224,7 @@ BYTE CProgress::UpdateSetting(LPCTSTR pszFormat, ...)
mir_vsntprintf(buf, SIZEOF(buf), TranslateTS(pszFormat), vl);
va_end(vl);
GetDlgItemText(_hDlg, TXT_SETTING, tmp, SIZEOF(tmp));
- if(mir_tcsicmp(tmp,buf))
+ if (mir_tcsicmp(tmp,buf))
SetDlgItemText(_hDlg, TXT_SETTING, buf);
}
SendMessage(hProg, PBM_SETPOS, (int)SendMessage(hProg, PBM_GETPOS, 0, 0) + 1, 0);
diff --git a/plugins/UserInfoEx/src/init.cpp b/plugins/UserInfoEx/src/init.cpp
index d353c585a8..ea02f62a8e 100644
--- a/plugins/UserInfoEx/src/init.cpp
+++ b/plugins/UserInfoEx/src/init.cpp
@@ -70,7 +70,6 @@ static int OnTopToolBarLoaded(WPARAM wParam, LPARAM lParam)
static int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
{
myGlobals.PopUpActionsExist = ServiceExists(MS_POPUP_REGISTERACTIONS);
- myGlobals.MsgAddIconExist = ServiceExists(MS_MSG_MODIFYICON);
// init meta contacts
INT_PTR ptr = CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
@@ -187,10 +186,10 @@ extern "C" int __declspec(dllexport) Load(void)
// init freeimage interface
INT_PTR result = CALLSERVICE_NOTFOUND;
- if(ServiceExists(MS_IMG_GETINTERFACE))
+ if (ServiceExists(MS_IMG_GETINTERFACE))
result = CallService(MS_IMG_GETINTERFACE, FI_IF_VERSION, (LPARAM)&FIP);
- if(FIP == NULL || result != S_OK) {
+ if (FIP == NULL || result != S_OK) {
MessageBoxEx(NULL, TranslateT("Fatal error, image services not found. Flags Module will be disabled."), _T("Error"), MB_OK | MB_ICONERROR | MB_APPLMODAL, 0);
return 1;
}
diff --git a/plugins/UserInfoEx/src/mir_db.cpp b/plugins/UserInfoEx/src/mir_db.cpp
index 9f9d3b8ed6..c41df9076b 100644
--- a/plugins/UserInfoEx/src/mir_db.cpp
+++ b/plugins/UserInfoEx/src/mir_db.cpp
@@ -254,7 +254,7 @@ BYTE IsEmpty(HANDLE hContact, LPCSTR pszModule)
**/
BYTE IsMeta(LPCSTR pszModule)
{
- if(myGlobals.szMetaProto)
+ if (myGlobals.szMetaProto)
return !mir_strcmp(pszModule, myGlobals.szMetaProto);
return !mir_strcmp(pszModule, "MetaContacts");
}
@@ -1042,7 +1042,7 @@ BYTE GetInfoWithData(HANDLE hEvent, DBEVENTINFO *dbei)
INT_PTR size = BlobSizeOf(hEvent);
dbei->cbBlob = (size != -1) ? (DWORD)size : 0;
}
- if(dbei->cbBlob) {
+ if (dbei->cbBlob) {
dbei->pBlob = (PBYTE) mir_alloc(dbei->cbBlob);
if (dbei->pBlob == NULL) {
dbei->cbBlob = 0;
@@ -1106,7 +1106,7 @@ BYTE IsEqual(const DBEVENTINFO *d1, const DBEVENTINFO *d2, bool Data)
(d1->cbBlob == d2->cbBlob) &&
(!d1->szModule || !d2->szModule || !_stricmp(d1->szModule, d2->szModule))
;
- if(Data) {
+ if (Data) {
return res &&
(!d1->pBlob || !d2->pBlob || !memcmp(d1->pBlob,d2->pBlob,d1->cbBlob))
;
@@ -1141,9 +1141,9 @@ BYTE Exists(HANDLE hContact, HANDLE& hDbExistingEvent, DBEVENTINFO *dbei)
if ((dbei->timestamp < edbei.timestamp)) {
return FALSE;
}
- if(IsEqual(dbei, &edbei, false)) {
+ if (IsEqual(dbei, &edbei, false)) {
if (!GetInfoWithData(hDbExistingEvent, &edbei)) {
- if(IsEqual(dbei, &edbei, true)) {
+ if (IsEqual(dbei, &edbei, true)) {
mir_free(edbei.pBlob);
return TRUE;
}
@@ -1166,7 +1166,7 @@ BYTE Exists(HANDLE hContact, HANDLE& hDbExistingEvent, DBEVENTINFO *dbei)
hDbExistingEvent = edbe;
//compare without data (faster)
if ( result = IsEqual(dbei, &edbei, false)) {
- if(NULL == (result = !GetInfoWithData(edbe, &edbei))) continue;
+ if (NULL == (result = !GetInfoWithData(edbe, &edbei))) continue;
//compare with data
result = IsEqual(dbei, &edbei, true);
mir_free(edbei.pBlob);
@@ -1183,7 +1183,7 @@ BYTE Exists(HANDLE hContact, HANDLE& hDbExistingEvent, DBEVENTINFO *dbei)
hDbExistingEvent = edbe;
//compare without data (faster)
if ( result = IsEqual(dbei, &edbei, false)) {
- if(NULL == (result = !GetInfoWithData(edbe, &edbei))) continue;
+ if (NULL == (result = !GetInfoWithData(edbe, &edbei))) continue;
//compare with data
result = IsEqual(dbei, &edbei, true);
mir_free(edbei.pBlob);
diff --git a/plugins/UserInfoEx/src/mir_string.cpp b/plugins/UserInfoEx/src/mir_string.cpp
index 882cb3301b..c538c110ad 100644
--- a/plugins/UserInfoEx/src/mir_string.cpp
+++ b/plugins/UserInfoEx/src/mir_string.cpp
@@ -128,7 +128,7 @@ size_t mir_snwprintf(wchar_t *pszDest, const size_t cchDest, const wchar_t *pszF
int mir_IsEmptyA(char *str)
{
- if(str == NULL || str[0] == 0)
+ if (str == NULL || str[0] == 0)
return 1;
int i = 0;
while (str[i]) {
@@ -143,7 +143,7 @@ int mir_IsEmptyA(char *str)
int mir_IsEmptyW(wchar_t *str)
{
- if(str == NULL || str[0] == 0)
+ if (str == NULL || str[0] == 0)
return 1;
int i = 0;
while (str[i]) {
diff --git a/plugins/UserInfoEx/src/psp_contact.cpp b/plugins/UserInfoEx/src/psp_contact.cpp
index 912134281e..b5ac2dab8c 100644
--- a/plugins/UserInfoEx/src/psp_contact.cpp
+++ b/plugins/UserInfoEx/src/psp_contact.cpp
@@ -167,7 +167,7 @@ INT_PTR CALLBACK PSPProcContactHome(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
break;
case EDIT_COUNTRY:
- if(HIWORD(wParam) == CBN_SELCHANGE) {
+ if (HIWORD(wParam) == CBN_SELCHANGE) {
LPIDSTRLIST pd = (LPIDSTRLIST)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam));
UpDate_CountryIcon(GetDlgItem(hDlg, ICO_COUNTRY), pd->nID);
}
@@ -322,7 +322,7 @@ INT_PTR CALLBACK PSPProcContactWork(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
break;
case EDIT_COUNTRY:
- if(HIWORD(wParam) == CBN_SELCHANGE) {
+ if (HIWORD(wParam) == CBN_SELCHANGE) {
LPIDSTRLIST pd = (LPIDSTRLIST)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam));
UpDate_CountryIcon(GetDlgItem(hDlg, ICO_COUNTRY), pd->nID);
}
diff --git a/plugins/UserInfoEx/src/psp_options.cpp b/plugins/UserInfoEx/src/psp_options.cpp
index ea0b2c76d8..5ae5c14471 100644
--- a/plugins/UserInfoEx/src/psp_options.cpp
+++ b/plugins/UserInfoEx/src/psp_options.cpp
@@ -389,8 +389,8 @@ static INT_PTR CALLBACK DlgProc_CommonOpts(HWND hDlg, UINT uMsg, WPARAM wParam,
SvcGenderEnableExtraIcons(IsDlgButtonChecked(hDlg, CHECK_OPT_GENDER)? 1:-1, TRUE);
- if(FlagsClistChange) EnsureExtraImages();
- if(FlagsMsgWndChange) UpdateStatusIcons(NULL);
+ if (FlagsClistChange) EnsureExtraImages();
+ if (FlagsMsgWndChange) UpdateStatusIcons(NULL);
SvcHomepageEnableExtraIcons(IsDlgButtonChecked(hDlg, CHECK_OPT_HOMEPAGEICON), TRUE);
SvcEMailEnableExtraIcons(IsDlgButtonChecked(hDlg, CHECK_OPT_EMAILICON), TRUE);
@@ -490,7 +490,7 @@ static INT_PTR CALLBACK DlgProc_AdvancedOpts(HWND hDlg, UINT uMsg, WPARAM wParam
DBGetCheckBtn(hDlg, CHECK_OPT_BUTTONICONS, SET_ICONS_BUTTONS, TRUE);
DBGetCheckBtn(hDlg, CHECK_OPT_METASCAN, SET_META_SCAN, TRUE);
DBGetCheckBtn(hDlg, CHECK_OPT_SREMAIL_ENABLED, SET_EXTENDED_EMAILSERVICE, TRUE);
- if(tmi.getTimeZoneTime) {
+ if (tmi.getTimeZoneTime) {
CheckDlgButton(hDlg, CHECK_OPT_AUTOTIMEZONE, TRUE);
EnableWindow(GetDlgItem(hDlg, CHECK_OPT_AUTOTIMEZONE), FALSE);
}
diff --git a/plugins/UserInfoEx/src/psp_origin.cpp b/plugins/UserInfoEx/src/psp_origin.cpp
index d822eab505..7980af97f6 100644
--- a/plugins/UserInfoEx/src/psp_origin.cpp
+++ b/plugins/UserInfoEx/src/psp_origin.cpp
@@ -136,7 +136,7 @@ INT_PTR CALLBACK PSPProcOrigin(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
switch (LOWORD(wParam))
{
case EDIT_COUNTRY:
- if(HIWORD(wParam) == CBN_SELCHANGE) {
+ if (HIWORD(wParam) == CBN_SELCHANGE) {
LPIDSTRLIST pd = (LPIDSTRLIST)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam));
UpDate_CountryIcon(GetDlgItem(hDlg, ICO_COUNTRY), pd->nID);
}
diff --git a/plugins/UserInfoEx/src/svc_contactinfo.cpp b/plugins/UserInfoEx/src/svc_contactinfo.cpp
index b7760f225d..a29d2e2b33 100644
--- a/plugins/UserInfoEx/src/svc_contactinfo.cpp
+++ b/plugins/UserInfoEx/src/svc_contactinfo.cpp
@@ -148,7 +148,7 @@ static FORCEINLINE INT_PTR GCIVarEx(CONTACTINFO *ci, LPCSTR pszSetting)
static FORCEINLINE INT_PTR GCILangEx(CONTACTINFO *ci, LPCSTR pszSetting)
{
if (0 == GCIVarEx(ci, pszSetting)) {
- if(ci->type!= CNFT_ASCIIZ) {
+ if (ci->type!= CNFT_ASCIIZ) {
//lang was safed in database as code
LPIDSTRLIST pList;
UINT nList, i, res = 0;
@@ -160,7 +160,7 @@ static FORCEINLINE INT_PTR GCILangEx(CONTACTINFO *ci, LPCSTR pszSetting)
}
GetLanguageList(&nList, &pList);
for(i = 0; i<nList; i++) {
- if(pList[i].nID == res) {
+ if (pList[i].nID == res) {
//use untranslate string (pszText member)
ci->pszVal = (ci->dwFlag & CNF_UNICODE)
? (LPTSTR) mir_a2u(pList[i].pszText)
@@ -379,7 +379,7 @@ INT_PTR GetContactInfo(WPARAM wParam, LPARAM lParam)
case CNF_FIRSTLAST: {
result = GCIVarEx(ci, SET_CONTACT_FIRSTLASTNAME); //first try to read "FullName"
- if(result) result = GCIFirstLast(ci); //fallback to "FirstName" + "LastName"
+ if (result) result = GCIFirstLast(ci); //fallback to "FirstName" + "LastName"
} break;
case CNF_NICK: {
@@ -576,7 +576,7 @@ INT_PTR GetContactInfo(WPARAM wParam, LPARAM lParam)
case CNF_TIMEZONE: {
//use new core tz interface
- if(tmi.prepareList) {
+ if (tmi.prepareList) {
HANDLE hTz = tmi.createByContact(ci->hContact, TZF_KNOWNONLY);
if (hTz) {
LPTIME_ZONE_INFORMATION tzi = tmi.getTzi(hTz);
diff --git a/plugins/UserInfoEx/src/svc_refreshci.cpp b/plugins/UserInfoEx/src/svc_refreshci.cpp
index 2db5949405..e2c5674a6f 100644
--- a/plugins/UserInfoEx/src/svc_refreshci.cpp
+++ b/plugins/UserInfoEx/src/svc_refreshci.cpp
@@ -888,7 +888,7 @@ static int OnContactAdded(WPARAM wParam, LPARAM lParam)
**/
static int OnPreShutdown(WPARAM, LPARAM)
{
- if(ContactUpdater) {
+ if (ContactUpdater) {
delete ContactUpdater;
ContactUpdater = 0;
}