Check log file actually exists before enabling Log File button (#8727)
* Check log file actually exists before enabling Log File button. Resolves #8691. * Return empty string if output file path is empty.
This commit is contained in:
parent
eb8fe63928
commit
c62fd51f48
2 changed files with 2 additions and 2 deletions
|
@ -141,7 +141,7 @@ void game_version::pre_show(window& window)
|
||||||
|
|
||||||
button& stderr_button = find_widget<button>(&window, "open_stderr", false);
|
button& stderr_button = find_widget<button>(&window, "open_stderr", false);
|
||||||
connect_signal_mouse_left_click(stderr_button, std::bind(&game_version::browse_directory_callback, this, log_path_));
|
connect_signal_mouse_left_click(stderr_button, std::bind(&game_version::browse_directory_callback, this, log_path_));
|
||||||
stderr_button.set_active(!log_path_.empty());
|
stderr_button.set_active(!log_path_.empty() && filesystem::file_exists(log_path_));
|
||||||
|
|
||||||
//
|
//
|
||||||
// Build info tab.
|
// Build info tab.
|
||||||
|
|
|
@ -279,7 +279,7 @@ std::optional<bool> log_dir_writable()
|
||||||
|
|
||||||
std::string get_log_file_path()
|
std::string get_log_file_path()
|
||||||
{
|
{
|
||||||
return output_file_path_+lg::log_file_suffix;
|
return output_file_path_.empty() ? "" : output_file_path_+lg::log_file_suffix;
|
||||||
}
|
}
|
||||||
|
|
||||||
redirect_output_setter::redirect_output_setter(std::ostream& stream)
|
redirect_output_setter::redirect_output_setter(std::ostream& stream)
|
||||||
|
|
Loading…
Add table
Reference in a new issue