]> SALOME platform Git repositories - modules/jobmanager.git/commitdiff
Salome HOME
bos #18341: HOME environment variable V9_5_0b1
authorjfa <jfa@opencascade.com>
Wed, 15 Apr 2020 10:22:43 +0000 (13:22 +0300)
committervsr <vsr@opencascade.com>
Wed, 13 May 2020 14:10:16 +0000 (17:10 +0300)
src/genericgui/BL_CreateJobWizard.cxx

index 64f4f14606bdc99867c5dbe9e84b8e79d2a9d551..039303a22c2105cf1d561a30d98293c9db00a8b3 100644 (file)
@@ -23,6 +23,7 @@
 #include <QFileDialog>
 #include <QMessageBox>
 #include <QTreeView>
+#include <QDir>
 
 #ifndef WNT
 #include <unistd.h>
@@ -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);