From 9f5ed3176e5b0af729f311fbad0ca60e4a7bcd68 Mon Sep 17 00:00:00 2001 From: Renaud Barate Date: Thu, 10 Jul 2014 15:40:48 +0200 Subject: [PATCH] UTF-8 support (not fully tested yet) --- src/genericgui/BL_CreateJobWizard.cxx | 42 ++++++++-------- src/genericgui/BL_GenericGui.cxx | 26 +++++----- src/genericgui/BL_JobTab.cxx | 26 +++++----- src/genericgui/BL_JobsManager_QT.cxx | 62 +++++++++--------------- src/genericgui/BL_QModelManager.cxx | 6 +-- src/genericgui/JM_EditSalomeResource.cxx | 6 +-- src/genericgui/JM_ResourceCatalog.cxx | 6 +-- 7 files changed, 80 insertions(+), 94 deletions(-) diff --git a/src/genericgui/BL_CreateJobWizard.cxx b/src/genericgui/BL_CreateJobWizard.cxx index 19229f2..6ff0fe2 100644 --- a/src/genericgui/BL_CreateJobWizard.cxx +++ b/src/genericgui/BL_CreateJobWizard.cxx @@ -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") { diff --git a/src/genericgui/BL_GenericGui.cxx b/src/genericgui/BL_GenericGui.cxx index 8adb909..fe4fd31 100644 --- a/src/genericgui/BL_GenericGui.cxx +++ b/src/genericgui/BL_GenericGui.cxx @@ -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); diff --git a/src/genericgui/BL_JobTab.cxx b/src/genericgui/BL_JobTab.cxx index 168e5fb..bd44f39 100644 --- a/src/genericgui/BL_JobTab.cxx +++ b/src/genericgui/BL_JobTab.cxx @@ -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"); diff --git a/src/genericgui/BL_JobsManager_QT.cxx b/src/genericgui/BL_JobsManager_QT.cxx index 6561025..836e698 100644 --- a/src/genericgui/BL_JobsManager_QT.cxx +++ b/src/genericgui/BL_JobsManager_QT.cxx @@ -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 item_list = model->findItems(QString::fromStdString(wizard.job_name)); + QList 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 hostnames; Tokenize(event->data, hostnames, "+"); vector::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 { diff --git a/src/genericgui/BL_QModelManager.cxx b/src/genericgui/BL_QModelManager.cxx index 77bd60e..8de8bb5 100644 --- a/src/genericgui/BL_QModelManager.cxx +++ b/src/genericgui/BL_QModelManager.cxx @@ -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 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()); diff --git a/src/genericgui/JM_EditSalomeResource.cxx b/src/genericgui/JM_EditSalomeResource.cxx index bb95825..7dcf8ff 100644 --- a/src/genericgui/JM_EditSalomeResource.cxx +++ b/src/genericgui/JM_EditSalomeResource.cxx @@ -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); diff --git a/src/genericgui/JM_ResourceCatalog.cxx b/src/genericgui/JM_ResourceCatalog.cxx index c72d592..62f52dc 100644 --- a/src/genericgui/JM_ResourceCatalog.cxx +++ b/src/genericgui/JM_ResourceCatalog.cxx @@ -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 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(); -- 2.39.2