From f61a9fd5927291d98a15131150c3e308a42bbf63 Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Tue, 23 Jul 2013 17:23:16 +0000 Subject: -translation fix -unicode status description git-svn-id: http://svn.miranda-ng.org/main/trunk@5453 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/StatusPlugins/KeepStatus/keepstatus.cpp | 90 +++++++++++-------------- 1 file changed, 40 insertions(+), 50 deletions(-) (limited to 'plugins/StatusPlugins/KeepStatus/keepstatus.cpp') diff --git a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp index 30d4f3ff16..a5bb227980 100644 --- a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp +++ b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp @@ -184,16 +184,13 @@ static void GetCurrentConnectionSettings() static PROTOCOLSETTINGEX** GetCurrentProtoSettingsCopy() { - PROTOCOLSETTINGEX** ps; - int i; - EnterCriticalSection(&GenStatusCS); - ps = ( PROTOCOLSETTINGEX** )malloc(connectionSettings.getCount()*sizeof(PROTOCOLSETTINGEX *)); + PROTOCOLSETTINGEX **ps = ( PROTOCOLSETTINGEX** )malloc(connectionSettings.getCount()*sizeof(PROTOCOLSETTINGEX *)); if (ps == NULL) { LeaveCriticalSection(&GenStatusCS); return NULL; } - for(i=0;iszName, PS_GETSTATUS, 0, 0); if ( (ps[i]->status == ID_STATUS_DISABLED) || (ps[i]->status == realStatus) || ( db_get_b(NULL, ps[i]->szName, SETTING_PROTORETRY, 0))) { // ignore this proto by removing it's name (not so nice) ps[i]->szName = ""; @@ -282,7 +279,7 @@ static int SetCurrentStatus() } } ProcessPopup(KS_CONN_STATE_RETRY, (LPARAM)ps); - ret = CallService(MS_CS_SETSTATUSEX, (WPARAM)&ps, 0); + INT_PTR ret = CallService(MS_CS_SETSTATUSEX, (WPARAM)&ps, 0); FreeProtoSettings(ps); return ret; @@ -311,18 +308,17 @@ static int StatusChange(WPARAM wParam, LPARAM lParam) return 0; } -static int CSStatusChange(WPARAM wParam, LPARAM lParam) +static int CSStatusChange(WPARAM wParam, LPARAM) { // the status was changed by commonstatus (old) if (wParam != 0) { - int i, j; PROTOCOLSETTING** protoSettings = *(PROTOCOLSETTING***)wParam; if (protoSettings == NULL) return -1; - for (i=0;iszName == NULL) || (connectionSettings[j].szName == NULL)) continue; @@ -336,18 +332,17 @@ static int CSStatusChange(WPARAM wParam, LPARAM lParam) return 0; } -static int CSStatusChangeEx(WPARAM wParam, LPARAM lParam) +static int CSStatusChangeEx(WPARAM wParam, LPARAM) { // the status was changed by commonstatus (new) if (wParam != 0) { - int i, j; PROTOCOLSETTINGEX** protoSettings = *(PROTOCOLSETTINGEX***)wParam; if (protoSettings == NULL) return -1; - for (i=0;iszName == NULL) || (connectionSettings[j].szName == NULL)) continue; if (!strcmp(protoSettings[i]->szName, connectionSettings[j].szName)) { @@ -537,15 +532,14 @@ static int StopTimer(int timer) return res; } -static int ProcessProtoAck(WPARAM wParam,LPARAM lParam) +static int ProcessProtoAck(WPARAM,LPARAM lParam) { ACKDATA *ack=(ACKDATA*)lParam; - char dbSetting[128]; - int i; if ( (ack->type != ACKTYPE_STATUS) && (ack->type != ACKTYPE_LOGIN)) return 0; + char dbSetting[128]; mir_snprintf(dbSetting, sizeof(dbSetting), "%s_enabled", ack->szModule); if (!db_get_b(NULL, MODULENAME, dbSetting, 1)) return 0; @@ -556,7 +550,7 @@ static int ProcessProtoAck(WPARAM wParam,LPARAM lParam) } if ( ack->type == ACKTYPE_STATUS && ack->result == ACKRESULT_SUCCESS ) { - for ( i=0; i < connectionSettings.getCount(); i++ ) { + for (int i=0; i < connectionSettings.getCount(); i++ ) { TConnectionSettings& cs = connectionSettings[i]; if ( !strcmp( cs.szName, ack->szModule )) cs.lastStatusAckTime = GetTickCount(); @@ -567,15 +561,14 @@ static int ProcessProtoAck(WPARAM wParam,LPARAM lParam) if (ack->type == ACKTYPE_LOGIN) { if (ack->lParam == LOGINERR_OTHERLOCATION) { - int i, j; - for (i=0;iszModule, cs.szName)) { AssignStatus(&cs, ID_STATUS_OFFLINE, 0, NULL); if ( db_get_b(NULL, MODULENAME, SETTING_CNCOTHERLOC, 0)) { StopTimer(IDT_PROCESSACK); - for (j=0;jtszAccName) > 0) if ( db_get_b(NULL, MODULENAME, SETTING_PUSHOWEXTRA, TRUE)) { - mir_sntprintf(protoInfoLine, SIZEOF(protoInfoLine), _T("%s\t(%s %S)\r\n"), ps[i]->tszAccName, TranslateT("will be set to"), (char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)ps[i]->status, 0)); + mir_sntprintf(protoInfoLine, SIZEOF(protoInfoLine), TranslateT("%s\t(will be set to %s)\r\n"), ps[i]->tszAccName, CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)ps[i]->status, GSMDF_TCHAR)); _tcsncat(protoInfo, protoInfoLine, SIZEOF(protoInfo) - _tcslen(protoInfo)-1); } @@ -1226,26 +1218,24 @@ int OnAccChanged(WPARAM wParam,LPARAM lParam) switch( wParam ) { case PRAC_ADDED: connectionSettings.insert( new TConnectionSettings( pa )); - break; + return 0; case PRAC_REMOVED: - { - for ( int i=0; i < connectionSettings.getCount(); i++ ) { - if ( !lstrcmpA( connectionSettings[i].szName, pa->szModuleName )) { - connectionSettings.remove( i ); - break; - } + for ( int i=0; i < connectionSettings.getCount(); i++ ) { + if ( !lstrcmpA( connectionSettings[i].szName, pa->szModuleName )) { + connectionSettings.remove( i ); + break; } } - break; + return 0; + default: + return 0; } - - return 0; } // =============== init stuff ================= -int CSModuleLoaded(WPARAM wParam,LPARAM lParam) +int CSModuleLoaded(WPARAM,LPARAM) { InitializeCriticalSection(&GenTimerCS); InitializeCriticalSection(&GenStatusCS); @@ -1261,7 +1251,7 @@ int CSModuleLoaded(WPARAM wParam,LPARAM lParam) return 0; } -static int Exit(WPARAM wParam, LPARAM lParam) +static int Exit(WPARAM,LPARAM) { UnhookEvent(hOptionsHook); UnhookEvent(hShutdownHook); -- cgit v1.2.3