From 5d6f21891542442500056f8732625cdbf6a3cb76 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 10 Oct 2013 12:53:23 +0000 Subject: status bar code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@6426 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/clist/clisttray.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/modules/clist/clisttray.cpp b/src/modules/clist/clisttray.cpp index 518580d531..ba7d92857b 100644 --- a/src/modules/clist/clisttray.cpp +++ b/src/modules/clist/clisttray.cpp @@ -110,15 +110,15 @@ TCHAR* fnTrayIconMakeTooltip(const TCHAR *szPrefix, const char *szProto) if ( !szStatus) continue; - TCHAR *ProtoXStatus = sttGetXStatus(pa->szModuleName); - if (mToolTipTrayTips) { TCHAR tipline[256]; mir_sntprintf(tipline, SIZEOF(tipline), _T("%-12.12s\t%s"), pa->tszAccountName, szStatus); if (cli.szTip[0]) _tcsncat(cli.szTip, szSeparator, MAX_TIP_SIZE - _tcslen(cli.szTip)); _tcsncat(cli.szTip, tipline, MAX_TIP_SIZE - _tcslen(cli.szTip)); - if (ProtoXStatus) { + + ptrT ProtoXStatus( sttGetXStatus(pa->szModuleName)); + if (ProtoXStatus != NULL) { mir_sntprintf(tipline, SIZEOF(tipline), _T("%-24.24s\n"), ProtoXStatus); if (cli.szTip[0]) _tcsncat(cli.szTip, szSeparator, MAX_TIP_SIZE - _tcslen(cli.szTip)); @@ -133,18 +133,17 @@ TCHAR* fnTrayIconMakeTooltip(const TCHAR *szPrefix, const char *szProto) _tcsncat(cli.szTip, _T(" "), MAX_TIP_SIZE - _tcslen(cli.szTip)); _tcsncat(cli.szTip, szStatus, MAX_TIP_SIZE - _tcslen(cli.szTip)); } - mir_free(ProtoXStatus); } } else { PROTOACCOUNT *pa = Proto_GetAccount(szProto); if (pa != NULL) { - TCHAR *ProtoXStatus = sttGetXStatus(szProto); + ptrT ProtoXStatus( sttGetXStatus(szProto)); szStatus = cli.pfnGetStatusModeDescription(CallProtoServiceInt(NULL,szProto, PS_GETSTATUS, 0, 0), 0); if (szPrefix && szPrefix[0]) { if (db_get_b(NULL, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT)) { if (mToolTipTrayTips) { - if (ProtoXStatus) + if (ProtoXStatus != NULL) mir_sntprintf(cli.szTip, MAX_TIP_SIZE, _T("%s%s%-12.12s\t%s%s%-24.24s"), szPrefix, szSeparator, pa->tszAccountName, szStatus, szSeparator, ProtoXStatus); else mir_sntprintf(cli.szTip, MAX_TIP_SIZE, _T("%s%s%-12.12s\t%s"), szPrefix, szSeparator, pa->tszAccountName, szStatus); @@ -155,14 +154,13 @@ TCHAR* fnTrayIconMakeTooltip(const TCHAR *szPrefix, const char *szProto) } else { if (mToolTipTrayTips) { - if (ProtoXStatus) + if (ProtoXStatus != NULL) mir_sntprintf(cli.szTip, MAX_TIP_SIZE, _T("%-12.12s\t%s\n%-24.24s"), pa->tszAccountName, szStatus, ProtoXStatus); else mir_sntprintf(cli.szTip, MAX_TIP_SIZE, _T("%-12.12s\t%s"), pa->tszAccountName, szStatus); } else mir_sntprintf(cli.szTip, MAX_TIP_SIZE, _T("%s %s"), pa->tszAccountName, szStatus); } - mir_free(ProtoXStatus); } } -- cgit v1.2.3