From: ribes Date: Tue, 25 May 2010 12:22:36 +0000 (+0000) Subject: Default result directory is user home directory X-Git-Tag: V5_1_4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FBR_WIN_INDUS_514;p=modules%2Fjobmanager.git Default result directory is user home directory --- diff --git a/src/genericgui/BL_CreateJobWizard.cxx b/src/genericgui/BL_CreateJobWizard.cxx index 97da5a6..a5a5b34 100644 --- a/src/genericgui/BL_CreateJobWizard.cxx +++ b/src/genericgui/BL_CreateJobWizard.cxx @@ -19,6 +19,10 @@ #include "BL_CreateJobWizard.hxx" #include "BL_JobsManager_QT.hxx" +#include +#include +#include +#include BL::CreateJobWizard::CreateJobWizard(BL::JobsManager_QT * jobs_manager, BL::SALOMEServices * salome_services) { @@ -676,6 +680,17 @@ BL::FilesPage::FilesPage(BL::CreateJobWizard * parent) QPushButton * button_result = new QPushButton("Local Result directory"); connect(button_result, SIGNAL(clicked()), this, SLOT(choose_local_directory())); _result_directory = new QLineEdit(this); + + // Default result directory is home directory (if we found it) + // First try -> HOME + if (getenv("HOME")) + _result_directory->setText(getenv("HOME")); + else { + // Second try -> getpwuid + struct passwd * pass_struct = getpwuid(getuid()); + if (pass_struct) + _result_directory->setText(pass_struct->pw_dir); + } registerField("result_directory", _result_directory); QGridLayout * output_box = new QGridLayout;