]> SALOME platform Git repositories - modules/jobmanager.git/commitdiff
Salome HOME
UTF-8 support (not fully tested yet)
authorRenaud Barate <renaud.barate@edf.fr>
Thu, 10 Jul 2014 13:40:48 +0000 (15:40 +0200)
committerRenaud Barate <renaud.barate@edf.fr>
Thu, 10 Jul 2014 13:40:48 +0000 (15:40 +0200)
src/genericgui/BL_CreateJobWizard.cxx
src/genericgui/BL_GenericGui.cxx
src/genericgui/BL_JobTab.cxx
src/genericgui/BL_JobsManager_QT.cxx
src/genericgui/BL_QModelManager.cxx
src/genericgui/JM_EditSalomeResource.cxx
src/genericgui/JM_ResourceCatalog.cxx

index 19229f2a3352f5803ded0b66998178554426abd1..6ff0fe2dd004ccb47cd50992e347fb98c739bfee 100644 (file)
@@ -232,20 +232,20 @@ BL::CreateJobWizard::end(int result)
   {
     // Job Name Panel
     QString f_job_name = field("job_name").toString();
-    job_name = f_job_name.trimmed().toStdString();
+    job_name = f_job_name.trimmed().toUtf8().constData();
 
     // YACS Schema Panel
     QString f_yacs_file = field("yacs_file").toString();
-    yacs_file = f_yacs_file.trimmed().toStdString();
+    yacs_file = f_yacs_file.trimmed().toUtf8().constData();
     dump_yacs_state = field("dump_yacs_state").toInt();
 
     // Command Panel
     QString f_command = field("command").toString();
-    command = f_command.trimmed().toStdString();
+    command = f_command.trimmed().toUtf8().constData();
 
     // Command Panel
     QString f_python_salome_file = field("PythonSalome").toString();
-    python_salome_file = f_python_salome_file.trimmed().toStdString();
+    python_salome_file = f_python_salome_file.trimmed().toUtf8().constData();
 
     QString f_env_file;
     if (yacs_file != "")
@@ -254,21 +254,21 @@ BL::CreateJobWizard::end(int result)
       f_env_file = field("env_command_file").toString();
     else if (python_salome_file != "")
       f_env_file = field("env_PythonSalome_file").toString();
-    env_file = f_env_file.trimmed().toStdString();
+    env_file = f_env_file.trimmed().toUtf8().constData();
 
     // Batch Panel
     QString f_batch_directory = field("batch_directory").toString();
-    batch_directory = f_batch_directory.trimmed().toStdString();
+    batch_directory = f_batch_directory.trimmed().toUtf8().constData();
 
     // For COORM
     QString f_coorm_batch_directory = field("coorm_batch_directory").toString();
-    coorm_batch_directory = f_coorm_batch_directory.toStdString();
+    coorm_batch_directory = f_coorm_batch_directory.toUtf8().constData();
 
        // For COORM
     QString f_launcher_file = field("launcher_file").toString();
-    launcher_file = f_launcher_file.toStdString();
+    launcher_file = f_launcher_file.toUtf8().constData();
     QString f_launcher_args = field("launcher_args").toString();
-    launcher_args = f_launcher_args.toStdString();
+    launcher_args = f_launcher_args.toUtf8().constData();
 
     QString time_hour;
     QString time_min;
@@ -309,27 +309,27 @@ BL::CreateJobWizard::end(int result)
 
     // Files Panel
     QString f_result_directory = field("result_directory").toString();
-    result_directory = f_result_directory.trimmed().toStdString();
+    result_directory = f_result_directory.trimmed().toUtf8().constData();
     for (int i = 0; i < _input_files_list->count(); ++i)
     {
       QListWidgetItem * item = _input_files_list->item(i);
       QString item_text = item->text();
-      input_files_list.push_back(item_text.trimmed().toStdString());
+      input_files_list.push_back(item_text.trimmed().toUtf8().constData());
     }
     for (int i = 0; i < _output_files_list->count(); ++i)
     {
       QListWidgetItem * item = _output_files_list->item(i);
       QString item_text = item->text();
-      output_files_list.push_back(item_text.trimmed().toStdString());
+      output_files_list.push_back(item_text.trimmed().toUtf8().constData());
     }
 
     // Resource list
     QString f_resource_choosed = field("resource_choosed").toString();
-    resource_choosed = f_resource_choosed.trimmed().toStdString();
+    resource_choosed = f_resource_choosed.trimmed().toUtf8().constData();
 
     // Batch Queue
     QString f_batch_queue = field("batch_queue").toString();
-    batch_queue = f_batch_queue.trimmed().toStdString();
+    batch_queue = f_batch_queue.trimmed().toUtf8().constData();
 
     // LoadLeveler JobType
     BL::ResourceDescr resource_descr = _salome_services->getResourceDescr(resource_choosed);
@@ -452,7 +452,7 @@ BL::JobNamePage::validatePage()
 
   // Check if job name already exists
   else {
-    if (_jobs_manager->job_already_exist(job_name.toStdString()) == false || _check_name == false)
+    if (_jobs_manager->job_already_exist(job_name.toUtf8().constData()) == false || _check_name == false)
     {
       return_value = true;
     }
@@ -690,7 +690,7 @@ BatchParametersPage::~BatchParametersPage()
 void
 BatchParametersPage::initializePage()
 {
-  string f_resource_choosed = field("resource_choosed").toString().toStdString();
+  string f_resource_choosed = field("resource_choosed").toString().toUtf8().constData();
   if (f_resource_choosed != resource_choosed)
   {
     resource_choosed = f_resource_choosed;
@@ -841,7 +841,7 @@ BL::COORM_BatchParametersPage::initializePage()
     resource_choosed = f_resource_choosed;
     // If choosed resource has a working_directory set
     // Generates a default remote working directory
-    BL::ResourceDescr resource_descr = _salome_services->getResourceDescr(resource_choosed.toStdString());
+    BL::ResourceDescr resource_descr = _salome_services->getResourceDescr(resource_choosed.toUtf8().constData());
     QString res_work_dir = resource_descr.working_directory.c_str();
     if (res_work_dir != "")
     {
@@ -918,7 +918,7 @@ FilesPage::initializePage()
     resource_choosed = f_resource_choosed;
     // If choosed resource has a working_directory set
     // Generates a default remote working directory
-    BL::ResourceDescr resource_descr = _salome_services->getResourceDescr(resource_choosed.toStdString());
+    BL::ResourceDescr resource_descr = _salome_services->getResourceDescr(resource_choosed.toUtf8().constData());
     QString res_work_dir = resource_descr.working_directory.c_str();
     if (res_work_dir != "")
     {
@@ -1151,7 +1151,7 @@ BL::ResourcePage::validatePage()
     return false;
   }
 
-  BL::ResourceDescr resource_descr = _salome_services->getResourceDescr(resource_choosed.toStdString());
+  BL::ResourceDescr resource_descr = _salome_services->getResourceDescr(resource_choosed.toUtf8().constData());
   std::string batch = resource_descr.batch.c_str();
   if (batch == "ll")
   {
@@ -1173,7 +1173,7 @@ BL::ResourcePage::itemSelected(QListWidgetItem * item)
   _resource_choosed->setReadOnly(true);
 
   //Specific parameters for LoadLeveler
-  BL::ResourceDescr resource_descr = _salome_services->getResourceDescr(item->text().toStdString());
+  BL::ResourceDescr resource_descr = _salome_services->getResourceDescr(item->text().toUtf8().constData());
   std::string batch = resource_descr.batch.c_str();
   if (batch == "ll")
   {
@@ -1194,7 +1194,7 @@ BL::ResourcePage::itemSelected(QListWidgetItem * item)
 int 
 BL::ResourcePage::nextId() const
 {
-  BL::ResourceDescr resource_descr = _salome_services->getResourceDescr(_resource_choosed->text().toStdString());
+  BL::ResourceDescr resource_descr = _salome_services->getResourceDescr(_resource_choosed->text().toUtf8().constData());
   std::string batch = resource_descr.batch.c_str();
   if (batch == "coorm")
   {
index 8adb9097a8b5ee0d4104824183e1cdb95c879a8c..fe4fd3176570849135b73e1408482daa5dcf9c92 100644 (file)
@@ -220,14 +220,14 @@ void
 BL::GenericGui::edit_clone_job()
 {
   DEBTRACE("Edit/Clone Job Slot BL::GenericGui");
-  _jobs_manager->edit_clone_job(_job_name_selected.toStdString());
+  _jobs_manager->edit_clone_job(_job_name_selected.toUtf8().constData());
 }
 
 void
 BL::GenericGui::start_job()
 {
   DEBTRACE("Start Job Slot BL::GenericGui");
-  _jobs_manager->start_job(_job_name_selected.toStdString());
+  _jobs_manager->start_job(_job_name_selected.toUtf8().constData());
   updateButtonsStates();
 }
 
@@ -235,7 +235,7 @@ void
 BL::GenericGui::restart_job()
 {
   DEBTRACE("Restart Job Slot BL::GenericGui");
-  _jobs_manager->restart_job(_job_name_selected.toStdString());
+  _jobs_manager->restart_job(_job_name_selected.toUtf8().constData());
   updateButtonsStates();
 }
 
@@ -252,7 +252,7 @@ BL::GenericGui::get_results_job()
   DEBTRACE("Get Results Job Slot BL::GenericGui");
   if (!_jobs_table->isMultipleSelected())
   {
-    _jobs_manager->get_results_job(_job_name_selected.toStdString());
+    _jobs_manager->get_results_job(_job_name_selected.toUtf8().constData());
   }
   else
   {
@@ -260,7 +260,7 @@ BL::GenericGui::get_results_job()
     for (int i = 0; i < selected_rows.length(); ++i)
     {
       QString job_name = _model->itemFromIndex(selected_rows[i])->text();
-    _jobs_manager->get_results_job(job_name.toStdString());
+    _jobs_manager->get_results_job(job_name.toUtf8().constData());
     }
   }
 }
@@ -271,7 +271,7 @@ BL::GenericGui::stop_job()
   DEBTRACE("Stop Job Slot BL::GenericGui");
   if (!_jobs_table->isMultipleSelected())
   {
-    _jobs_manager->stop_job(_job_name_selected.toStdString());
+    _jobs_manager->stop_job(_job_name_selected.toUtf8().constData());
   }
   else
   {
@@ -279,7 +279,7 @@ BL::GenericGui::stop_job()
     for (int i = 0; i < selected_rows.length(); ++i)
     {
       QString job_name = _model->itemFromIndex(selected_rows[i])->text();
-      _jobs_manager->stop_job(job_name.toStdString());
+      _jobs_manager->stop_job(job_name.toUtf8().constData());
     }
   }
 }
@@ -328,7 +328,7 @@ BL::GenericGui::delete_job_internal()
   {
     QModelIndexList selected_list = _jobs_table->getSelectedIndexes();
     QString job_name_to_delete    = _model->itemFromIndex(selected_list[0])->text();
-    DEBTRACE("Single Deleting job: " << job_name_to_delete.toStdString());
+    DEBTRACE("Single Deleting job: " << job_name_to_delete.toUtf8().constData());
     _jobs_manager->delete_job(job_name_to_delete);
     if (!_jobs_table->selectCurrent())
     {
@@ -340,7 +340,7 @@ BL::GenericGui::delete_job_internal()
   {
     QModelIndexList selected_list = _jobs_table->getSelectedIndexes();
     QString job_name = _model->itemFromIndex(selected_list[0])->text();
-    DEBTRACE("Multiple Deleting job: " << job_name.toStdString());
+    DEBTRACE("Multiple Deleting job: " << job_name.toUtf8().constData());
     _jobs_manager->delete_job(job_name);
     delete_job_internal(); // Recursive delete
   }
@@ -370,7 +370,7 @@ BL::GenericGui::job_selected(const QModelIndex & index)
     QStandardItem * item_name = _model->item(item->row());
     _job_name_selected = item_name->text();
     _job_tab->job_selected(idx);
-    DEBTRACE("BL::GenericGui::job_selected name is " << _job_name_selected.toStdString());
+    DEBTRACE("BL::GenericGui::job_selected name is " << _job_name_selected.toUtf8().constData());
   }
   else
   {
@@ -421,7 +421,7 @@ BL::GenericGui::updateButtonsStates()
     for (int i = 0; i < selected_rows.length(); ++i)
     {
       QString job_name = _model->itemFromIndex(selected_rows[i])->text();
-      BL::Job * job = _jobs_manager->getJob(job_name.toStdString());
+      BL::Job * job = _jobs_manager->getJob(job_name.toUtf8().constData());
       BL::Job::State job_state = job->getState();
       if (job_state != BL::Job::QUEUED  &&
           job_state != BL::Job::RUNNING &&
@@ -444,7 +444,7 @@ BL::GenericGui::updateButtonsStates()
     for (int i = 0; i < selected_rows.length(); ++i)
     {
       QString job_name = _model->itemFromIndex(selected_rows[i])->text();
-      BL::Job * job = _jobs_manager->getJob(job_name.toStdString());
+      BL::Job * job = _jobs_manager->getJob(job_name.toUtf8().constData());
       BL::Job::State job_state = job->getState();
       if (job_state != BL::Job::FINISHED &&
           job_state != BL::Job::FAILED)
@@ -486,7 +486,7 @@ BL::GenericGui::updateButtonsStatesSingleSelection()
   }
   else if (_job_name_selected != "")
   {
-    BL::Job * job = _jobs_manager->getJob(_job_name_selected.toStdString());
+    BL::Job * job = _jobs_manager->getJob(_job_name_selected.toUtf8().constData());
     BL::Job::State job_state = job->getState();
 
     _edit_clone_job_action->setEnabled(true);
index 168e5fb3f1092e18f6370fa29e04c5cab3125c3d..bd44f39546a3bb5e59dd908406f4b0fccdbbeafb 100644 (file)
@@ -188,11 +188,11 @@ BL::JobTab::job_selected(const QModelIndex & index)
   QStandardItem * item_name = _model->item(item->row());
   if (item)
   {
-    BL::Job * job = _jobs_manager->getJob(item_name->text().toStdString());
+    BL::Job * job = _jobs_manager->getJob(item_name->text().toUtf8().constData());
 
     reset("");
 
-    _job_name_label_value->setText(QString(job->getName().c_str()));
+    _job_name_label_value->setText(QString::fromUtf8(job->getName().c_str()));
 
     if (job->getState() == BL::Job::CREATED)
       _job_state_label_value->setText("Created");
@@ -214,8 +214,8 @@ BL::JobTab::job_selected(const QModelIndex & index)
       _job_state_label_value->setText("Finished");
 
     _job_launcher_label_value->setText(QVariant(job->getSalomeLauncherId()).toString());
-    _job_jobfile_label_value->setText(QString(job->getJobFile().c_str()));
-    _job_envfile_label_value->setText(QString(job->getEnvFile().c_str()));
+    _job_jobfile_label_value->setText(QString::fromUtf8(job->getJobFile().c_str()));
+    _job_envfile_label_value->setText(QString::fromUtf8(job->getEnvFile().c_str()));
     if (job->getType() == BL::Job::YACS_SCHEMA)
       _job_type_label_value->setText("YACS_Schema");
     else if (job->getType() == BL::Job::COMMAND)
@@ -223,7 +223,7 @@ BL::JobTab::job_selected(const QModelIndex & index)
     else if (job->getType() == BL::Job::PYTHON_SALOME)
       _job_type_label_value->setText("Python_Salome");
 
-    _job_resource_label_value->setText(QString(job->getResource().c_str()));
+    _job_resource_label_value->setText(QString::fromUtf8(job->getResource().c_str()));
 
     BL::Job::BatchParam batch_params = job->getBatchParameters();
 
@@ -232,8 +232,8 @@ BL::JobTab::job_selected(const QModelIndex & index)
     _job_nif_label_value->setText(QVariant(nif).toString());
     int nof = files_params.output_files_list.size();
     _job_nof_label_value->setText(QVariant(nof).toString());
-    _job_bd_label_value->setText(QString(batch_params.batch_directory.c_str()));
-    _job_rd_label_value->setText(QString(files_params.result_directory.c_str()));
+    _job_bd_label_value->setText(QString::fromUtf8(batch_params.batch_directory.c_str()));
+    _job_rd_label_value->setText(QString::fromUtf8(files_params.result_directory.c_str()));
 
     _job_mdt_label_value->setText(QString(batch_params.maximum_duration.c_str()));
     _job_nop_label_value->setText(QVariant(batch_params.nb_proc).toString());
@@ -261,8 +261,8 @@ BL::JobTab::job_selected(const QModelIndex & index)
     _job_em_label_value->setText(QString(mem_ss.str().c_str()));
 
     // Parameters for COORM
-    _job_lf_label_value->setText(QString(batch_params.launcher_file.c_str()));
-    _job_la_label_value->setText(QString(batch_params.launcher_args.c_str()));
+    _job_lf_label_value->setText(QString::fromUtf8(batch_params.launcher_file.c_str()));
+    _job_la_label_value->setText(QString::fromUtf8(batch_params.launcher_args.c_str()));
 
     _input_files_list->clear();
     _output_files_list->clear();
@@ -270,12 +270,12 @@ BL::JobTab::job_selected(const QModelIndex & index)
     for (it = files_params.input_files_list.begin(); it != files_params.input_files_list.end(); it++)
     {
       std::string file = *it;
-      _input_files_list->addItem(QString(file.c_str()));
+      _input_files_list->addItem(QString::fromUtf8(file.c_str()));
     }
     for (it = files_params.output_files_list.begin(); it != files_params.output_files_list.end(); it++)
     {
       std::string file = *it;
-      _output_files_list->addItem(QString(file.c_str()));
+      _output_files_list->addItem(QString::fromUtf8(file.c_str()));
     }
 
     // Specific parameters management
@@ -306,9 +306,9 @@ BL::JobTab::itemChanged(QStandardItem * item)
   DEBTRACE("BL::JobTab::itemChanged slot");
 
   QStandardItem * item_name = _model->item(item->row());
-  BL::Job * job = _jobs_manager->getJob(item_name->text().toStdString());
+  BL::Job * job = _jobs_manager->getJob(item_name->text().toUtf8().constData());
 
-  if (_job_name_label_value->text() == QString(job->getName().c_str()))
+  if (_job_name_label_value->text() == QString::fromUtf8(job->getName().c_str()))
   {
     if (job->getState() == BL::Job::CREATED)
       _job_state_label_value->setText("Created");
index 6561025bc4e38c192ad71ff9ba38526ca898e286..836e69852a335f8105586639df450871c0ab2c48 100644 (file)
@@ -120,7 +120,7 @@ BL::JobsManager_QT::load_jobs_button()
     write_normal_text("Load jobs action cancelled\n");
   }
   else
-    load_jobs(jobs_file.toStdString());
+    load_jobs(jobs_file.toUtf8().constData());
 }
 
 void
@@ -152,7 +152,7 @@ BL::JobsManager_QT::save_jobs_button()
     write_normal_text("Save jobs action cancelled\n");
   }
   else
-    save_jobs(jobs_file.toStdString());
+    save_jobs(jobs_file.toUtf8().constData());
 }
 
 void
@@ -328,9 +328,9 @@ BL::JobsManager_QT::create_job_with_wizard(BL::CreateJobWizard & wizard)
 
   // End
   addJobToLauncher(wizard.job_name);
-  emit new_job_added(QString::fromStdString(wizard.job_name));
+  emit new_job_added(QString::fromUtf8(wizard.job_name.c_str()));
   QStandardItemModel * model = _model_manager->getModel();
-  QList<QStandardItem *> item_list = model->findItems(QString::fromStdString(wizard.job_name));
+  QList<QStandardItem *> item_list = model->findItems(QString::fromUtf8(wizard.job_name.c_str()));
   QStandardItem * job_state_item = model->item(item_list.at(0)->row(), 2);
   _main_gui->_jobs_table->selectRow(item_list.at(0)->row());
   if (wizard.start_job)
@@ -340,7 +340,7 @@ BL::JobsManager_QT::create_job_with_wizard(BL::CreateJobWizard & wizard)
 void
 BL::JobsManager_QT::delete_job(QString job_name)
 {
-  BL::JobsManager::removeJob(job_name.toStdString());
+  BL::JobsManager::removeJob(job_name.toUtf8().constData());
   _model_manager->delete_job(job_name);
   _main_gui->_job_tab->reset(job_name);
 }
@@ -371,17 +371,16 @@ BL::JobsManager_QT::event(QEvent * e)
           << event->job_name << " "
           << event->data);
 
+  QString job_name = QString::fromUtf8(event->job_name.c_str());
   if (event->action == "create_job")
   {
     if (event->event_name == "Ok")
     {
-      QString str((event->job_name).c_str());
-      write_normal_text("Job " + str + " created\n");
+      write_normal_text("Job " + job_name + " created\n");
     }
     else
     {
-      QString str((event->job_name).c_str());
-      write_error_text("Error in creating job: " + str + "\n");
+      write_error_text("Error in creating job: " + job_name + "\n");
       write_error_text("*** ");
       write_error_text((event->data).c_str());
       write_error_text(" ***\n");
@@ -391,33 +390,29 @@ BL::JobsManager_QT::event(QEvent * e)
   {
     if (event->event_name == "Ok")
     {
-      QString str((event->job_name).c_str());
-      write_normal_text("Job " + str + " queued\n");
+      write_normal_text("Job " + job_name + " queued\n");
     }
     else
     {
-      QString str((event->job_name).c_str());
-      write_error_text("Error in starting job: " + str + "\n");
+      write_error_text("Error in starting job: " + job_name + "\n");
       write_error_text("*** ");
       write_error_text((event->data).c_str());
       write_error_text(" ***\n");
     }
-    emit job_state_changed(QString((event->job_name).c_str()));
+    emit job_state_changed(job_name);
   }
   else if (event->action == "refresh_job")
   {
     if (event->event_name == "Ok")
     {
-      QString name((event->job_name).c_str());
       QString state((event->data).c_str());
       state = state.toLower();
-      write_normal_text("Job " + name + " new state is " + state + "\n");
-      emit job_state_changed(QString((event->job_name).c_str()));
+      write_normal_text("Job " + job_name + " new state is " + state + "\n");
+      emit job_state_changed(job_name);
     }
     else
     {
-      QString str((event->job_name).c_str());
-      write_error_text("Error in refreshing job: " + str + "\n");
+      write_error_text("Error in refreshing job: " + job_name + "\n");
       write_error_text("*** ");
       write_error_text((event->data).c_str());
       write_error_text(" ***\n");
@@ -427,13 +422,11 @@ BL::JobsManager_QT::event(QEvent * e)
   {
     if (event->event_name == "Ok")
     {
-      QString str((event->job_name).c_str());
-      write_normal_text("Job " + str + " deleted\n");
+      write_normal_text("Job " + job_name + " deleted\n");
     }
     else
     {
-      QString str((event->job_name).c_str());
-      write_error_text("Warning delete job: " + str + " maybe not complete, exception catch in SALOME Launcher service\n");
+      write_error_text("Warning delete job: " + job_name + " maybe not complete, exception catch in SALOME Launcher service\n");
       write_error_text("*** ");
       write_error_text((event->data).c_str());
       write_error_text(" ***\n");
@@ -443,13 +436,11 @@ BL::JobsManager_QT::event(QEvent * e)
   {
     if (event->event_name == "Ok")
     {
-      QString str((event->job_name).c_str());
-      write_normal_text("Results of Job " + str + " are get\n");
+      write_normal_text("Results of Job " + job_name + " are get\n");
     }
     else
     {
-      QString str((event->job_name).c_str());
-      write_error_text("Warning for results of job: " + str + " maybe not complete, exception catch in SALOME Launcher service\n");
+      write_error_text("Warning for results of job: " + job_name + " maybe not complete, exception catch in SALOME Launcher service\n");
       write_error_text("*** ");
       write_error_text((event->data).c_str());
       write_error_text(" ***\n");
@@ -459,13 +450,11 @@ BL::JobsManager_QT::event(QEvent * e)
   {
     if (event->event_name == "Ok")
     {
-      QString str((event->job_name).c_str());
-      write_normal_text("Job " + str + " is stopped\n");
+      write_normal_text("Job " + job_name + " is stopped\n");
     }
     else
     {
-      QString str((event->job_name).c_str());
-      write_error_text("Error when trying to stop job: " + str + "\n");
+      write_error_text("Error when trying to stop job: " + job_name + "\n");
       write_error_text("*** ");
       write_error_text((event->data).c_str());
       write_error_text(" ***\n");
@@ -475,15 +464,13 @@ BL::JobsManager_QT::event(QEvent * e)
   {
     if (event->event_name == "Ok")
     {
-      QString str((event->job_name).c_str());
-
          vector<string> hostnames;
 
          Tokenize(event->data, hostnames, "+");
 
          vector<string>::iterator it;
 
-      write_normal_text("Job " + str + " assigned hostnames are :\n");
+      write_normal_text("Job " + job_name + " assigned hostnames are :\n");
 
          for (it = hostnames.begin(); it < hostnames.end(); it++)
          {
@@ -532,15 +519,14 @@ BL::JobsManager_QT::event(QEvent * e)
   {
     if (event->event_name == "Ok")
     {
-      QString str((event->job_name).c_str());
-      write_normal_text("New job added " + str + "\n");
-      emit new_job_added(str);
+      write_normal_text("New job added " + job_name + "\n");
+      emit new_job_added(job_name);
     }
   }
   else if (event->action == "to_remove_job")
   {
     if (event->event_name == "Ok")
-      _main_gui->delete_job_external((event->job_name).c_str());
+      _main_gui->delete_job_external(job_name);
   }
   else
   {
index 77bd60eb47ae9371ab060ac275a710382a98955c..8de8bb54a135d88be2f0e87cf9fa49c885ddbb8d 100644 (file)
@@ -54,7 +54,7 @@ void
 BL::QModelManager::new_job_added(const QString & name)
 {
   DEBTRACE("Adding new job in the model manager");
-  BL::Job * job = _jobs_manager->getJob(name.toStdString());
+  BL::Job * job = _jobs_manager->getJob(name.toUtf8().constData());
   QStandardItem * new_job_name = new QStandardItem(name);
   
   QStandardItem * new_job_type;
@@ -101,7 +101,7 @@ BL::QModelManager::job_state_changed(const QString & name)
 {
   DEBTRACE("BL::QModelManager::job_state_changed received");
 
-  BL::Job * job = _jobs_manager->getJob(name.toStdString());
+  BL::Job * job = _jobs_manager->getJob(name.toUtf8().constData());
   QList<QStandardItem *> item_list = _model->findItems(name);
   QStandardItem * job_state_item = _model->item(item_list.at(0)->row(), 2);
 
@@ -130,7 +130,7 @@ BL::QModelManager::delete_job(const QString & name)
   if (list.size() != 1)
   {
     DEBMSG("LIST SIZE IS :" << list.size());
-    DEBMSG("FOR NAME :" << name.toStdString());
+    DEBMSG("FOR NAME :" << name.toUtf8().constData());
   }
   if (list.size() > 0)
     _model->removeRow(list[0]->row());
index bb958254342f11698f641a4520843bd2ef1a813d..7dcf8ffcf28f74b26c5b5f2342ab7c1e2fba79a5 100644 (file)
@@ -331,12 +331,12 @@ JM::EditSalomeResource::accept()
   BL::ResourceDescr resource;
 
   // Text
-  resource.name = _name_line->text().trimmed().toStdString();
+  resource.name = _name_line->text().trimmed().toUtf8().constData();
   resource.hostname = _hostname_line->text().trimmed().toStdString();
   resource.username = _username_line->text().trimmed().toStdString();
-  resource.applipath = _applipath_line->text().trimmed().toStdString();
+  resource.applipath = _applipath_line->text().trimmed().toUtf8().constData();
   resource.OS = _os_line->text().trimmed().toStdString();
-  resource.working_directory = _working_directory->text().trimmed().toStdString();
+  resource.working_directory = _working_directory->text().trimmed().toUtf8().constData();
   resource.can_launch_batch_jobs = (_can_launch_batch_jobs->checkState() == Qt::Checked);
   resource.can_run_containers = (_can_run_containers->checkState() == Qt::Checked);
 
index c72d59228ed6aaace59792024da9cf4c671e2af2..62f52dcf2194a55159ad8987e0650c6cab1595ac 100644 (file)
@@ -108,7 +108,7 @@ JM::ResourceCatalog::item_choosed(QListWidgetItem * item)
   DEBTRACE("JM::ResourceCatalog::item_choosed");
   JM::SalomeResource * resource_widget = new JM::SalomeResource(this,
                                                                 _salome_services,
-                                                                item->text().toStdString());
+                                                                item->text().toUtf8().constData());
   resource_widget->exec();
   delete resource_widget;
 }
@@ -155,7 +155,7 @@ JM::ResourceCatalog::remove_button()
 {
   QList<QListWidgetItem *> item_list = _resource_files_list->selectedItems();
   QString item_name = item_list.at(0)->text();
-  _salome_services->removeResource(item_name.toStdString());
+  _salome_services->removeResource(item_name.toUtf8().constData());
   refresh_resource_list();
 }
 
@@ -166,7 +166,7 @@ JM::ResourceCatalog::edit_button()
   QString item_name = item_list.at(0)->text();
   JM::EditSalomeResource * resource_widget = new JM::EditSalomeResource(this,
                                                                         _salome_services,
-                                                                        item_name.toStdString());
+                                                                        item_name.toUtf8().constData());
   resource_widget->exec();
   delete resource_widget;
   refresh_resource_list();