From 85bd008c039eb1d93894e94fba9d158a42a71a12 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 11 Aug 2015 13:33:42 +0000 Subject: massive code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@14910 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Xfire/src/iniupdater.cpp | 72 +++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 40 deletions(-) (limited to 'protocols/Xfire/src/iniupdater.cpp') diff --git a/protocols/Xfire/src/iniupdater.cpp b/protocols/Xfire/src/iniupdater.cpp index 6d97588ad4..ed3a43534e 100644 --- a/protocols/Xfire/src/iniupdater.cpp +++ b/protocols/Xfire/src/iniupdater.cpp @@ -9,30 +9,27 @@ extern HANDLE XFireWorkingFolder; extern HANDLE XFireIconFolder; -INT_PTR CALLBACK DlgUpdateDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK DlgUpdateDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM) { - switch (msg) - { + switch (msg) { case WM_INITDIALOG: - { - TranslateDialogDefault(hwndDlg); + { + TranslateDialogDefault(hwndDlg); - char*buf = NULL; //leeren zeiger für den empfangen buffer - GetWWWContent2(INI_WHATSNEW, NULL, FALSE, &buf); + char *buf = NULL; //leeren zeiger für den empfangen buffer + GetWWWContent2(INI_WHATSNEW, NULL, FALSE, &buf); - if (buf != NULL) - { - SetDlgItemTextA(hwndDlg, IDC_UPDATEGAMES, buf); - delete[] buf; - } + if (buf != NULL) { + SetDlgItemTextA(hwndDlg, IDC_UPDATEGAMES, buf); + delete[] buf; + } - SetFocus(GetDlgItem(hwndDlg, IDOK)); + SetFocus(GetDlgItem(hwndDlg, IDOK)); - return TRUE; - } + return TRUE; + } case WM_COMMAND: - switch (LOWORD(wParam)) - { + switch (LOWORD(wParam)) { case IDOK: EndDialog(hwndDlg, IDOK); return TRUE; @@ -47,24 +44,22 @@ INT_PTR CALLBACK DlgUpdateDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR return FALSE; } -void UpdateMyXFireIni(LPVOID dummy) { +void UpdateMyXFireIni(LPVOID) +{ char request[1024]; char *inipath = XFireGetFoldersPath("IniFile"); //ini pfad rausbekommen char file[1024], file2[1024], file3[1024]; - mir_snprintf(file,_countof(file), "%sxfire_games.new",inipath); - mir_snprintf(file2,_countof(file2), "%sxfire_games.ini",inipath); - mir_snprintf(file3,_countof(file3), "%sxfire_games.old",inipath); + mir_snprintf(file, _countof(file), "%sxfire_games.new", inipath); + mir_snprintf(file2, _countof(file2), "%sxfire_games.ini", inipath); + mir_snprintf(file3, _countof(file3), "%sxfire_games.old", inipath); mir_snprintf(request, _countof(request), "%s%d", INI_URLREQUEST, getfilesize(file2)); - if (CheckWWWContent(request)) - { - if (db_get_b(NULL, protocolname, "dontaskforupdate", 0) == 1 || DialogBox(hinstance, MAKEINTRESOURCE(IDD_UPDATE), NULL, DlgUpdateDialogProc) == IDOK) - { - if (GetWWWContent2(request, file, FALSE)) - { + if (CheckWWWContent(request)) { + if (db_get_b(NULL, protocolname, "dontaskforupdate", 0) == 1 || DialogBox(hinstance, MAKEINTRESOURCE(IDD_UPDATE), NULL, DlgUpdateDialogProc) == IDOK) { + if (GetWWWContent2(request, file, FALSE)) { //altes backup löschen remove(file3); //derzeitige ini und sichern @@ -77,28 +72,26 @@ void UpdateMyXFireIni(LPVOID dummy) { if (db_get_b(NULL, protocolname, "dontaskforupdate", 0) == 0) MSGBOX(Translate("The xfire_games.ini was updated.")); } - else - MSGBOX(Translate("Error during xfire_games.ini update.")); + else MSGBOX(Translate("Error during xfire_games.ini update.")); } } } -void UpdateMyIcons(LPVOID dummy) { +void UpdateMyIcons(LPVOID) +{ char request[1024]; char *inipath = XFireGetFoldersPath("IconsFile"); //ini pfad rausbekommen char file[1024], file2[1024], file3[1024]; - mir_snprintf(file,_countof(file), "%sicons.new",inipath); - mir_snprintf(file2,_countof(file2), "%sicons.dll",inipath); - mir_snprintf(file3,_countof(file3), "%sicons.old",inipath); + mir_snprintf(file, _countof(file), "%sicons.new", inipath); + mir_snprintf(file2, _countof(file2), "%sicons.dll", inipath); + mir_snprintf(file3, _countof(file3), "%sicons.old", inipath); mir_snprintf(request, _countof(request), "%s%d", ICO_URLREQUEST, getfilesize(file2)); - if (CheckWWWContent(request)) - { - if (db_get_b(NULL, protocolname, "dontaskforupdate", 0) == 1 || MessageBox(NULL, TranslateT("There is a new Icons.dll online, do you want to update now?"), TranslateT(PLUGIN_TITLE), MB_YESNO | MB_ICONQUESTION) == IDYES) - { + if (CheckWWWContent(request)) { + if (db_get_b(NULL, protocolname, "dontaskforupdate", 0) == 1 || MessageBox(NULL, TranslateT("There is a new Icons.dll online, do you want to update now?"), TranslateT(PLUGIN_TITLE), MB_YESNO | MB_ICONQUESTION) == IDYES) { if (GetWWWContent2(request, file, FALSE)) { //altes backup löschen remove(file3); @@ -112,8 +105,7 @@ void UpdateMyIcons(LPVOID dummy) { if (db_get_b(NULL, protocolname, "dontaskforupdate", 0) == 0) MSGBOX(Translate("The Icons.dll was updated.")); } - else - MSGBOX(Translate("Error during Icons.dll Update.")); + else MSGBOX(Translate("Error during Icons.dll Update.")); } } -} \ No newline at end of file +} -- cgit v1.2.3