From db36b4314adfe4c54852384e38ed4cb38c46d6ae Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Wed, 28 Nov 2012 18:46:07 +0000 Subject: git-svn-id: http://svn.miranda-ng.org/main/trunk@2546 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Ping/log.cpp | 59 ---------------------------------------------------- 1 file changed, 59 deletions(-) delete mode 100644 plugins/Ping/log.cpp (limited to 'plugins/Ping/log.cpp') diff --git a/plugins/Ping/log.cpp b/plugins/Ping/log.cpp deleted file mode 100644 index de2889fde1..0000000000 --- a/plugins/Ping/log.cpp +++ /dev/null @@ -1,59 +0,0 @@ -#include "common.h" -#include "log.h" - -INT_PTR Log(WPARAM wParam, LPARAM lParam) { - - TCHAR buf[1024], tbuf[512], dbuf[512]; - CallService(PLUG "/GetLogFilename", (WPARAM)1024, (LPARAM)buf); - - //char TBcapt[255]; - SYSTEMTIME systime; - - GetLocalTime(&systime); - - GetTimeFormat(LOCALE_USER_DEFAULT, 0, &systime, 0, tbuf, 512); - GetDateFormat(LOCALE_USER_DEFAULT, 0, &systime, 0, dbuf, 512); - - char *line = (char *)wParam; - - FILE *f = _tfopen(buf, _T("a+")); - if(f) { - if(options.log_csv) { - fprintf(f, "%s, %s, %s\n", dbuf, tbuf, line); - } else { - fprintf(f, "%s, %s: %s\n", dbuf, tbuf, line); - } - fclose(f); - } - - return 0; -} - -INT_PTR GetLogFilename(WPARAM wParam, LPARAM lParam) { - DBVARIANT dbv; - char *filename = (char *)lParam; - if(DBGetContactSetting(0, PLUG, "LogFilename", &dbv)) { - CallService(MS_DB_GETPROFILEPATH, (WPARAM)wParam, (LPARAM)filename); - strcat(filename, "\\"); - strcat(filename, "ping_log.txt"); - } else { - strncpy(filename, dbv.pszVal, wParam); - DBFreeVariant(&dbv); - } - - ((char *)lParam)[wParam - 1] = 0; - - return 0; -} - -INT_PTR SetLogFilename(WPARAM wParam, LPARAM lParam) { - DBWriteContactSettingString(0, PLUG, "LogFilename", (char *)lParam); - return 0; -} - -INT_PTR ViewLogData(WPARAM wParam, LPARAM lParam) { - char buf[1024]; - CallService(PLUG "/GetLogFilename", (WPARAM)MAX_PATH, (LPARAM)buf); - return (INT_PTR)ShellExecute((HWND)wParam, _T("edit"), buf, _T(""), _T(""), SW_SHOW); -} - -- cgit v1.2.3