Skip to content

Commit

Permalink
documents folder
Browse files Browse the repository at this point in the history
  • Loading branch information
aseelegbaria committed Jul 28, 2020
1 parent f1a3344 commit 9ef03d4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common/model-views.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4717,7 +4717,7 @@ namespace rs2
std::string default_path = config_file::instance().get(configurations::record::default_path);
if (!ends_with(default_path, "/") && !ends_with(default_path, "\\")) default_path += "/";
std::string default_filename = rs2::get_timestamped_file_name() + ".bag";
if (recording_setting == 0)
if (recording_setting == 0 && default_path.size() > 1 )
{
path = default_path + default_filename;
}
Expand Down
16 changes: 14 additions & 2 deletions common/ux-window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,13 @@ namespace rs2
config_file::instance().set_default(configurations::window::saved_size, false);

config_file::instance().set_default(configurations::viewer::is_measuring, false);
config_file::instance().set_default(configurations::viewer::log_filename, get_folder_path(special_folder::user_documents) + "librealsense.log");
config_file::instance().set_default(configurations::viewer::log_to_console, true);
config_file::instance().set_default(configurations::viewer::log_to_file, false);
config_file::instance().set_default(configurations::viewer::log_severity, 2);
config_file::instance().set_default(configurations::viewer::metric_system, true);
config_file::instance().set_default(configurations::viewer::ground_truth_r, 2500);

config_file::instance().set_default(configurations::record::compression_mode, 2); // Let the device decide
config_file::instance().set_default(configurations::record::default_path, get_folder_path(special_folder::user_documents));
config_file::instance().set_default(configurations::record::file_save_mode, 0); // Auto-select name

config_file::instance().set_default(configurations::performance::show_fps, false);
Expand All @@ -79,6 +77,20 @@ namespace rs2
config_file::instance().set_default(configurations::viewer::commands_xml, "./Commands.xml");
config_file::instance().set_default(configurations::viewer::hwlogger_xml, "./HWLoggerEvents.xml");

std::string path;
try
{
path = get_folder_path(special_folder::user_documents);
}
catch (const std::exception& e)
{
std::string msg = "Failed to get Documents folder";
rs2::log(RS2_LOG_SEVERITY_INFO, msg.c_str());
path = "";
}
config_file::instance().set_default(configurations::viewer::log_filename, path + "librealsense.log");
config_file::instance().set_default(configurations::record::default_path, path);

#ifdef __APPLE__

config_file::instance().set_default(configurations::performance::font_oversample, 2);
Expand Down

0 comments on commit 9ef03d4

Please sign in to comment.