From 3f23417a1099f73dc28ec1b7d6ec2a1a7fc2b7a2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 18 Jun 2012 20:53:59 +0000 Subject: - PLUGININFO structure removed at all; - Options_AddPage & UserInfo_AddPage replaced MS_OPT_ADDPAGE & MS_USERINFO_ADDPAGE services respectively - total internal redesign of options' translation - code reformatting git-svn-id: http://svn.miranda-ng.org/main/trunk@477 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/findadd/searchresults.cpp | 70 +++++++++++++++++------------------ 1 file changed, 35 insertions(+), 35 deletions(-) (limited to 'src/modules/findadd/searchresults.cpp') diff --git a/src/modules/findadd/searchresults.cpp b/src/modules/findadd/searchresults.cpp index 81ca1d661a..2422f262d1 100644 --- a/src/modules/findadd/searchresults.cpp +++ b/src/modules/findadd/searchresults.cpp @@ -76,13 +76,13 @@ void LoadColumnSizes(HWND hwndResults, const char *szProto) for (i=0; i < NUM_COLUMNID; i++) { LVCOLUMN lvc; - if ( i < columnCount ) + if (i < columnCount) { int bNeedsFree = FALSE; lvc.mask = LVCF_TEXT | LVCF_WIDTH; - if ( szColumnNames[i] != NULL ) - lvc.pszText = TranslateTS( szColumnNames[i] ); - else if ( i == COLUMNID_HANDLE ) + if (szColumnNames[i] != NULL) + lvc.pszText = TranslateTS(szColumnNames[i]); + else if (i == COLUMNID_HANDLE) { if (szProto) { @@ -137,12 +137,12 @@ int CALLBACK SearchResultsCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lPa sortMultiplier=dat->bSortAscending?1:-1; sortCol=dat->iLastColumnSortIndex; - if (!dat->bFlexSearchResult) + if ( !dat->bFlexSearchResult) { lsr1=(struct ListSearchResult*)ListView_GetItemLParam(hList, (int)lParam1); lsr2=(struct ListSearchResult*)ListView_GetItemLParam(hList, (int)lParam2); - if ( lsr1 == NULL || lsr2 == NULL ) return 0; + if (lsr1 == NULL || lsr2 == NULL) return 0; switch(sortCol) { case COLUMNID_PROTO: @@ -194,7 +194,7 @@ void FreeSearchResults(HWND hwndResults) static void BeginSearchFailed(void * arg) { TCHAR buf[128]; - if ( arg != NULL ) { + if (arg != NULL) { const TCHAR* protoName = (TCHAR*)arg; mir_sntprintf(buf, SIZEOF(buf), TranslateT("Could not start a search on '%s', there was a problem - is %s connected?"), @@ -208,18 +208,18 @@ static void BeginSearchFailed(void * arg) int BeginSearch(HWND, struct FindAddDlgData *dat, const char *szProto, const char *szSearchService, DWORD requiredCapability, void *pvSearchParams) { int i; - if ( szProto == NULL ) { + if (szProto == NULL) { int failures = 0; dat->searchCount = 0; dat->search = (struct ProtoSearchInfo*)mir_calloc(sizeof(struct ProtoSearchInfo) * accounts.getCount()); - for ( i=0; i < accounts.getCount();i++) { + for (i=0; i < accounts.getCount();i++) { PROTOACCOUNT* pa = accounts[i]; - if (!Proto_IsAccountEnabled(pa)) continue; + if ( !Proto_IsAccountEnabled(pa)) continue; DWORD caps=(DWORD)CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0); - if (!(caps&requiredCapability)) continue; + if ( !(caps&requiredCapability)) continue; dat->search[dat->searchCount].hProcess = (HANDLE)CallProtoService(pa->szModuleName, szSearchService, 0, (LPARAM)pvSearchParams); dat->search[dat->searchCount].szProto = pa->szModuleName; - if ( dat->search[dat->searchCount].hProcess == NULL ) failures++; + if (dat->search[dat->searchCount].hProcess == NULL) failures++; else dat->searchCount++; } if (failures) { @@ -254,21 +254,21 @@ void SetStatusBarSearchInfo(HWND hwndStatus, struct FindAddDlgData *dat) { TCHAR str[256]; - if (dat->searchCount != 0 ) { + if (dat->searchCount != 0) { int i; - lstrcpy( str, TranslateT("Searching")); - for ( i=0; i < dat->searchCount; i++ ) { - PROTOACCOUNT* pa = Proto_GetAccount( dat->search[i].szProto ); - if ( !pa ) + lstrcpy(str, TranslateT("Searching")); + for (i=0; i < dat->searchCount; i++) { + PROTOACCOUNT* pa = Proto_GetAccount(dat->search[i].szProto); + if ( !pa) continue; - lstrcat(str, i ? _T(", ") : _T( " " )); - lstrcat(str, pa->tszAccountName ); + lstrcat(str, i ? _T(", ") : _T(" ")); + lstrcat(str, pa->tszAccountName); } } else lstrcpy(str, TranslateT("Idle")); - SendMessage( hwndStatus, SB_SETTEXT, 0, (LPARAM)str ); + SendMessage(hwndStatus, SB_SETTEXT, 0, (LPARAM)str); } struct ProtoResultsSummary { @@ -304,33 +304,33 @@ void SetStatusBarResultInfo(HWND hwndDlg) subtotal[subtotalCount++].count=1; } } - if ( total != 0 ) { + if (total != 0) { TCHAR substr[64]; - PROTOACCOUNT* pa = Proto_GetAccount( subtotal[0].szProto ); - if ( pa == NULL ) + PROTOACCOUNT* pa = Proto_GetAccount(subtotal[0].szProto); + if (pa == NULL) return; - if ( subtotalCount == 1 ) { - if (total == 1) mir_sntprintf( str, SIZEOF(str), TranslateT("1 %s user found"), pa->tszAccountName ); - else mir_sntprintf( str, SIZEOF(str), TranslateT("%d %s users found"), total, pa->tszAccountName ); + if (subtotalCount == 1) { + if (total == 1) mir_sntprintf(str, SIZEOF(str), TranslateT("1 %s user found"), pa->tszAccountName); + else mir_sntprintf(str, SIZEOF(str), TranslateT("%d %s users found"), total, pa->tszAccountName); } else { - mir_sntprintf( str, SIZEOF(str), TranslateT("%d users found ("), total); - for ( i=0; i < subtotalCount; i++ ) { - if ( i ) { - if (( pa = Proto_GetAccount( subtotal[i].szProto )) == NULL ) + mir_sntprintf(str, SIZEOF(str), TranslateT("%d users found ("), total); + for (i=0; i < subtotalCount; i++) { + if (i) { + if ((pa = Proto_GetAccount(subtotal[i].szProto)) == NULL) return; - lstrcat( str, _T(", ")); + lstrcat(str, _T(", ")); } - mir_sntprintf( substr, SIZEOF(substr), _T("%d %s"), subtotal[i].count, pa->tszAccountName ); - lstrcat( str, substr ); + mir_sntprintf(substr, SIZEOF(substr), _T("%d %s"), subtotal[i].count, pa->tszAccountName); + lstrcat(str, substr); } - lstrcat( str, _T(")")); + lstrcat(str, _T(")")); } mir_free(subtotal); } else lstrcpy(str, TranslateT("No users found")); - SendMessage(hwndStatus, SB_SETTEXT, 2, (LPARAM)str ); + SendMessage(hwndStatus, SB_SETTEXT, 2, (LPARAM)str); } void CreateResultsColumns(HWND hwndResults, struct FindAddDlgData *dat, char *szProto) -- cgit v1.2.3