diff options
author | George Hazan <george.hazan@gmail.com> | 2015-04-16 14:03:24 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-04-16 14:03:24 +0000 |
commit | 8bd2456f654ef5eea44fcf4ad6ce5f7107f7d829 (patch) | |
tree | 8ae03049734c96a5feba398f5c142d9a4213d640 /src/modules | |
parent | c3908b9c6d53a6aef5e25975d3b336974e6dd610 (diff) |
IsStatusConnecting() - useful macro
git-svn-id: http://svn.miranda-ng.org/main/trunk@12860 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/clist/clistmod.cpp | 6 | ||||
-rw-r--r-- | src/modules/clist/clui.cpp | 2 | ||||
-rw-r--r-- | src/modules/skin/skinicons.cpp | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/modules/clist/clistmod.cpp b/src/modules/clist/clistmod.cpp index 74d4a38aa8..8c5ef09b82 100644 --- a/src/modules/clist/clistmod.cpp +++ b/src/modules/clist/clistmod.cpp @@ -101,9 +101,9 @@ TCHAR* fnGetStatusModeDescription(int mode, int flags) descr = LPGENT("Idle");
break;
default:
- if (mode > ID_STATUS_CONNECTING && mode < ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES) {
+ if (IsStatusConnecting(mode)) {
const TCHAR* connFmt = LPGENT("Connecting (attempt %d)");
- mir_sntprintf(szMode, SIZEOF(szMode), (flags&GSMDF_UNTRANSLATED)?connFmt:TranslateTS(connFmt), mode - ID_STATUS_CONNECTING + 1);
+ mir_sntprintf(szMode, SIZEOF(szMode), (flags & GSMDF_UNTRANSLATED) ? connFmt : TranslateTS(connFmt), mode - ID_STATUS_CONNECTING + 1);
return szMode;
}
return NULL;
@@ -114,7 +114,7 @@ TCHAR* fnGetStatusModeDescription(int mode, int flags) static INT_PTR GetStatusModeDescription(WPARAM wParam, LPARAM lParam)
{
- TCHAR* buf1 = cli.pfnGetStatusModeDescription(wParam, lParam);
+ TCHAR *buf1 = cli.pfnGetStatusModeDescription(wParam, lParam);
if (!(lParam & GSMDF_TCHAR)) {
static char szMode[64];
diff --git a/src/modules/clist/clui.cpp b/src/modules/clist/clui.cpp index 74afdda313..c330fdc95f 100644 --- a/src/modules/clist/clui.cpp +++ b/src/modules/clist/clui.cpp @@ -182,7 +182,7 @@ static INT_PTR MenuItem_DeleteContact(WPARAM wParam, LPARAM lParam) DWORD caps = CallProtoServiceInt(NULL, szProto, PS_GETCAPS, PFLAGNUM_1, 0);
if (caps & PF1_SERVERCLIST) {
int status = CallProtoServiceInt(NULL, szProto, PS_GETSTATUS, 0, 0);
- if (status == ID_STATUS_OFFLINE || (status >= ID_STATUS_CONNECTING && status < ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES)) {
+ if (status == ID_STATUS_OFFLINE || IsStatusConnecting(status)) {
// Set a flag so we remember to delete the contact when the protocol goes online the next time
db_set_b(wParam, "CList", "Delete", 1);
MessageBox(NULL,
diff --git a/src/modules/skin/skinicons.cpp b/src/modules/skin/skinicons.cpp index 048322bc49..d7c2884f14 100644 --- a/src/modules/skin/skinicons.cpp +++ b/src/modules/skin/skinicons.cpp @@ -233,7 +233,7 @@ HICON LoadSkinProtoIcon(const char *szProto, int status, bool big) else if ((caps2 = CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAGNUM_2, 0)) == CALLSERVICE_NOTFOUND)
caps2 = 0;
- if (status >= ID_STATUS_CONNECTING && status < ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES) {
+ if (IsStatusConnecting(status)) {
mir_snprintf(iconName, SIZEOF(iconName), "%s%d", mainIconsFmt, 7);
return IcoLib_GetIcon(iconName, big);
}
|