Skip to content

Commit

Permalink
get log viewer app fix
Browse files Browse the repository at this point in the history
  • Loading branch information
henrypp committed Jul 3, 2019
1 parent dd8d2eb commit fab105a
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions src/log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,10 @@ void _app_logerror (LPCWSTR fn, DWORD errcode, LPCWSTR desc, bool is_nopopups)

rstring _app_getlogviewer ()
{
rstring result;
rstring result = app.ConfigGet (L"LogViewer", LOG_VIEWER_DEFAULT);

static LPCWSTR csvviewer[] = {
L".\\CSVFileView.exe",
L".\\CSVFileView\\CSVFileView.exe",
L"..\\CSVFileView\\CSVFileView.exe"
};

for (size_t i = 0; i < _countof (csvviewer); i++)
{
result = _r_path_expand (csvviewer[i]);

if (_r_fs_exists (result))
return result;
}

result = app.ConfigGet (L"LogViewer", L"notepad.exe");
if (result.IsEmpty ())
return _r_path_expand (LOG_VIEWER_DEFAULT);

return _r_path_expand (result);
}
Expand Down Expand Up @@ -198,7 +185,7 @@ void _app_logwrite (PITEM_LOG ptr_log)

bool _app_logchecklimit ()
{
const DWORD limit = app.ConfigGet (L"LogSizeLimitKb", LOG_SIZE_LIMIT).AsUlong ();
const DWORD limit = app.ConfigGet (L"LogSizeLimitKb", LOG_SIZE_LIMIT_DEFAULT).AsUlong ();

if (!limit || !config.hlogfile || config.hlogfile == INVALID_HANDLE_VALUE)
return false;
Expand Down

0 comments on commit fab105a

Please sign in to comment.