From 2f731ec25e06739a56e9214755516d0db7907546 Mon Sep 17 00:00:00 2001 From: jfa Date: Wed, 15 Apr 2020 13:22:43 +0300 Subject: [PATCH] Fix for bos #18341: HOME environment variable --- src/genericgui/BL_CreateJobWizard.cxx | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/genericgui/BL_CreateJobWizard.cxx b/src/genericgui/BL_CreateJobWizard.cxx index 1499eff..e3aa8f4 100644 --- a/src/genericgui/BL_CreateJobWizard.cxx +++ b/src/genericgui/BL_CreateJobWizard.cxx @@ -23,6 +23,7 @@ #include #include #include +#include #ifndef WNT #include @@ -1051,19 +1052,7 @@ FilesPage::FilesPage(CreateJobWizard * parent, SALOMEServices * salome_services) registerField("result_directory", ui->line_result_dir); // Default result directory is home directory (if we found it) - // First try -> HOME -#ifdef WNT - ui->line_result_dir->setText(getenv("HOME")); -#else - if (getenv("HOME")) - ui->line_result_dir->setText(getenv("HOME")); - else { - // Second try -> getpwuid - struct passwd * pass_struct = getpwuid(getuid()); - if (pass_struct) - ui->line_result_dir->setText(pass_struct->pw_dir); - } -#endif + ui->line_result_dir->setText(QDir::homePath()); parent->setFilesList(ui->input_files_list, ui->output_files_list); -- 2.39.2