From a3376d32a4c3af085c87526b5e3b7579a855ebd0 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 28 Oct 2012 13:34:58 +0100 Subject: [PATCH] fixes #3 allow Qt without STLport to link to NeL with STLport --- .../src/extension_system/plugin_manager.cpp | 6 +-- .../src/extension_system/plugin_spec.cpp | 2 +- .../tools/3d/object_viewer_qt/src/main.cpp | 2 +- .../bnp_manager/bnp_filelist_dialog.cpp | 4 +- .../bnp_manager/bnp_manager_window.cpp | 20 ++++---- .../src/plugins/core/context_manager.cpp | 18 ++++---- .../plugins/core/general_settings_page.cpp | 6 +-- .../src/plugins/core/menu_manager.cpp | 4 +- .../core/search_paths_settings_page.cpp | 4 +- .../plugins/georges_editor/formdelegate.cpp | 12 ++--- .../src/plugins/georges_editor/formitem.cpp | 12 ++--- .../georges_editor/georges_editor_form.cpp | 2 +- .../georges_treeview_dialog.cpp | 46 +++++++++---------- .../georges_editor/georgesform_model.cpp | 16 +++---- .../mission_compiler_main_window.cpp | 6 +-- .../object_viewer/animation_dialog.cpp | 2 +- .../object_viewer/animation_set_dialog.cpp | 8 ++-- .../src/plugins/object_viewer/main_window.cpp | 4 +- .../src/plugins/object_viewer/mesh_widget.cpp | 4 +- .../object_viewer/morph_mesh_dialog.cpp | 6 +-- .../plugins/object_viewer/object_viewer.cpp | 2 +- .../object_viewer/particle_force_page.cpp | 4 +- .../object_viewer/particle_sound_page.cpp | 4 +- .../object_viewer/particle_system_page.cpp | 2 +- .../object_viewer/particle_texture_widget.cpp | 4 +- .../object_viewer/particle_tree_model.cpp | 2 +- .../particle_workspace_dialog.cpp | 6 +-- .../object_viewer/particle_workspace_page.cpp | 12 ++--- .../object_viewer/scheme_bank_dialog.cpp | 8 ++-- .../object_viewer/skeleton_scale_dialog.cpp | 12 ++--- .../object_viewer/slot_manager_dialog.cpp | 6 +-- .../plugins/object_viewer/sound_system.cpp | 8 ++-- .../object_viewer/vegetable_density_page.cpp | 6 +-- .../object_viewer/vegetable_dialog.cpp | 10 ++-- .../object_viewer/vegetable_editor.cpp | 10 ++-- .../ovqt_sheet_builder/sheetbuilderdialog.cpp | 6 +-- .../translation_manager/editor_phrase.cpp | 2 +- .../translation_manager/editor_worksheet.cpp | 29 ++++++------ .../translation_manager_main_window.cpp | 22 ++++----- .../3d/tile_edit_qt/tile_browser_dlg.cpp | 22 ++++----- .../tools/3d/tile_edit_qt/tile_edit_dlg.cpp | 26 +++++------ .../tools/misc/words_dic_qt/words_dicDlg.cpp | 4 +- .../nelns/login_service/connection_client.cpp | 2 +- .../nel_launcher_qt/nel_launcher_dlg.cpp | 4 +- .../georges_editor_qt/src/configuration.cpp | 2 +- .../georges_editor_qt/src/formdelegate.cpp | 10 ++-- .../georges_editor_qt/src/formitem.cpp | 18 +++----- .../src/georges_treeview_dialog.cpp | 24 +++++----- .../src/georgesform_model.cpp | 16 +++---- .../src/georgesform_proxy_model.cpp | 2 +- .../georges_editor_qt/src/main.cpp | 2 +- .../georges_editor_qt/src/main_window.cpp | 18 ++++---- .../georges_editor_qt/src/modules.cpp | 12 ++--- .../georges_editor_qt/src/new_dialog.cpp | 10 ++-- .../georges_editor_qt/src/settings_dialog.cpp | 6 +-- 55 files changed, 256 insertions(+), 261 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp index 6c5b8a36c..9b9da508b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp @@ -54,7 +54,7 @@ void PluginManager::addObject(QObject *obj) nlwarning("trying to add duplicate object"); return; } - nlinfo(QString("addObject: " + obj->objectName()).toStdString().c_str()); + nlinfo("addObject: %s", obj->objectName().toUtf8().constData()); m_allObjects.append(obj); @@ -71,10 +71,10 @@ void PluginManager::removeObject(QObject *obj) if (!m_allObjects.contains(obj)) { - nlinfo(QString("object not in list: " + obj->objectName()).toStdString().c_str()); + nlinfo("object not in list: %s", obj->objectName().toUtf8().constData()); return; } - nlinfo(QString("removeObject: " + obj->objectName()).toStdString().c_str()); + nlinfo("removeObject: %s", obj->objectName().toUtf8().constData()); Q_EMIT aboutToRemoveObject(obj); QWriteLocker lock(&m_lock); diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp index fea606af2..89f8046bb 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp @@ -186,7 +186,7 @@ bool PluginSpec::setFileName(const QString &fileName) #endif - nlinfo(m_filePath.toStdString().c_str()); + nlinfo(m_filePath.toUtf8().constData()); if (!exists) return reportError(QCoreApplication::translate("PluginSpec", "File does not exist: %1").arg(file.fileName())); diff --git a/code/nel/tools/3d/object_viewer_qt/src/main.cpp b/code/nel/tools/3d/object_viewer_qt/src/main.cpp index ea78905fa..d7569bda8 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/main.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/main.cpp @@ -149,7 +149,7 @@ sint main(int argc, char **argv) #if defined(NL_OS_MAC) QDir::setCurrent(qApp->applicationDirPath() + QString("/../Resources")); - NLMISC::CLibrary::addLibPath((qApp->applicationDirPath() + QString("/../PlugIns/nel")).toStdString()); + NLMISC::CLibrary::addLibPath((qApp->applicationDirPath() + QString("/../PlugIns/nel")).toUtf8().constData()); #endif ExtensionSystem::PluginManager pluginManager; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_filelist_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_filelist_dialog.cpp index 42106e864..ebeb07bd8 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_filelist_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_filelist_dialog.cpp @@ -79,7 +79,7 @@ bool BnpFileListDialog::loadTable(const QString filePath) int row = 0; // read the header from the bnp file - if (!myBNPFileHandle.readHeader( filePath.toStdString()) ) + if (!myBNPFileHandle.readHeader( filePath.toUtf8().constData()) ) { return false; } @@ -125,7 +125,7 @@ void BnpFileListDialog::getSelections(TSelectionList& SelectionList) { QVariant data = model->data(index); QString filename = data.toString(); - SelectionList.push_back( filename.toStdString() ); + SelectionList.push_back( filename.toUtf8().constData() ); } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_manager_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_manager_window.cpp index edeb30bc4..04b4fd628 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_manager_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_manager_window.cpp @@ -94,7 +94,7 @@ void BNPManagerWindow::createDialogs() { // create dialog to list the contents of the specified // bnp data file directory - m_BnpDirTreeDialog = new CBnpDirTreeDialog(tr(m_DataPath.toStdString().c_str()),this); + m_BnpDirTreeDialog = new CBnpDirTreeDialog(tr(m_DataPath.toUtf8().constData()),this); addDockWidget(Qt::LeftDockWidgetArea, m_BnpDirTreeDialog); m_BnpDirTreeDialog->setVisible(true); restoreDockWidget(m_BnpDirTreeDialog); @@ -187,7 +187,7 @@ void BNPManagerWindow::newFile() m_openedBNPFile = filePath; m_BnpFileListDialog->setWindowTitle (filePath); - myBNPFileHandle.createFile ( filePath.toStdString() ); + myBNPFileHandle.createFile ( filePath.toUtf8().constData() ); } // *************************************************************************** @@ -196,7 +196,7 @@ void BNPManagerWindow::open() QString fileName; // file dialog to select with file should be opened fileName = QFileDialog::getOpenFileName(this, - tr("Open BNP file"), tr(m_DataPath.toStdString().c_str()), tr("BNP Files (*.bnp)")); + tr("Open BNP file"), tr(m_DataPath.toUtf8().constData()), tr("BNP Files (*.bnp)")); // Check if filename is empty if (fileName.isNull()) @@ -234,7 +234,7 @@ void BNPManagerWindow::addFiles() QStringList::iterator it_list = FileList.begin(); while (it_list != FileList.end() ) { - string fileName = CFile::getFilename (it_list->toStdString() ); + string fileName = CFile::getFilename (it_list->toUtf8().constData() ); if ( std::find(currentFiles.begin(), currentFiles.end(), fileName ) != currentFiles.end() ) { // Ask the user if he wants to override the existing file @@ -246,7 +246,7 @@ void BNPManagerWindow::addFiles() } else { - addFiles.push_back( it_list->toStdString() ); + addFiles.push_back( it_list->toUtf8().constData() ); // log it nlinfo("Add file %s", fileName.c_str() ); } @@ -277,7 +277,7 @@ void BNPManagerWindow::addFiles( QStringList FileList ) QStringList::iterator it_list = FileList.begin(); while (it_list != FileList.end() ) { - string fileName = CFile::getFilename (it_list->toStdString() ); + string fileName = CFile::getFilename (it_list->toUtf8().constData() ); if ( std::find(currentFiles.begin(), currentFiles.end(), fileName ) != currentFiles.end() ) { // Ask the user if he wants to override the existing file @@ -289,7 +289,7 @@ void BNPManagerWindow::addFiles( QStringList FileList ) } else { - addFiles.push_back( it_list->toStdString() ); + addFiles.push_back( it_list->toUtf8().constData() ); // log it nlinfo("Add file %s", fileName.c_str() ); } @@ -346,7 +346,7 @@ void BNPManagerWindow::unpackFiles() } QString dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"), - tr(m_DataPath.toStdString().c_str()), + tr(m_DataPath.toUtf8().constData()), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); @@ -354,7 +354,7 @@ void BNPManagerWindow::unpackFiles() if ( dir.isEmpty() ) return; - if (myBNPFileHandle.unpack(dir.toStdString(),selectedrows)) + if (myBNPFileHandle.unpack(dir.toUtf8().constData(),selectedrows)) { QMessageBox::information(this, tr("BNP Manager"), tr("All files has been exported successfully."), @@ -426,7 +426,7 @@ void BNPManagerWindow::dropEvent(QDropEvent *event) filePath = it->toLocalFile(); if ( filePath.endsWith(".bnp") ) { - nlwarning("Could not add a bnp file!", filePath.toStdString().c_str() ); + nlwarning("Could not add bnp file %s!", filePath.toUtf8().constData() ); } else { diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/context_manager.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/context_manager.cpp index d82cdb63b..d1aa6cb14 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/context_manager.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/context_manager.cpp @@ -78,16 +78,16 @@ Core::IContext *ContextManager::context(const QString &id) const return 0; } -void ContextManager::registerUndoStack(QUndoStack *stack) -{ - nlassert(stack); - d->m_mainWindow->undoGroup()->addStack(stack); -} - +void ContextManager::registerUndoStack(QUndoStack *stack) +{ + nlassert(stack); + d->m_mainWindow->undoGroup()->addStack(stack); +} + void ContextManager::unregisterUndoStack(QUndoStack *stack) { - nlassert(stack); - d->m_mainWindow->undoGroup()->removeStack(stack); + nlassert(stack); + d->m_mainWindow->undoGroup()->removeStack(stack); } void ContextManager::activateContext(const QString &id) @@ -160,7 +160,7 @@ int ContextManager::indexOf(const QString &id) const if (d->m_contexts.at(i)->id() == id) return i; } - nlwarning(QString("Warning, no such context: %1").arg(id).toStdString().c_str()); + nlwarning(QString("Warning, no such context: %1").arg(id).toUtf8().constData()); return -1; } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.cpp index e21edafec..bfbb06d66 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.cpp @@ -99,10 +99,10 @@ void GeneralSettingsPage::applyGeneralSettings() QString primitivePath = settings->value(Core::Constants::PRIMITIVES_PATH, QString("%1/primitives").arg(levelDesignPrefix)).toString(); QString ligoConfigFile = settings->value(Core::Constants::LIGOCONFIG_FILE, QString("%1/leveldesign/world_editor_files/world_editor_classes.xml").arg(levelDesignPrefix)).toString(); QString leveldesignPath = settings->value(Core::Constants::LEVELDESIGN_PATH, QString("%1/leveldesign").arg(levelDesignPrefix)).toString(); - NLMISC::CPath::addSearchPath(primitivePath.toStdString(), true, false); + NLMISC::CPath::addSearchPath(primitivePath.toUtf8().constData(), true, false); NLMISC::CPath::display(); - NLMISC::CPath::addSearchFile(ligoConfigFile.toStdString()); - NLMISC::CPath::addSearchPath(leveldesignPath.toStdString(), true, false); + NLMISC::CPath::addSearchFile(ligoConfigFile.toUtf8().constData()); + NLMISC::CPath::addSearchPath(leveldesignPath.toUtf8().constData(), true, false); settings->endGroup(); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/menu_manager.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/menu_manager.cpp index 68a8e3080..3e6272f0a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/menu_manager.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/menu_manager.cpp @@ -62,7 +62,7 @@ QMenu *MenuManager::menu(const QString &id) const { QMenu *result = 0; if (!d->m_menuMap.contains(id)) - nlwarning("QMenu %s not found", id.toStdString().c_str()); + nlwarning("QMenu %s not found", id.toUtf8().constData()); else result = d->m_menuMap.value(id); return result; @@ -72,7 +72,7 @@ QAction *MenuManager::action(const QString &id) const { QAction *result = 0; if (!d->m_actionMap.contains(id)) - nlwarning("QAction %s not found", id.toStdString().c_str()); + nlwarning("QAction %s not found", id.toUtf8().constData()); else result = d->m_actionMap.value(id); return result; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp index 1a2ac3eef..e76d6c796 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp @@ -116,11 +116,11 @@ void SearchPathsSettingsPage::applySearchPaths() settings->endGroup(); for (int i = 1; i < remapExt.size(); i += 2) - NLMISC::CPath::remapExtension(remapExt.at(i - 1).toStdString(), remapExt.at(i).toStdString(), true); + NLMISC::CPath::remapExtension(remapExt.at(i - 1).toUtf8().constData(), remapExt.at(i).toUtf8().constData(), true); Q_FOREACH(QString path, paths) { - NLMISC::CPath::addSearchPath(path.toStdString(), m_recurse, false); + NLMISC::CPath::addSearchPath(path.toUtf8().constData(), m_recurse, false); } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formdelegate.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formdelegate.cpp index 7f21fa072..7cbfe9616 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formdelegate.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formdelegate.cpp @@ -95,7 +95,7 @@ namespace GeorgesQt //QString min = QString(type->getMin().c_str()); //QString max = QString(type->getMax().c_str()); //QString inc = QString(type->getIncrement().c_str()); - //nldebug(QString("min %1 max %2 inc %3").arg(min).arg(max).arg(inc).toStdString().c_str()); + //nldebug(QString("min %1 max %2 inc %3").arg(min).arg(max).arg(inc).toUtf8().constData()); // TODO: use saved min/max values editor->setMinimum(-99999); @@ -110,7 +110,7 @@ namespace GeorgesQt //QString min = QString(type->getMin().c_str()); //QString max = QString(type->getMax().c_str()); //QString inc = QString(type->getIncrement().c_str()); - //nldebug(QString("min %1 max %2 inc %3").arg(min).arg(max).arg(inc).toStdString().c_str()); + //nldebug(QString("min %1 max %2 inc %3").arg(min).arg(max).arg(inc).toUtf8().constData()); // TODO: use saved min/max values editor->setMinimum(-99999); @@ -201,7 +201,7 @@ namespace GeorgesQt else { nldebug(QString("setModelData from %1 to %2") - .arg(oldValue).arg(value).toStdString().c_str()); + .arg(oldValue).arg(value).toUtf8().constData()); model->setData(index, value, Qt::EditRole); } } @@ -222,7 +222,7 @@ namespace GeorgesQt else { nldebug(QString("setModelData from %1 to %2") - .arg(oldValue).arg(value).toStdString().c_str()); + .arg(oldValue).arg(value).toUtf8().constData()); model->setData(index, value, Qt::EditRole); } break; @@ -239,7 +239,7 @@ namespace GeorgesQt else { nldebug(QString("setModelData from %1 to %2") - .arg(oldValue).arg(value).toStdString().c_str()); + .arg(oldValue).arg(value).toUtf8().constData()); model->setData(index, value, Qt::EditRole); } break; @@ -260,7 +260,7 @@ namespace GeorgesQt else { nldebug(QString("setModelData from %1 to %2") - .arg(oldValue).arg(value).toStdString().c_str()); + .arg(oldValue).arg(value).toUtf8().constData()); model->setData(index, value, Qt::EditRole); } break; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formitem.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formitem.cpp index e6e526631..950825e71 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formitem.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formitem.cpp @@ -118,10 +118,10 @@ namespace GeorgesQt { if (elmt->isAtom()) { - ((NLGEORGES::CFormElmAtom*)elmt)->setValue(value.toString().toStdString().c_str()); + ((NLGEORGES::CFormElmAtom*)elmt)->setValue(value.toString().toUtf8().constData()); nldebug(QString("array element string %1 %2") .arg(itemData[0].toString()).arg(value.toString()) - .toStdString().c_str()); + .toUtf8().constData()); } } } @@ -129,18 +129,18 @@ namespace GeorgesQt else { if(parentItem->formElm->setValueByName( - value.toString().toStdString().c_str(), - itemData[0].toString().toStdString().c_str())) + value.toString().toUtf8().constData(), + itemData[0].toString().toUtf8().constData())) { nldebug(QString("string %1 %2") .arg(itemData[0].toString()).arg(value.toString()) - .toStdString().c_str()); + .toUtf8().constData()); } else { nldebug(QString("FAILED string %1 %2") .arg(itemData[0].toString()).arg(value.toString()) - .toStdString().c_str()); + .toUtf8().constData()); } } break; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.cpp index a36f411e0..5a3f5a625 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.cpp @@ -253,7 +253,7 @@ namespace GeorgesQt } else { - nlwarning("Failed to load form: %s", info.fileName().toStdString().c_str()); + nlwarning("Failed to load form: %s", info.fileName().toUtf8().constData()); m_dockedWidgets.last()->close(); } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_treeview_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_treeview_dialog.cpp index 3bdc680ff..2fe19ad02 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_treeview_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_treeview_dialog.cpp @@ -117,30 +117,30 @@ namespace GeorgesQt NLGEORGES::CForm* CGeorgesTreeViewDialog::getFormByName(const QString formName) { - if(NLMISC::CPath::exists(formName.toStdString())) + if(NLMISC::CPath::exists(formName.toUtf8().constData())) { - //NLGEORGES::CForm *form = dynamic_cast(m_georges->loadForm(formName.toStdString())); - return (NLGEORGES::CForm *)m_georges->loadForm(formName.toStdString()); + //NLGEORGES::CForm *form = dynamic_cast(m_georges->loadForm(formName.toUtf8())); + return (NLGEORGES::CForm *)m_georges->loadForm(formName.toUtf8().constData()); } //else //{ // CForm *form = 0; // // Load the DFN - // std::string extStr = NLMISC::CFile::getExtension( formName.toStdString() ); + // std::string extStr = NLMISC::CFile::getExtension( formName.toUtf8() ); // QString dfnName = QString("%1.dfn").arg(extStr.c_str()); // UFormDfn *formdfn; - // if (NLMISC::CPath::exists(dfnName.toStdString())) + // if (NLMISC::CPath::exists(dfnName.toUtf8())) // { - // formdfn = _georges->loadFormDfn (dfnName.toStdString()); + // formdfn = _georges->loadFormDfn (dfnName.toUtf8()); // if (!formdfn) // { - // nlwarning("Failed to load dfn: %s", dfnName.toStdString().c_str()); + // nlwarning("Failed to load dfn: %s", dfnName.toUtf8()); // return 0; // } // } // else // { - // nlwarning("Cannot find dfn: %s", dfnName.toStdString().c_str()); + // nlwarning("Cannot find dfn: %s", dfnName.toUtf8()); // return 0; // } @@ -156,20 +156,20 @@ namespace GeorgesQt // } // return form; //} - nlinfo("File '%s' does not exist!", formName.toStdString().c_str()); + nlinfo("File '%s' does not exist!", formName.toUtf8().constData()); return 0; } NLGEORGES::CForm* CGeorgesTreeViewDialog::getFormByDfnName(const QString dfnName) { - if(NLMISC::CPath::exists(dfnName.toStdString())) + if(NLMISC::CPath::exists(dfnName.toUtf8().constData())) { // Create a new form object. NLGEORGES::CForm *form = new NLGEORGES::CForm(); m_form = form; // Retrieve a copy of the root definition. - NLGEORGES::CFormDfn *formDfn = dynamic_cast(m_georges->loadFormDfn(dfnName.toStdString())); + NLGEORGES::CFormDfn *formDfn = dynamic_cast(m_georges->loadFormDfn(dfnName.toUtf8().constData())); // Next we'll use the root node to build a new form. NLGEORGES::CFormElmStruct *fes = dynamic_cast(getRootNode(0)); @@ -184,7 +184,7 @@ namespace GeorgesQt return form; } - nlinfo("File '%s' does not exist!", dfnName.toStdString().c_str()); + nlinfo("File '%s' does not exist!", dfnName.toUtf8().constData()); return NULL; } @@ -250,7 +250,7 @@ namespace GeorgesQt nlinfo("typ's %d",deps["typ"].count()); nlinfo("dfn's %d",deps["dfn"].count()); - //nlwarning(strList.join(";").toStdString().c_str()); + //nlwarning(strList.join(";").toUtf8()); if (root) { loadedForm = m_form->getFilename().c_str(); @@ -277,7 +277,7 @@ namespace GeorgesQt void CGeorgesTreeViewDialog::addParentForm(QString parentFormNm) { // Try to load the form - NLGEORGES::UForm *uParentForm = m_georges->loadForm(parentFormNm.toStdString()); + NLGEORGES::UForm *uParentForm = m_georges->loadForm(parentFormNm.toUtf8().constData()); NLGEORGES::CForm *parentForm = dynamic_cast(uParentForm); NLGEORGES::CForm *mainForm = static_cast(m_form); @@ -292,11 +292,11 @@ namespace GeorgesQt if (parentForm->Elements.FormDfn == mainForm->Elements.FormDfn) { // This is the parent form selector - if(!mainForm->insertParent(mainForm->getParentCount(),parentFormNm.toStdString().c_str(), parentForm)) - nlwarning("Failed to add parent form: %s", parentFormNm.toStdString().c_str()); + if(!mainForm->insertParent(mainForm->getParentCount(),parentFormNm.toUtf8(), parentForm)) + nlwarning("Failed to add parent form: %s", parentFormNm.toUtf8().constData()); else { - nlinfo("Successfullyadded parent form: %s", parentFormNm.toStdString().c_str()); + nlinfo("Successfullyadded parent form: %s", parentFormNm.toUtf8().constData()); model->addParentForm(parentFormNm); } } @@ -318,7 +318,7 @@ namespace GeorgesQt { NLMISC::COFile file; - std::string s = NLMISC::CPath::lookup(loadedForm.toStdString(), false); + std::string s = NLMISC::CPath::lookup(loadedForm.toUtf8().constData(), false); if(file.open (s)) { try @@ -406,7 +406,7 @@ namespace GeorgesQt if (item->parent() && item->parent()->data(0) == "parents") { - Q_EMIT changeFile(CPath::lookup(item->data(0).toString().toStdString(),false).c_str()); + Q_EMIT changeFile(CPath::lookup(item->data(0).toString().toUtf8().constData(),false).c_str()); } //// col containing additional stuff like icons @@ -416,7 +416,7 @@ namespace GeorgesQt // CFormItem *item = m->getItem(in2); // QString value = item->data(1).toString(); - // QString path = CPath::lookup(value.toStdString(),false).c_str(); + // QString path = CPath::lookup(value.toUtf8(),false).c_str(); // if(value.contains(".tga") || value.contains(".png")) // { @@ -444,7 +444,7 @@ namespace GeorgesQt // { // Modules::objViewInt()->resetScene(); // //Modules::config().configRemapExtensions(); - // Modules::objViewInt()->loadMesh(path.toStdString(),""); + // Modules::objViewInt()->loadMesh(path.toUtf8(),""); // } // return; // } @@ -551,7 +551,7 @@ namespace GeorgesQt file = file.remove(0,file.indexOf(".")+1); QString filePattern = "Parent Sheets (*."+file+")"; - nlinfo("parent defn name '%s'", file.toStdString().c_str()); + nlinfo("parent defn name '%s'", file.toUtf8().constData()); QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Select parent sheets..."), m_lastSheetDir, filePattern); if(!fileNames.isEmpty()) { @@ -561,7 +561,7 @@ namespace GeorgesQt QFileInfo pathInfo( fileToParent ); QString tmpFileName( pathInfo.fileName() ); - nlinfo("requesting to add parent form '%s'", tmpFileName.toStdString().c_str()); + nlinfo("requesting to add parent form '%s'", tmpFileName.toUtf8().constData()); // Call to add the form and load it into the Georges form. addParentForm(tmpFileName); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_model.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_model.cpp index 9e3f97c48..83548c7d3 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_model.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_model.cpp @@ -140,13 +140,13 @@ namespace GeorgesQt CFormItem *item = getItem(in); QString value = item->data(1).toString(); - //QString path = NLMISC::CPath::lookup(value.toStdString(),false).c_str(); + //QString path = NLMISC::CPath::lookup(value.toUtf8().constData(),false).c_str(); /*if (value.contains(".shape")) { if (Modules::objViewInt()) { - QIcon *icon = Modules::objViewInt()->saveOneImage(value.toStdString()); + QIcon *icon = Modules::objViewInt()->saveOneImage(value.toUtf8().constData()); if (icon) { if(icon->isNull()) @@ -162,7 +162,7 @@ namespace GeorgesQt }*/ if(value.contains(".tga") || value.contains(".png")) { - QString path = NLMISC::CPath::lookup(value.toStdString(),false).c_str(); + QString path = NLMISC::CPath::lookup(value.toUtf8().constData(),false).c_str(); if(path.isEmpty()) { path = ":/images/pqrticles.png"; @@ -185,7 +185,7 @@ namespace GeorgesQt { if (Modules::objViewInt()) { - QIcon *icon = Modules::objViewInt()->saveOneImage(value.toStdString()); + QIcon *icon = Modules::objViewInt()->saveOneImage(value.toUtf8().constData()); if (icon) { if(icon->isNull()) @@ -201,7 +201,7 @@ namespace GeorgesQt }*/ if(value.contains(".tga") || value.contains(".png")) { - QString path = NLMISC::CPath::lookup(value.toStdString(),false).c_str(); + QString path = NLMISC::CPath::lookup(value.toUtf8().constData(),false).c_str(); if(path.isEmpty()) { path = ":/images/pqrticles.png"; @@ -428,13 +428,13 @@ namespace GeorgesQt switch (type->getType()) { case UType::UnsignedInt: - value = QString("%1").arg(QString("%1").arg(value.c_str()).toDouble()).toStdString(); + value = QString("%1").arg(QString("%1").arg(value.c_str()).toDouble()).toUtf8(); elmtType.append("_uint");break; case UType::SignedInt: - value = QString("%1").arg(QString("%1").arg(value.c_str()).toDouble()).toStdString(); + value = QString("%1").arg(QString("%1").arg(value.c_str()).toDouble()).toUtf8(); elmtType.append("_sint");break; case UType::Double: - value = QString("%1").arg(QString("%1").arg(value.c_str()).toDouble(),0,'f',1).toStdString(); + value = QString("%1").arg(QString("%1").arg(value.c_str()).toDouble(),0,'f',1).toUtf8(); elmtType.append("_double");break; case UType::String: elmtType.append("_string");break; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp index 0c791aa7c..e01f5f617 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp @@ -239,11 +239,11 @@ void MissionCompilerMainWindow::compileMission(bool publish) try { CMissionCompiler mc; - mc.compileMissions(primDoc.RootNode, filename.toStdString()); + mc.compileMissions(primDoc.RootNode, filename.toUtf8().constData()); m_compileLog.append("Found "+QString::number(mc.getMissionsCount())+" valid missions\n"); updateCompileLog(); - mc.installCompiledMission(m_ligoConfig, filename.toStdString()); + mc.installCompiledMission(m_ligoConfig, filename.toUtf8().constData()); nbMission += mc.getMissionsCount(); // publish files to selected servers @@ -296,7 +296,7 @@ void MissionCompilerMainWindow::compileMission(bool publish) { m_compileLog.append(" "+QString(NLMISC::CFile::getFilename(mc.getFileToPublish(j)).c_str())+"\n"); } - mc.publishFiles(primPath.toStdString(), textPath.toStdString(), localPath.toStdString()); + mc.publishFiles(primPath.toUtf8().constData(), textPath.toUtf8().constData(), localPath.toUtf8().constData()); } column++; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_dialog.cpp index 0ff05e5dd..01f4c434b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_dialog.cpp @@ -90,7 +90,7 @@ void CAnimationDialog::setCurrentShape(const QString &name) { if (name.isEmpty()) return; - CEntity &entity = Modules::objView().getEntity(name.toStdString()); + CEntity &entity = Modules::objView().getEntity(name.toUtf8().constData()); _ui.inPlaceCheckBox->setChecked(entity.getInPlace()); _ui.incPosCheckBox->setChecked(entity.getIncPos()); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_set_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_set_dialog.cpp index fa779d63a..f73aa4055 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_set_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_set_dialog.cpp @@ -57,7 +57,7 @@ void CAnimationSetDialog::setCurrentShape(const QString &name) if (name.isEmpty()) return; - Modules::objView().setCurrentObject(name.toStdString()); + Modules::objView().setCurrentObject(name.toUtf8().constData()); updateListAnim(); @@ -161,7 +161,7 @@ void CAnimationSetDialog::loadAnim() QStringList::Iterator it = list.begin(); while(it != list.end()) { - std::string animName = it->toStdString(); + std::string animName = it->toUtf8(); entity.loadAnimation(animName); ++it; } @@ -187,7 +187,7 @@ void CAnimationSetDialog::loadSwt() QStringList::Iterator it = list.begin(); while(it != list.end()) { - std::string swtName = it->toStdString(); + std::string swtName = it->toUtf8(); entity.loadSWT(swtName); ++it; } @@ -212,7 +212,7 @@ void CAnimationSetDialog::addAnim() Q_FOREACH(QTreeWidgetItem *item, list) { - std::string animName = item->text(0).toStdString(); + std::string animName = item->text(0).toUtf8(); entity.addAnimToPlayList(animName); ui.animPlaylistWidget->addItem(item->text(0)); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.cpp index a65f510c4..2d45f0fb3 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.cpp @@ -449,9 +449,9 @@ bool CMainWindow::loadFile(const QString &fileName, const QString &skelName) QFileInfo fileInfo(fileName); bool loaded; if (fileInfo.suffix() == "ig") - loaded = Modules::objView().loadInstanceGroup(fileName.toStdString()); + loaded = Modules::objView().loadInstanceGroup(fileName.toUtf8().constData()); else - loaded = Modules::objView().loadMesh(fileName.toStdString(), skelName.toStdString()); + loaded = Modules::objView().loadMesh(fileName.toUtf8().constData(), skelName.toUtf8().constData()); if (!loaded) { diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/mesh_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/mesh_widget.cpp index debb0f157..e92ca7e20 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/mesh_widget.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/mesh_widget.cpp @@ -86,10 +86,10 @@ void CMeshWidget::browseShape() setCursor(Qt::WaitCursor); if (!fileName.isEmpty()) { - NLMISC::CPath::addSearchPath(NLMISC::CFile::getPath(fileName.toStdString())); + NLMISC::CPath::addSearchPath(NLMISC::CFile::getPath(fileName.toUtf8().constData())); try { - std::string shapeName = NLMISC::CFile::getFilename(fileName.toStdString()); + std::string shapeName = NLMISC::CFile::getFilename(fileName.toUtf8().constData()); _ShapeParticle->setShape(shapeName); _ui.meshLineEdit->setText(shapeName.c_str()); touchPSState(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/morph_mesh_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/morph_mesh_dialog.cpp index de88d14c8..b6b1ec14c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/morph_mesh_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/morph_mesh_dialog.cpp @@ -110,7 +110,7 @@ void CMorphMeshDialog::add() shapeNames.resize(_CM->getNumShapes() + 1); _CM->getShapesNames(&shapeNames[0]); uint index = (uint)shapeNames.size() - 1; - shapeNames[index] = fileName.toStdString(); + shapeNames[index] = fileName.toUtf8(); _CM->setShapes(&shapeNames[0], (uint)shapeNames.size()); std::vector numVerts; _CM->getShapeNumVerts(numVerts); @@ -152,7 +152,7 @@ void CMorphMeshDialog::insert() std::vector shapeNames; shapeNames.resize(_CM->getNumShapes()); _CM->getShapesNames(&shapeNames[0]); - shapeNames.insert(shapeNames.begin() + row, fileName.toStdString()); + shapeNames.insert(shapeNames.begin() + row, fileName.toUtf8().constData()); _CM->setShapes(&shapeNames[0], (uint)shapeNames.size()); touchPSState(); updateMeshList(); @@ -172,7 +172,7 @@ void CMorphMeshDialog::change() if (!fileName.isEmpty()) { sint row = _ui.listWidget->currentRow(); - _CM->setShape(row, fileName.toStdString()); + _CM->setShape(row, fileName.toUtf8().constData()); updateMeshList(); touchPSState(); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer.cpp index 4b0509018..a07623cde 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer.cpp @@ -468,7 +468,7 @@ void CObjectViewer::loadConfig() #endif _CameraFocal = settings->value("CameraFocal", 75).toInt(); - _FontName = settings->value(Constants::FONT, "andbasr.ttf").toString().toStdString(); + _FontName = settings->value(Constants::FONT, "andbasr.ttf").toString().toUtf8(); _BloomEffect = settings->value(Constants::ENABLE_BLOOM, false).toBool(); _BloomDensity = settings->value(Constants::BLOOM_DENSITY, 0).toInt(); _BloomSquare = settings->value(Constants::ENABLE_SQUARE_BLOOM, false).toBool(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_force_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_force_page.cpp index e7e19abc9..2f9135e3d 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_force_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_force_page.cpp @@ -185,11 +185,11 @@ void CForcePage::setDir(const NLMISC::CVector &value) void CForcePage::setGlobalName(const QString &globalName) { nlassert(_LBTarget); - dynamic_cast(_LBTarget)->enableGlobalVectorValue(globalName.toStdString()); + dynamic_cast(_LBTarget)->enableGlobalVectorValue(globalName.toUtf8().constData()); if (!globalName.isEmpty()) { // take a non NULL value for the direction - NL3D::CParticleSystem::setGlobalVectorValue(globalName.toStdString(), NLMISC::CVector::I); + NL3D::CParticleSystem::setGlobalVectorValue(globalName.toUtf8().constData(), NLMISC::CVector::I); } updateModifiedFlag(); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_sound_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_sound_page.cpp index ce7034e56..ee9e77466 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_sound_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_sound_page.cpp @@ -122,7 +122,7 @@ void CSoundPage::browse() void CSoundPage::play() { - Modules::sound().play(_ui.soundNameLineEdit->text().toStdString()); + Modules::sound().play(_ui.soundNameLineEdit->text().toUtf8().constData()); } void CSoundPage::setSpawn(bool state) @@ -162,7 +162,7 @@ void CSoundPage::setKeepPitch(bool state) void CSoundPage::setSoundName(const QString &text) { - _Sound->setSoundName(NLMISC::CSheetId(text.toStdString())); + _Sound->setSoundName(NLMISC::CSheetId(text.toUtf8().constData())); } void CSoundPage::setEmissionPercent(float value) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system_page.cpp index 072297437..7cdf0895b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system_page.cpp @@ -50,7 +50,7 @@ static void chooseGlobalUserParam(uint userParam, NL3D::CParticleSystem *ps, QWi QString(ps->getGlobalValueName(userParam).c_str()), &ok); if (ok) - ps->bindGlobalValueToUserParam(text.toStdString(), userParam); + ps->bindGlobalValueToUserParam(text.toUtf8().constData(), userParam); } CParticleSystemPage::CParticleSystemPage(QWidget *parent) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_texture_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_texture_widget.cpp index f09e752da..82e171f19 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_texture_widget.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_texture_widget.cpp @@ -76,10 +76,10 @@ void CParticleTextureWidget::chooseTexture() if (!fileName.isEmpty()) { // Add search path for the texture - NLMISC::CPath::addSearchPath(NLMISC::CFile::getPath(fileName.toStdString())); + NLMISC::CPath::addSearchPath(NLMISC::CFile::getPath(fileName.toUtf8().constData())); try { - texName = NLMISC::CFile::getFilename(fileName.toStdString()); + texName = NLMISC::CFile::getFilename(fileName.toUtf8().constData()); NL3D::CTextureFile *tf = new NL3D::CTextureFile(texName); _Wrapper->setAndUpdateModifiedFlag(tf); _Texture = tf; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_tree_model.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_tree_model.cpp index 2daebd6e4..fc284f865 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_tree_model.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_tree_model.cpp @@ -319,7 +319,7 @@ bool CParticleTreeModel::setData(const QModelIndex &index, const QVariant &value QList listData; listData << value; item->replace(listData); - std::string name = value.toString().toStdString(); + std::string name = value.toString().toUtf8(); if (item->itemType() == ItemType::Located) item->getLoc()->setName(name); else diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_dialog.cpp index 74182120c..c006e7066 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_dialog.cpp @@ -348,7 +348,7 @@ void CParticleWorkspaceDialog::saveAsPS() tr("ps files (*.ps)")); // after check if (!fileName.isEmpty()) - node->savePSAs(fileName.toStdString()); + node->savePSAs(fileName.toUtf8().constData()); } } @@ -546,7 +546,7 @@ void CParticleWorkspaceDialog::bindNewLocatedBindable(int id) std::string name = toCreate->getName(); if (_PSElementIdentifiers.count(name)) { - name += (QString("%1").arg(++_PSElementIdentifiers[name])).toStdString(); + name += NLMISC::toString("%u", ++_PSElementIdentifiers[name]); toCreate->setName(name); } else @@ -771,7 +771,7 @@ NL3D::CPSLocated *CParticleWorkspaceDialog::createLocated(NL3D::CParticleSystem // build new name std::string name; if (_PSElementIdentifiers.count(std::string("located"))) - name = (QString("located %1").arg(++_PSElementIdentifiers[std::string("located")])).toStdString(); + name = (QString("located %1").arg(++_PSElementIdentifiers[std::string("located")])).toUtf8(); else { diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_page.cpp index 3f2dd1657..62ffb6d3b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_page.cpp @@ -63,7 +63,7 @@ void CWorkspacePage::newWP() tr("pws files (*.pws)")); if (!fileName.isEmpty()) { - Modules::psEdit().createNewWorkspace(fileName.toStdString()); + Modules::psEdit().createNewWorkspace(fileName.toUtf8().constData()); _treeModel->setupModelFromWorkSpace(); _ui.saveToolButton->setEnabled(true); _ui.saveAsToolButton->setEnabled(true); @@ -83,7 +83,7 @@ void CWorkspacePage::loadWP() setCursor(Qt::WaitCursor); if (!fileName.isEmpty()) { - Modules::psEdit().loadWorkspace(fileName.toStdString()); + Modules::psEdit().loadWorkspace(fileName.toUtf8().constData()); _treeModel->setupModelFromWorkSpace(); _ui.unloadToolButton->setEnabled(true); _ui.saveToolButton->setEnabled(true); @@ -109,7 +109,7 @@ void CWorkspacePage::saveAsWP() tr("pws files (*.pws)")); if (!fileName.isEmpty()) { - Modules::psEdit().getParticleWorkspace()->setFileName(fileName.toStdString()); + Modules::psEdit().getParticleWorkspace()->setFileName(fileName.toUtf8().constData()); Modules::psEdit().saveWorkspaceStructure(); Modules::psEdit().saveWorkspaceContent(); _treeModel->setupModelFromWorkSpace(); @@ -125,7 +125,7 @@ void CWorkspacePage::insertPS() if (!fileName.isEmpty()) { // TODO: create method particle editor insertNewPS and multiple add - CWorkspaceNode *node = Modules::psEdit().getParticleWorkspace()->addNode(NLMISC::CFile::getFilename(fileName.toStdString())); + CWorkspaceNode *node = Modules::psEdit().getParticleWorkspace()->addNode(NLMISC::CFile::getFilename(fileName.toUtf8().constData())); if (node != 0) { try @@ -158,14 +158,14 @@ void CWorkspacePage::createPS() { // TODO: create method particle editor createNewPS - if (Modules::psEdit().getParticleWorkspace()->containsFile(NLMISC::CFile::getFilename(fileName.toStdString()))) + if (Modules::psEdit().getParticleWorkspace()->containsFile(NLMISC::CFile::getFilename(fileName.toUtf8().constData()))) { QMessageBox::critical(this, tr("NeL particle system editor"), tr("Failed to create new particle system"), QMessageBox::Ok); return; } - CWorkspaceNode *node = Modules::psEdit().getParticleWorkspace()->addNode(NLMISC::CFile::getFilename(fileName.toStdString())); + CWorkspaceNode *node = Modules::psEdit().getParticleWorkspace()->addNode(NLMISC::CFile::getFilename(fileName.toUtf8().constData())); // should always succeed because we tested if file already exists nlassert(node); node->createEmptyPS(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scheme_bank_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scheme_bank_dialog.cpp index bca0f4879..af8a4829f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scheme_bank_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scheme_bank_dialog.cpp @@ -61,7 +61,7 @@ void CSchemeBankDialog::createScheme() if (ok && !text.isEmpty()) { NL3D::CPSAttribMakerBase *attribMakerBase = _attribWidget->getCurrentSchemePtr()->clone(); - Modules::psEdit().getSchemeManager()->insertScheme(text.toStdString(), attribMakerBase); + Modules::psEdit().getSchemeManager()->insertScheme(text.toUtf8().constData(), attribMakerBase); CSchemeItem *item = new CSchemeItem(text, _ui.listWidget); item->setUserData(attribMakerBase); @@ -108,7 +108,7 @@ void CSchemeBankDialog::saveBank() try { NLMISC::COFile iF; - iF.open(fileName.toStdString()); + iF.open(fileName.toUtf8().constData()); NLQT::CSchemeManager *schemeManager = Modules::psEdit().getSchemeManager(); iF.serial(*schemeManager); } @@ -132,7 +132,7 @@ void CSchemeBankDialog::loadBank() try { NLMISC::CIFile iF; - iF.open(fileName.toStdString()); + iF.open(fileName.toUtf8().constData()); iF.serial(sm); Modules::psEdit().getSchemeManager()->swap(sm); } @@ -152,7 +152,7 @@ void CSchemeBankDialog::changeNameScheme(QListWidgetItem *item) NL3D::CPSAttribMakerBase *attrib = schemeItem->getUserData(); nlassert(attrib); - Modules::psEdit().getSchemeManager()->rename(attrib, item->text().toStdString()); + Modules::psEdit().getSchemeManager()->rename(attrib, item->text().toUtf8().constData()); } void CSchemeBankDialog::enableButtons() diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/skeleton_scale_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/skeleton_scale_dialog.cpp index a4221279e..2d1d92dd1 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/skeleton_scale_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/skeleton_scale_dialog.cpp @@ -93,8 +93,8 @@ void CSkeletonScaleDialog::setCurrentShape(const QString &name) if (name.isEmpty()) return; - _Skeleton = Modules::objView().getEntity(name.toStdString()).getSkeleton(); - _SkeletonFileName = Modules::objView().getEntity(name.toStdString()).getFileNameSkeleton(); + _Skeleton = Modules::objView().getEntity(name.toUtf8().constData()).getSkeleton(); + _SkeletonFileName = Modules::objView().getEntity(name.toUtf8().constData()).getFileNameSkeleton(); // Setup Bone mirror _Bones.clear(); @@ -290,7 +290,7 @@ void CSkeletonScaleDialog::clickSaveAsSkel() { NLMISC::COFile f; - if( f.open(fileName.toStdString()) ) + if( f.open(fileName.toUtf8().constData()) ) { if(saveCurrentInStream(f)) { @@ -300,7 +300,7 @@ void CSkeletonScaleDialog::clickSaveAsSkel() } // bkup the valid fileName (new file edited) - _SkeletonFileName = fileName.toStdString(); + _SkeletonFileName = fileName.toUtf8(); } else { @@ -324,7 +324,7 @@ void CSkeletonScaleDialog::clickLoadScale() if (!fileName.isEmpty()) { NLMISC::CIFile f; - if( f.open(fileName.toStdString()) ) + if( f.open(fileName.toUtf8().constData()) ) loadSkelScaleFromStream(f); else QMessageBox::critical(this, tr("Skeleton scale editor"), tr("Failed to open file for read!"), QMessageBox::Ok); @@ -345,7 +345,7 @@ void CSkeletonScaleDialog::clickSaveScale() if (!fileName.isEmpty()) { NLMISC::COFile f; - if( f.open(fileName.toStdString()) ) + if( f.open(fileName.toUtf8().constData()) ) saveSkelScaleInStream(f); else QMessageBox::critical(this, tr("Skeleton scale editor"), tr("Failed to open file for write!"), QMessageBox::Ok); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/slot_manager_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/slot_manager_dialog.cpp index d5fc6f42b..e9c23779a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/slot_manager_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/slot_manager_dialog.cpp @@ -111,8 +111,8 @@ void CSlotGroupBox::updateUi() void CSlotGroupBox::saveSlotInfo() { CSlotInfo slotInfo; - slotInfo.Animation = _animName.toStdString(); - slotInfo.Skeleton = _skelName.toStdString(); + slotInfo.Animation = _animName.toUtf8(); + slotInfo.Skeleton = _skelName.toUtf8(); slotInfo.EndBlend = _ui.endBlendSpinBox->value(); slotInfo.EndTime = float(_ui.endFrameSpinBox->value()) / Modules::mainWin().getFrameRate(); slotInfo.Offset = float(_ui.offsetSpinBox->value()) / Modules::mainWin().getFrameRate(); @@ -182,7 +182,7 @@ void CSlotGroupBox::selectAnim() _animName = item; QString title = tr("Slot %1 : ").arg(_numSlot) + _animName + " : " + _skelName; this->setTitle(title); - _ui.endFrameSpinBox->setValue(int(entity.getAnimLength(_animName.toStdString()) * Modules::mainWin().getFrameRate())); + _ui.endFrameSpinBox->setValue(int(entity.getAnimLength(_animName.toUtf8().constData()) * Modules::mainWin().getFrameRate())); saveSlotInfo(); } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_system.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_system.cpp index 5ca313b0f..361b0100c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_system.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_system.cpp @@ -86,12 +86,12 @@ void CSoundSystem::init() QSettings *settings = Core::ICore::instance()->settings(); settings->beginGroup(Constants::OBJECT_VIEWER_SECTION); - _PackedSheetPath = settings->value(Constants::SOUND_PACKED_SHEET_PATH, "").toString().toStdString(); - _SamplePath = settings->value(Constants::SOUND_SAMPLE_PATH, "").toString().toStdString(); + _PackedSheetPath = settings->value(Constants::SOUND_PACKED_SHEET_PATH, "").toString().toUtf8(); + _SamplePath = settings->value(Constants::SOUND_SAMPLE_PATH, "").toString().toUtf8(); _AudioMixer->setSamplePath(_SamplePath); _AudioMixer->setPackedSheetOption(_PackedSheetPath, true); std::vector devices; - _AudioMixer->initDriver(settings->value(Constants::SOUND_DRIVER, "Auto").toString().toStdString()); + _AudioMixer->initDriver(settings->value(Constants::SOUND_DRIVER, "Auto").toString().toUtf8().constData()); _AudioMixer->getDevices(devices); NLSOUND::UAudioMixer::CInitInfo audioInfo; audioInfo.AutoLoadSample = settings->value(Constants::SOUND_AUTO_LOAD_SAMPLE, true).toBool(); @@ -101,7 +101,7 @@ void CSoundSystem::init() audioInfo.ForceSoftware = settings->value(Constants::SOUND_FORCE_SOFTWARE, false).toBool(); audioInfo.MaxTrack = settings->value(Constants::SOUND_MAX_TRACK, 48).toInt(); audioInfo.UseADPCM = settings->value(Constants::SOUND_USE_ADCPM, false).toBool(); - _AudioMixer->initDevice(settings->value(Constants::SOUND_DEVICE, "").toString().toStdString(), audioInfo, NULL); + _AudioMixer->initDevice(settings->value(Constants::SOUND_DEVICE, "").toString().toUtf8().constData(), audioInfo, NULL); _AudioMixer->setLowWaterMark(1); settings->endGroup(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_density_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_density_page.cpp index 04d42828f..ba70b4c9f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_density_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_density_page.cpp @@ -145,13 +145,13 @@ void CVegetableDensityPage::browseShapeVeget() if (!fileName.isEmpty()) { // Add search path for the .veget - NLMISC::CPath::addSearchPath (NLMISC::CFile::getPath(fileName.toStdString())); + NLMISC::CPath::addSearchPath (NLMISC::CFile::getPath(fileName.toUtf8().constData())); try { // update shapeName and view - _Vegetable->ShapeName = NLMISC::CFile::getFilename(fileName.toStdString()); - _ui.meshLineEdit->setText(QString(NLMISC::CFile::getFilename(fileName.toStdString()).c_str())); + _Vegetable->ShapeName = NLMISC::CFile::getFilename(fileName.toUtf8().constData()); + _ui.meshLineEdit->setText(QString::fromUtf8(_Vegetable->ShapeName.c_str())); // update the name in the list-box Q_EMIT vegetNameChanged(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_dialog.cpp index ed7271e66..2fc621411 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_dialog.cpp @@ -68,7 +68,7 @@ void CVegetableDialog::loadVegetset() { NL3D::CTileVegetableDesc vegetSet; // if succes to load the vegetSet - if(Modules::veget().loadVegetableSet(vegetSet, fileName.toStdString())) + if(Modules::veget().loadVegetableSet(vegetSet, fileName.toUtf8().constData())) { // Delete all vegetables. Modules::veget().clearVegetables(); @@ -94,7 +94,7 @@ void CVegetableDialog::appendVegetset() { NL3D::CTileVegetableDesc vegetSet; // if succes to load the vegetSet - if(Modules::veget().loadVegetableSet(vegetSet, fileName.toStdString())) + if(Modules::veget().loadVegetableSet(vegetSet, fileName.toUtf8().constData())) { // Do not Delete any vegetables. // build them from list. @@ -124,7 +124,7 @@ void CVegetableDialog::saveVegetset() { NLMISC::COFile f; - if( f.open(fileName.toStdString()) ) + if( f.open(fileName.toUtf8().constData()) ) { try { @@ -226,7 +226,7 @@ void CVegetableDialog::loadVegetdesc() { NLMISC::CIFile f; - if( f.open(fileName.toStdString()) ) + if( f.open(fileName.toUtf8().constData()) ) { NL3D::CVegetable veget; try @@ -272,7 +272,7 @@ void CVegetableDialog::saveVegetdesc() { NLMISC::COFile f; - if( f.open(fileName.toStdString()) ) + if( f.open(fileName.toUtf8().constData()) ) { try { diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_editor.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_editor.cpp index b6a3b89dc..cdd311302 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_editor.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_editor.cpp @@ -596,15 +596,15 @@ void CVegetableEditor::loadLandscapeSetup() QSettings *settings = Core::ICore::instance()->settings(); settings->beginGroup(Constants::OBJECT_VIEWER_SECTION); - _VegetableLandscapeTileBank = settings->value(Constants::VEGET_TILE_BANK, "").toString().toStdString(); - _VegetableLandscapeTileFarBank = settings->value(Constants::VEGET_TILE_FAR_BANK, "").toString().toStdString(); - _CoarseMeshTexture = settings->value(Constants::COARSE_MESH_TEXTURE, "").toString().toStdString(); - _VegetableTexture = settings->value(Constants::VEGET_TEXTURE, "").toString().toStdString(); + _VegetableLandscapeTileBank = settings->value(Constants::VEGET_TILE_BANK, "").toString().toUtf8(); + _VegetableLandscapeTileFarBank = settings->value(Constants::VEGET_TILE_FAR_BANK, "").toString().toUtf8(); + _CoarseMeshTexture = settings->value(Constants::COARSE_MESH_TEXTURE, "").toString().toUtf8(); + _VegetableTexture = settings->value(Constants::VEGET_TEXTURE, "").toString().toUtf8(); QStringList list = settings->value(Constants::VEGET_LANDSCAPE_ZONES).toStringList(); _VegetableLandscapeZoneNames.clear(); for (int i = 0; i < list.size(); ++i) - _VegetableLandscapeZoneNames.push_back(list[i].toStdString()); + _VegetableLandscapeZoneNames.push_back(list[i].toUtf8().constData()); settings->endGroup(); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/sheetbuilderdialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/sheetbuilderdialog.cpp index 69e5da30e..c999daa17 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/sheetbuilderdialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/sheetbuilderdialog.cpp @@ -119,7 +119,7 @@ void SheetBuilderDialog::buildSheet() bool clean = chckClean->isChecked(); - string outputFileName(outputFile.toStdString()); + string outputFileName(outputFile.toUtf8()); if (outputFileName.empty()) { @@ -129,11 +129,11 @@ void SheetBuilderDialog::buildSheet() list inputDirs; Q_FOREACH (QString str, paths) - inputDirs.push_back(str.toStdString()); + inputDirs.push_back(str.toUtf8().constData()); Q_FOREACH (QString str, extensions) { - ExtensionsAllowed.insert(str.toStdString()); + ExtensionsAllowed.insert(str.toUtf8().constData()); } // get the current associations (read the sheet_id and fill the working structures) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/editor_phrase.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/editor_phrase.cpp index 805e2361d..01ec90fe1 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/editor_phrase.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/editor_phrase.cpp @@ -40,7 +40,7 @@ namespace TranslationManager void CEditorPhrase::open(QString filename) { std::vector phrases; - if(readPhraseFile(filename.toStdString(), phrases, false)) + if(readPhraseFile(filename.toUtf8().constData(), phrases, false)) { text_edit = new CTextEdit(this); text_edit->setUndoStack(current_stack); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/editor_worksheet.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/editor_worksheet.cpp index f9b216da6..9df0655ac 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/editor_worksheet.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/editor_worksheet.cpp @@ -37,7 +37,7 @@ namespace TranslationManager void CEditorWorksheet::open(QString filename) { STRING_MANAGER::TWorksheet wk_file; - if(loadExcelSheet(filename.toStdString(), wk_file, true) == true) + if(loadExcelSheet(filename.toUtf8().constData(), wk_file, true) == true) { bool hasHashValue = false; table_editor = new QTableWidget(); @@ -149,7 +149,7 @@ void CEditorWorksheet::save() void CEditorWorksheet::saveAs(QString filename) { STRING_MANAGER::TWorksheet new_file, wk_file; - loadExcelSheet(current_file.toStdString(), wk_file, true); + loadExcelSheet(current_file.toUtf8().constData(), wk_file, true); // set columns new_file.resize(new_file.size() + 1); for(unsigned int i = 0; i < wk_file.ColCount; i++) @@ -185,7 +185,7 @@ void CEditorWorksheet::saveAs(QString filename) makeHashCode(wk_file, true); } ucstring s = prepareExcelSheet(new_file); - NLMISC::CI18N::writeTextFile(filename.toStdString(), s, false); + NLMISC::CI18N::writeTextFile(filename.toUtf8().constData(), s, false); current_file = filename; setCurrentFile(filename); } @@ -299,29 +299,29 @@ void CEditorWorksheet::extractWords(QString filename, QString columnId, IWordLis // **** Load the excel sheet // load STRING_MANAGER::TWorksheet workSheet; - if(!loadExcelSheet(filename.toStdString(), workSheet, true)) + if(!loadExcelSheet(filename.toUtf8().constData(), workSheet, true)) { - nlwarning("Error reading '%s'. Aborted", filename.toStdString().c_str()); + nlwarning("Error reading '%s'. Aborted", filename.toUtf8().constData()); return; } // get the key column index uint keyColIndex = 0; - if(!workSheet.findCol(columnId.toStdString(), keyColIndex)) + if(!workSheet.findCol(ucstring(columnId.toUtf8().constData()), keyColIndex)) { - nlwarning("Error: Don't find the column '%s'. '%s' Aborted", columnId.toStdString().c_str(), filename.toStdString().c_str()); + nlwarning("Error: Don't find the column '%s'. '%s' Aborted", columnId.toUtf8().constData(), filename.toUtf8().constData()); return; } // get the name column index uint nameColIndex; if(!workSheet.findCol(ucstring("name"), nameColIndex)) { - nlwarning("Error: Don't find the column 'name'. '%s' Aborted", filename.toStdString().c_str()); + nlwarning("Error: Don't find the column 'name'. '%s' Aborted", filename.toUtf8().constData()); return; } // **** List all words with the builder given std::vector allWords; - if(!wordListBuilder.buildWordList(allWords, filename.toStdString())) + if(!wordListBuilder.buildWordList(allWords, filename.toUtf8().constData())) { return; } @@ -380,7 +380,7 @@ bool CEditorWorksheet::compareWorksheetFile(QString filename) { STRING_MANAGER::TWorksheet wk_file; int colIndex = 0; - if(loadExcelSheet(filename.toStdString(), wk_file, true) == true) + if(loadExcelSheet(filename.toUtf8().constData(), wk_file, true) == true) { if(wk_file.getData(0, 0) == ucstring("*HASH_VALUE")) { @@ -392,11 +392,12 @@ bool CEditorWorksheet::compareWorksheetFile(QString filename) } for(int i = 0; i < table_editor->columnCount(); i++) { - QString item = table_editor->horizontalHeaderItem(i)->text(); + ucstring item; + item.fromUtf8(table_editor->horizontalHeaderItem(i)->text().toUtf8().constData()); ucstring itemC = wk_file.getData(0, i+ colIndex); - if(item.toStdString() != itemC.toString()) + if(item != itemC) { - nlwarning(item.toStdString().c_str()); + nlwarning(item.toString().c_str()); nlwarning(itemC.toString().c_str()); return false; } @@ -412,7 +413,7 @@ bool CEditorWorksheet::compareWorksheetFile(QString filename) void CEditorWorksheet::mergeWorksheetFile(QString filename) { STRING_MANAGER::TWorksheet wk_file; - if(loadExcelSheet(filename.toStdString(), wk_file, true) == true) + if(loadExcelSheet(filename.toUtf8().constData(), wk_file, true) == true) { bool hasHashValue = false; int colIndex = 0; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_main_window.cpp index 306c30ea9..6da8bba7b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_main_window.cpp @@ -300,8 +300,8 @@ void CMainWindow::initializeSettings(bool georges = false) { if(georges == true && initialize_settings["georges"] == false) { - NLMISC::CPath::addSearchPath(level_design_path.toStdString() + "/DFN", true, false); - NLMISC::CPath::addSearchPath(level_design_path.toStdString() + "/Game_elem/Creature", true, false); + NLMISC::CPath::addSearchPath(std::string(level_design_path.toUtf8().constData()) + "/DFN", true, false); + NLMISC::CPath::addSearchPath(std::string(level_design_path.toUtf8().constData()) + "/Game_elem/Creature", true, false); initialize_settings["georges"] = true; } @@ -357,34 +357,34 @@ void CMainWindow::extractWords(QString typeq) { column_name = "item ID"; builderS.SheetExt = "sitem"; - builderS.SheetPath = level_design_path.append("/game_element/sitem").toStdString(); + builderS.SheetPath = level_design_path.append("/game_element/sitem").toUtf8(); isSheet = true; } else if(typeq.toAscii() == Constants::WK_CREATURE) { column_name = "creature ID"; builderS.SheetExt = "creature"; - builderS.SheetPath = level_design_path.append("/Game_elem/Creature/fauna").toStdString(); + builderS.SheetPath = level_design_path.append("/Game_elem/Creature/fauna").toUtf8(); isSheet = true; } else if(typeq.toAscii() == Constants::WK_SBRICK) { column_name = "sbrick ID"; builderS.SheetExt = "sbrick"; - builderS.SheetPath = level_design_path.append("/game_element/sbrick").toStdString(); + builderS.SheetPath = level_design_path.append("/game_element/sbrick").toUtf8(); isSheet = true; } else if(typeq.toAscii() == Constants::WK_SPHRASE) { column_name = "sphrase ID"; builderS.SheetExt = "sphrase"; - builderS.SheetPath = level_design_path.append("/game_element/sphrase").toStdString(); + builderS.SheetPath = level_design_path.append("/game_element/sphrase").toUtf8(); isSheet = true; } else if(typeq.toAscii() == Constants::WK_PLACE) { column_name = "placeId"; - builderP.PrimPath = primitives_path.toStdString(); + builderP.PrimPath = primitives_path.toUtf8(); builderP.PrimFilter.push_back("region_*.primitive"); builderP.PrimFilter.push_back("indoors_*.primitive"); isSheet = false; @@ -428,7 +428,7 @@ void CMainWindow::extractBotNames() QApplication::setOverrideCursor(Qt::WaitCursor); initializeSettings(true); - editor_window->extractBotNames(convertQStringList(filters), level_design_path.toStdString(), ligoConfig); + editor_window->extractBotNames(convertQStringList(filters), level_design_path.toUtf8().constData(), ligoConfig); QApplication::restoreOverrideCursor(); } } @@ -627,7 +627,7 @@ std::list CMainWindow::convertQStringList(QStringList listq) Q_FOREACH(QString text, listq) { - stdlist.push_back(text.toStdString()); + stdlist.push_back(text.toUtf8().constData()); } return stdlist; } @@ -635,7 +635,7 @@ std::list CMainWindow::convertQStringList(QStringList listq) bool CMainWindow::isWorksheetEditor(QString filename) { STRING_MANAGER::TWorksheet wk_file; - if(loadExcelSheet(filename.toStdString(), wk_file, true) == true) + if(loadExcelSheet(filename.toUtf8().constData(), wk_file, true) == true) { if(wk_file.ColCount > 1) return true; @@ -646,7 +646,7 @@ bool CMainWindow::isWorksheetEditor(QString filename) bool CMainWindow::isPhraseEditor(QString filename) { vector phrases; - return readPhraseFile(filename.toStdString(), phrases, false); + return readPhraseFile(filename.toUtf8().constData(), phrases, false); } } /* namespace TranslationManager */ diff --git a/code/nel/tools/3d/tile_edit_qt/tile_browser_dlg.cpp b/code/nel/tools/3d/tile_edit_qt/tile_browser_dlg.cpp index 8c9dc7598..037ac65e8 100644 --- a/code/nel/tools/3d/tile_edit_qt/tile_browser_dlg.cpp +++ b/code/nel/tools/3d/tile_edit_qt/tile_browser_dlg.cpp @@ -235,7 +235,7 @@ void CTile_browser_dlg::on_actionAddTile_triggered(bool checked) { tileId = browserModel.addTile128 (); fileName = QDir::toNativeSeparators(fileNames.at(i)); - if ( ! browserModel.setTile128 ( tileId, fileName.toStdString(), (CTile::TBitmap) tileTextureButtonGroup->checkedId()) ) + if ( ! browserModel.setTile128 ( tileId, fileName.toUtf8().constData(), (CTile::TBitmap) tileTextureButtonGroup->checkedId()) ) { browserModel.removeTile128 (tileId); break; @@ -247,7 +247,7 @@ void CTile_browser_dlg::on_actionAddTile_triggered(bool checked) { tileId = browserModel.addTile256 (); fileName = QDir::toNativeSeparators(fileNames.at(i)); - if ( ! browserModel.setTile256 ( tileId, fileName.toStdString(), (CTile::TBitmap) tileTextureButtonGroup->checkedId()) ) + if ( ! browserModel.setTile256 ( tileId, fileName.toUtf8().constData(), (CTile::TBitmap) tileTextureButtonGroup->checkedId()) ) { browserModel.removeTile256 (tileId); break; @@ -307,7 +307,7 @@ void CTile_browser_dlg::on_actionReplaceImage_triggered(bool checked) { int tileId = (ui.tileBrowserListView->selectionModel()->selectedRows().at(i).data(Qt::UserRole + 1)).toInt(); - if ( ! browserModel.setTile128 ( tileId, fileName.toStdString(), (CTile::TBitmap) tileTextureButtonGroup->checkedId()) ) + if ( ! browserModel.setTile128 ( tileId, fileName.toUtf8().constData(), (CTile::TBitmap) tileTextureButtonGroup->checkedId()) ) break; } break; @@ -315,7 +315,7 @@ void CTile_browser_dlg::on_actionReplaceImage_triggered(bool checked) for (int i=0; iselectionModel()->selectedRows().count(); i++) { int tileId = (ui.tileBrowserListView->selectionModel()->selectedRows().at(i).data(Qt::UserRole + 1)).toInt(); - if ( ! browserModel.setTile256 (tileId, fileName.toStdString(), (CTile::TBitmap) tileTextureButtonGroup->checkedId()) ) + if ( ! browserModel.setTile256 (tileId, fileName.toUtf8().constData(), (CTile::TBitmap) tileTextureButtonGroup->checkedId()) ) break; } break; @@ -325,7 +325,7 @@ void CTile_browser_dlg::on_actionReplaceImage_triggered(bool checked) int tileId = (ui.tileBrowserListView->selectionModel()->selectedRows().at(i).data(Qt::UserRole + 1)).toInt(); if ( tileTextureButtonGroup->checkedId() != Alpha ) { - if ( ! browserModel.setTileTransition (tileId, fileName.toStdString(), (CTile::TBitmap) tileTextureButtonGroup->checkedId()) ) + if ( ! browserModel.setTileTransition (tileId, fileName.toUtf8().constData(), (CTile::TBitmap) tileTextureButtonGroup->checkedId()) ) break; } else @@ -334,7 +334,7 @@ void CTile_browser_dlg::on_actionReplaceImage_triggered(bool checked) int rot = CTile_rotation_dlg::getRotation(this, &rotationOk); if (rotationOk) { - if ( ! browserModel.setTileTransitionAlpha (tileId, fileName.toStdString(), rot) ) + if ( ! browserModel.setTileTransitionAlpha (tileId, fileName.toUtf8().constData(), rot) ) break; } } @@ -344,7 +344,7 @@ void CTile_browser_dlg::on_actionReplaceImage_triggered(bool checked) for (int i=0; iselectionModel()->selectedRows().count(); i++) { int tileId = (ui.tileBrowserListView->selectionModel()->selectedRows().at(i).data(Qt::UserRole + 1)).toInt(); - if ( ! browserModel.setDisplacement (tileId, fileName.toStdString(), (CTile::TBitmap) tileTextureButtonGroup->checkedId()) ) + if ( ! browserModel.setDisplacement (tileId, fileName.toUtf8().constData(), (CTile::TBitmap) tileTextureButtonGroup->checkedId()) ) break; } break; @@ -444,13 +444,13 @@ void CTile_browser_dlg::on_batchLoadPushButton_clicked() QString batchNumber = transitionNumber.rightJustified(2, '0'); QString nextBaseName = baseName + batchNumber; QString nextFileName = QDir::toNativeSeparators(fi.absolutePath()) + QDir::separator() + nextBaseName + QString(".") + fi.suffix(); - FILE *pFile=fopen (nextFileName.toStdString().c_str(), "rb"); + FILE *pFile=fopen (nextFileName.toUtf8().constData(), "rb"); // Close the file and add the tile if opened if (pFile) { fclose (pFile); - ok=browserModel.setTileTransitionAlpha (i, nextFileName.toStdString().c_str(), (4-rot)%4); + ok=browserModel.setTileTransitionAlpha (i, nextFileName.toUtf8().constData(), (4-rot)%4); // End break; @@ -545,7 +545,7 @@ void CTile_browser_dlg::on_exportBorderPushButton_clicked() try { COFile file; - if (file.open (fileName.toStdString().c_str())) + if (file.open (fileName.toUtf8().constData())) { // Export bitmap.writeTGA (file, 32); @@ -594,7 +594,7 @@ void CTile_browser_dlg::on_importBorderPushButton_clicked() try { CIFile file; - if (file.open (fileName.toStdString().c_str())) + if (file.open (fileName.toUtf8().constData())) { // Export bitmap.load (file); diff --git a/code/nel/tools/3d/tile_edit_qt/tile_edit_dlg.cpp b/code/nel/tools/3d/tile_edit_qt/tile_edit_dlg.cpp index 1fdcb1aea..45c5b389c 100644 --- a/code/nel/tools/3d/tile_edit_qt/tile_edit_dlg.cpp +++ b/code/nel/tools/3d/tile_edit_qt/tile_edit_dlg.cpp @@ -103,7 +103,7 @@ void CTile_edit_dlg::on_addLandPushButton_clicked() } else { - tileBank.addLand( text.toStdString() ); + tileBank.addLand( text.toUtf8().constData() ); ui.landListWidget->addItem(text); ui.landListWidget->setCurrentRow(ui.landListWidget->count() - 1); @@ -138,7 +138,7 @@ void CTile_edit_dlg::on_editLandPushButton_clicked() for (int i=0; iaddTileSet( rString.toStdString().c_str() ); + tileBank.getLand(nindex)->addTileSet( rString.toUtf8().constData() ); } } } @@ -176,7 +176,7 @@ void CTile_edit_dlg::on_addTileSetPushButton_clicked() } else { - tileBank.addTileSet( text.toStdString() ); + tileBank.addTileSet( text.toUtf8().constData() ); ui.tileSetListWidget->addItem(text); ui.tileSetListWidget->setCurrentRow(ui.tileSetListWidget->count() - 1); @@ -239,7 +239,7 @@ void CTile_edit_dlg::on_chooseVegetPushButton_clicked() if (!fileName.isEmpty()) { QFileInfo fi(fileName); - tileBank.getTileSet (nindex)->setTileVegetableDescFileName (fi.fileName().toStdString()); + tileBank.getTileSet (nindex)->setTileVegetableDescFileName (fi.fileName().toUtf8().constData()); ui.chooseVegetPushButton->setText(fi.fileName()); } } @@ -347,7 +347,7 @@ void CTile_edit_dlg::on_loadPushButton_clicked() if (!fileName.isEmpty()) { CIFile stream; - if ( stream.open( fileName.toStdString().c_str() ) ) + if ( stream.open( fileName.toUtf8().constData() ) ) { ui.landListWidget->clear(); ui.tileSetListWidget->clear(); @@ -383,7 +383,7 @@ void CTile_edit_dlg::on_loadPushButton_clicked() void CTile_edit_dlg::on_savePushButton_clicked() { - string fullPath = this->mainFile.absoluteFilePath().toStdString(); + string fullPath = this->mainFile.absoluteFilePath().toUtf8(); if ( !fullPath.empty() ) { COFile stream; @@ -411,7 +411,7 @@ void CTile_edit_dlg::on_saveAsPushButton_clicked() ui.savePushButton->setEnabled(true); - string fullPath = this->mainFile.absoluteFilePath().toStdString(); + string fullPath = this->mainFile.absoluteFilePath().toUtf8(); if ( !fullPath.empty() ) { COFile stream; @@ -445,7 +445,7 @@ void CTile_edit_dlg::on_exportPushButton_clicked() copy.cleanUnusedData (); QFileInfo fileInfo(fileName); - string fullPath = fileInfo.absoluteFilePath().toStdString(); + string fullPath = fileInfo.absoluteFilePath().toUtf8(); if ( !fullPath.empty() ) { COFile stream; @@ -524,7 +524,7 @@ void CTile_edit_dlg::on_absolutePathPushButton_clicked() if (bitmapPath!="") { // Check the path - if ( CheckPath( bitmapPath, path.toStdString().c_str() ) == false ) + if ( CheckPath( bitmapPath, path.toUtf8() ) == false ) { // Bad path goodPath=false; @@ -552,7 +552,7 @@ void CTile_edit_dlg::on_absolutePathPushButton_clicked() if (strcmp (bitmapPath, "")!=0) { // Check the path - if (CheckPath( bitmapPath, path.toStdString().c_str() )==false) + if (CheckPath( bitmapPath, path.toUtf8() )==false) { // Bad path goodPath=false; @@ -593,7 +593,7 @@ void CTile_edit_dlg::on_absolutePathPushButton_clicked() if (bitmapPath!="") { // Remove the absolute path - bool res=RemovePath (bitmapPath, path.toStdString().c_str()); + bool res=RemovePath (bitmapPath, path.toUtf8()); nlassert (res); // Set the bitmap @@ -613,7 +613,7 @@ void CTile_edit_dlg::on_absolutePathPushButton_clicked() if (bitmapPath!="") { // Remove the absolute path - bool res=RemovePath (bitmapPath, path.toStdString().c_str()); + bool res=RemovePath (bitmapPath, path.toUtf8()); nlassert (res); // Set the bitmap @@ -633,7 +633,7 @@ void CTile_edit_dlg::on_absolutePathPushButton_clicked() if (goodPath) { // Change the abs path of the bank - tileBank.setAbsPath (path.toStdString()); + tileBank.setAbsPath (path.toUtf8().constData()); // Change the bouton text ui.absolutePathPushButton->setText(path); diff --git a/code/nel/tools/misc/words_dic_qt/words_dicDlg.cpp b/code/nel/tools/misc/words_dic_qt/words_dicDlg.cpp index acbebd611..683755ae6 100644 --- a/code/nel/tools/misc/words_dic_qt/words_dicDlg.cpp +++ b/code/nel/tools/misc/words_dic_qt/words_dicDlg.cpp @@ -151,7 +151,7 @@ void CWords_dicDlg::on_findButton_clicked() { QString inputStr = ui.lookUpEdit->text(); bool showAll = ui.showAllCheckBox->isChecked(); - lookUp( inputStr.toStdString(), showAll ); + lookUp( inputStr.toUtf8().constData(), showAll ); } void CWords_dicDlg::on_lookUpEdit_textChanged() @@ -191,7 +191,7 @@ void CWords_dicDlg::on_fileListButton_clicked() void CWords_dicDlg::on_resultsListWidget_itemSelectionChanged() { QListWidgetItem *i = ui.resultsListWidget->currentItem(); - copyIntoClipboard( i->text().toStdString() ); + copyIntoClipboard( i->text().toUtf8().constData() ); } diff --git a/code/nelns/login_service/connection_client.cpp b/code/nelns/login_service/connection_client.cpp index 74269550b..37976cb24 100644 --- a/code/nelns/login_service/connection_client.cpp +++ b/code/nelns/login_service/connection_client.cpp @@ -152,7 +152,7 @@ retry: CLoginCookie c; c.set((uint32)(uintptr_t)from, rand(), uid); - reason = sqlQuery("update user set state='Authorized', Cookie='"+c.setToString()+"' where UId="+uid); + reason = sqlQuery("update user set state='Authorized', Cookie='"+c.setToString()+"' where UId=" + NLMISC::toString(uid)); if(!reason.empty()) break; reason = sqlQuery("select * from shard where Online>0 and ClientApplication='"+application+"'", nbrow, row, result); diff --git a/code/nelns/login_system/nel_launcher_qt/nel_launcher_dlg.cpp b/code/nelns/login_system/nel_launcher_qt/nel_launcher_dlg.cpp index 28e8114c9..0e9efc2e7 100644 --- a/code/nelns/login_system/nel_launcher_qt/nel_launcher_dlg.cpp +++ b/code/nelns/login_system/nel_launcher_qt/nel_launcher_dlg.cpp @@ -72,8 +72,8 @@ void CNelLauncherDlg::clickedSignUp() void CNelLauncherDlg::clickedLogin() { - std::string username = leUsername->text().toStdString(); - std::string password = lePassword->text().toStdString(); + std::string username = leUsername->text().toUtf8(); + std::string password = lePassword->text().toUtf8(); nlinfo("received login attempt for %s with %s", username.c_str(), password.c_str()); diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/configuration.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/configuration.cpp index 5868220cd..6af950eae 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/configuration.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/configuration.cpp @@ -98,7 +98,7 @@ namespace NLQT { void CConfiguration::addLeveldesignPath() { std::vector list; - list.push_back(Modules::config().getValue("LeveldesignPath", QString("").toStdString())); + list.push_back(Modules::config().getValue("LeveldesignPath", std::string())); addSearchPaths(&list); } diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/formdelegate.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/formdelegate.cpp index a1e3e1d13..bb91f8b62 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/formdelegate.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/formdelegate.cpp @@ -96,7 +96,7 @@ namespace NLQT //QString min = QString(type->getMin().c_str()); //QString max = QString(type->getMax().c_str()); //QString inc = QString(type->getIncrement().c_str()); - //nldebug(QString("min %1 max %2 inc %3").arg(min).arg(max).arg(inc).toStdString().c_str()); + //nldebug(QString("min %1 max %2 inc %3").arg(min).arg(max).arg(inc).toUtf8().constData()); // TODO: use saved min/max values editor->setMinimum(-99999); @@ -203,7 +203,7 @@ namespace NLQT else { nldebug(QString("setModelData from %1 to %2") - .arg(oldValue).arg(value).toStdString().c_str()); + .arg(oldValue).arg(value).toUtf8().constData()); model->setData(index, value, Qt::EditRole); } } @@ -224,7 +224,7 @@ namespace NLQT else { nldebug(QString("setModelData from %1 to %2") - .arg(oldValue).arg(value).toStdString().c_str()); + .arg(oldValue).arg(value).toUtf8().constData()); model->setData(index, value, Qt::EditRole); } break; @@ -241,7 +241,7 @@ namespace NLQT else { nldebug(QString("setModelData from %1 to %2") - .arg(oldValue).arg(value).toStdString().c_str()); + .arg(oldValue).arg(value).toUtf8().constData()); model->setData(index, value, Qt::EditRole); } break; @@ -262,7 +262,7 @@ namespace NLQT else { nldebug(QString("setModelData from %1 to %2") - .arg(oldValue).arg(value).toStdString().c_str()); + .arg(oldValue).arg(value).toUtf8().constData()); model->setData(index, value, Qt::EditRole); } break; diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/formitem.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/formitem.cpp index 5dc0fe498..6636e944e 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/formitem.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/formitem.cpp @@ -120,10 +120,8 @@ namespace NLQT { if (elmt->isAtom()) { - ((NLGEORGES::CFormElmAtom*)elmt)->setValue(value.toString().toStdString().c_str()); - nldebug(QString("array element string %1 %2") - .arg(itemData[0].toString()).arg(value.toString()) - .toStdString().c_str()); + ((NLGEORGES::CFormElmAtom*)elmt)->setValue(value.toString().toUtf8().constData()); + nldebug("array element string %s %s", itemData[0].toString().toUtf8().constData(), value.toString().toUtf8().constData()); } } } @@ -131,18 +129,14 @@ namespace NLQT else { if(parentItem->formElm->setValueByName( - value.toString().toStdString().c_str(), - itemData[0].toString().toStdString().c_str())) + value.toString().toUtf8().constData(), + itemData[0].toString().toUtf8().constData())) { - nldebug(QString("string %1 %2") - .arg(itemData[0].toString()).arg(value.toString()) - .toStdString().c_str()); + nldebug("string %s %s", itemData[0].toString().toUtf8().constData(), value.toString().toUtf8().constData()); } else { - nldebug(QString("FAILED string %1 %2") - .arg(itemData[0].toString()).arg(value.toString()) - .toStdString().c_str()); + nldebug("FAILED string %s %s", itemData[0].toString().toUtf8().constData(), value.toString().toUtf8().constData()); } } break; diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_dialog.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_dialog.cpp index cae202aa8..088170a6d 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_dialog.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_dialog.cpp @@ -93,29 +93,29 @@ namespace NLQT CForm* CGeorgesTreeViewDialog::getFormByName(const QString formName) { - if(NLMISC::CPath::exists(formName.toStdString())) + if(NLMISC::CPath::exists(formName.toUtf8().constData())) { - return (CForm*)_georges->loadForm(formName.toStdString()); + return (CForm*)_georges->loadForm(formName.toUtf8().constData()); } else { CForm *form = 0; // Load the DFN - std::string extStr = NLMISC::CFile::getExtension( formName.toStdString() ); - QString dfnName = QString("%1.dfn").arg(extStr.c_str()); + std::string extStr = NLMISC::CFile::getExtension( formName.toUtf8().constData() ); + std::string dfnName = extStr + ".dfn"; UFormDfn *formdfn; - if (NLMISC::CPath::exists(dfnName.toStdString())) + if (NLMISC::CPath::exists(dfnName)) { - formdfn = _georges->loadFormDfn (dfnName.toStdString()); + formdfn = _georges->loadFormDfn (dfnName); if (!formdfn) { - nlwarning("Failed to load dfn: %s", dfnName.toStdString().c_str()); + nlwarning("Failed to load dfn: %s", dfnName.c_str()); return 0; } } else { - nlwarning("Cannot find dfn: %s", dfnName.toStdString().c_str()); + nlwarning("Cannot find dfn: %s", dfnName.c_str()); return 0; } @@ -175,7 +175,7 @@ namespace NLQT nlinfo("typ's %d",deps["typ"].count()); nlinfo("dfn's %d",deps["dfn"].count()); - //nlwarning(strList.join(";").toStdString().c_str()); + //nlwarning(strList.join(";").toUtf8().constData()); if (root) { loadedForm = _form->getFilename().c_str(); @@ -222,7 +222,7 @@ namespace NLQT { COFile file; - std::string s = CPath::lookup(loadedForm.toStdString(), false); + std::string s = CPath::lookup(loadedForm.toUtf8().constData(), false); if (file.open (s)) { try @@ -313,7 +313,7 @@ namespace NLQT CFormItem *item = m->getItem(in2); QString value = item->data(1).toString(); - QString path = CPath::lookup(value.toStdString(),false).c_str(); + QString path = CPath::lookup(value.toUtf8().constData(),false).c_str(); if(value.contains(".tga") || value.contains(".png")) { @@ -341,7 +341,7 @@ namespace NLQT { Modules::objViewInt()->resetScene(); //Modules::config().configRemapExtensions(); - Modules::objViewInt()->loadMesh(path.toStdString(),""); + Modules::objViewInt()->loadMesh(path.toUtf8().constData(),""); } return; } diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_model.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_model.cpp index b16e0123c..b0c309efd 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_model.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_model.cpp @@ -140,13 +140,13 @@ namespace NLQT CFormItem *item = getItem(in); QString value = item->data(1).toString(); - //QString path = NLMISC::CPath::lookup(value.toStdString(),false).c_str(); + //QString path = NLMISC::CPath::lookup(value.toUtf8().constData(),false).c_str(); if (value.contains(".shape")) { if (Modules::objViewInt()) { - QIcon *icon = Modules::objViewInt()->saveOneImage(value.toStdString()); + QIcon *icon = Modules::objViewInt()->saveOneImage(value.toUtf8().constData()); if (icon) { if(icon->isNull()) @@ -162,7 +162,7 @@ namespace NLQT } else if(value.contains(".tga") || value.contains(".png")) { - QString path = NLMISC::CPath::lookup(value.toStdString(),false).c_str(); + QString path = NLMISC::CPath::lookup(value.toUtf8().constData(),false).c_str(); if(path.isEmpty()) { path = ":/images/pqrticles.png"; @@ -185,7 +185,7 @@ namespace NLQT { if (Modules::objViewInt()) { - QIcon *icon = Modules::objViewInt()->saveOneImage(value.toStdString()); + QIcon *icon = Modules::objViewInt()->saveOneImage(value.toUtf8().constData()); if (icon) { if(icon->isNull()) @@ -201,7 +201,7 @@ namespace NLQT } else if(value.contains(".tga") || value.contains(".png")) { - QString path = NLMISC::CPath::lookup(value.toStdString(),false).c_str(); + QString path = NLMISC::CPath::lookup(value.toUtf8().constData(),false).c_str(); if(path.isEmpty()) { path = ":/images/pqrticles.png"; @@ -401,13 +401,13 @@ namespace NLQT switch (type->getType()) { case UType::UnsignedInt: - value = QString("%1").arg(QString("%1").arg(value.c_str()).toDouble()).toStdString(); + value = QString("%1").arg(QString(value.c_str()).toDouble()).toUtf8().constData(); elmtType.append("_uint");break; case UType::SignedInt: - value = QString("%1").arg(QString("%1").arg(value.c_str()).toDouble()).toStdString(); + value = QString("%1").arg(QString(value.c_str()).toDouble()).toUtf8().constData(); elmtType.append("_sint");break; case UType::Double: - value = QString("%1").arg(QString("%1").arg(value.c_str()).toDouble(),0,'f',1).toStdString(); + value = QString("%1").arg(QString(value.c_str()).toDouble(),0,'f',1).toUtf8().constData(); elmtType.append("_double");break; case UType::String: elmtType.append("_string");break; diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_proxy_model.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_proxy_model.cpp index 0c4c5b7eb..46ee12567 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_proxy_model.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_proxy_model.cpp @@ -42,7 +42,7 @@ namespace NLQT CFormItem *item = smodel->getItem(index); //qDebug() << smodel->showParents() << (item->valueFrom() == NLGEORGES::UFormElm::NodeParentForm); - //nlinfo("%s %d %d %d %d", item->data(index.column()).toString().toStdString().c_str(), + //nlinfo("%s %d %d %d %d", item->data(index.column()).toString().toUtf8().constData(), // item->valueFrom(), // item->nodeFrom(), // smodel->showParents(), diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/main.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/main.cpp index ef8fadec0..fc6f5b849 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/main.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/main.cpp @@ -96,7 +96,7 @@ sint main(int argc, char **argv) #if defined(NL_OS_MAC) QDir::setCurrent(qApp->applicationDirPath() + QString("/../Resources")); CLibrary::addLibPath( - (qApp->applicationDirPath() + QString("/../PlugIns/nel")).toStdString()); + (qApp->applicationDirPath() + QString("/../PlugIns/nel")).toUtf8().constData()); #endif // go nel! diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/main_window.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/main_window.cpp index 1e5959973..ef40f4dbc 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/main_window.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/main_window.cpp @@ -63,7 +63,7 @@ namespace NLQT // load and set leveldesign path from config _leveldesignPath = Modules::config(). - getValue("LeveldesignPath", QString("").toStdString()).c_str(); + getValue("LeveldesignPath", std::string()).c_str(); QFileInfo info(_leveldesignPath); if (!info.isDir()) _leveldesignPath = ""; @@ -229,7 +229,7 @@ namespace NLQT setCursor(Qt::WaitCursor); //TODO: if not exists open FileDialog SaveAs... - if(!CPath::exists(_currentView->loadedForm.toStdString())) + if(!CPath::exists(_currentView->loadedForm.toUtf8().constData())) { QString fileName = QFileDialog::getSaveFileName( this, @@ -239,7 +239,7 @@ namespace NLQT QFile file(fileName); file.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text); file.close(); - CPath::addSearchFile(fileName.toStdString()); + CPath::addSearchFile(fileName.toUtf8().constData()); //QFileInfo info = QFileInfo(file); //m->setData(in2, info.fileName()); } @@ -417,7 +417,7 @@ namespace NLQT //tabList = _mainWindow->findChildren(); //nlinfo(QString("%1 %2").arg(QString::number((int)this,16)). // arg(QString::number((int)_mainWindow,16)). - // toStdString().c_str()); + // toUtf8().constData()); QTabBar *tb = 0; Q_FOREACH(QTabBar *tabBar, tabList) { @@ -427,11 +427,11 @@ namespace NLQT // arg(QString::number((int)tabBar,16)). // arg(QString::number((int)tabBar->parentWidget(),16)). // arg(QString::number((int)tabBar->parent(),16)). - // toStdString().c_str()); + // toUtf8().constData()); for (int i = 0; i < tabBar->count(); i++) { QString currentTab = tabBar->tabText(i); - //nlinfo(currentTab.toStdString().c_str()); + //nlinfo(currentTab.toUtf8().constData()); } tb = tabBar; } @@ -440,7 +440,7 @@ namespace NLQT void CMainWindow::tabChanged(int index) { - nlinfo(QString("%1").arg(index).toStdString().c_str()); + nlinfo("%d", index); if (index == -1) { setWindowTitle("Qt Georges Editor"); @@ -448,7 +448,7 @@ namespace NLQT } QTabBar *tb = getTabBar(); - //nlinfo(QString("%1").arg(index).toStdString().c_str()); + //nlinfo(QString("%1").arg(index).toUtf8().constData()); Q_FOREACH(CGeorgesTreeViewDialog* dlg, _treeViewList) { @@ -456,7 +456,7 @@ namespace NLQT { //nlinfo(QString("%1 modified %2").arg(tb->tabText(index)). // arg(dlg->modified()). - // toStdString().c_str()); + // toUtf8().constData()); _currentView = dlg; setWindowTitle("Qt Georges Editor - " + tb->tabText(index)); _saveAction->setEnabled(dlg->modified()); diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/modules.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/modules.cpp index 59f596f51..e77e72772 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/modules.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/modules.cpp @@ -68,12 +68,12 @@ bool Modules::loadPlugin() // if(!QFile::exists(pluginPath + pluginFilename)) // { // nlwarning("Cannot find %s in %s, fallback to working dir", - // pluginFilename.toStdString().c_str(), pluginPath.toStdString().c_str()); + // pluginFilename.toUtf8().constData(), pluginPath.toUtf8().constData()); // // pluginPath = ""; // // Q_FOREACH (QString path, qApp->libraryPaths()) - // nlwarning("libraryPaths %s", path.toStdString().c_str()); + // nlwarning("libraryPaths %s", path.toUtf8().constData()); // } QDir pluginsDir(pluginPath); @@ -86,20 +86,20 @@ bool Modules::loadPlugin() if (_objViewerInterface) { nlinfo("Loaded %s", - pluginsDir.absoluteFilePath(pluginFilename).toStdString().c_str()); + pluginsDir.absoluteFilePath(pluginFilename).toUtf8().constData()); return true; } else { nlwarning("Loaded %s, but cannot cast to NLQT::IObjectViewer*", - pluginFilename.toStdString().c_str()); + pluginFilename.toUtf8().constData()); } } else { nlwarning("Cannot get plugin instance for %s (searched in %s)", - pluginFilename.toStdString().c_str(), - (qApp->applicationDirPath() + pluginPath).toStdString().c_str()); + pluginFilename.toUtf8().constData(), + (qApp->applicationDirPath() + pluginPath).toUtf8().constData()); } return false; diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/new_dialog.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/new_dialog.cpp index e3cbda962..499b06d94 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/new_dialog.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/new_dialog.cpp @@ -87,9 +87,9 @@ namespace NLQT QString path = Modules::mainWin().leveldesignPath(); QStringList typelist; //nlinfo ("Searching files in directory '%s'...", dir.c_str()); - NLMISC::CPath::getPathContent(path.toStdString(),true,false,true,_files); + NLMISC::CPath::getPathContent(path.toUtf8().constData(),true,false,true,_files); - getTypes( /* path.toStdString() // incompatible parameter type */ ); + getTypes( /* path.toUtf8() // incompatible parameter type */ ); //nlinfo ("%d supported file types :",FileTypeToId.size()); for ( std::map::iterator it = FileTypeToId.begin(); it != FileTypeToId.end(); ++it ) { @@ -103,8 +103,8 @@ namespace NLQT std::string extStr = NLMISC::CFile::getExtension( _files[i] ); // filter files without existing dfn - if (!NLMISC::CPath::exists(QString("%1.dfn").arg(extStr.c_str()).toStdString()) && - !NLMISC::CPath::exists(QString("%1.typ").arg(extStr.c_str()).toStdString())) + if (!NLMISC::CPath::exists(extStr + ".dfn") && + !NLMISC::CPath::exists(extStr + ".typ")) { continue; } @@ -253,7 +253,7 @@ namespace NLQT { std::string extStr = NLMISC::CFile::getExtension( fileName ); - if (!NLMISC::CPath::exists(QString("%1.dfn").arg(extStr.c_str()).toStdString())) + if (!NLMISC::CPath::exists(extStr + ".dfn")) { return; } diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/settings_dialog.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/settings_dialog.cpp index a005fdf5d..66cd03937 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/settings_dialog.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/settings_dialog.cpp @@ -146,13 +146,13 @@ namespace NLQT QMessageBox::Ok);*/ // save graphics settings to config file - Modules::config().getConfigFile().getVar("GraphicsDriver").setAsString(ui.driverGraphComboBox->currentText().toStdString()); + Modules::config().getConfigFile().getVar("GraphicsDriver").setAsString(ui.driverGraphComboBox->currentText().toUtf8().constData()); // save leveldesign path to config file QString oldLdPath = Modules::config().getValue("LeveldesignPath", std::string("")).c_str(); if (oldLdPath != ui.leveldesignPath->text()) { - std::string ldPath = ui.leveldesignPath->text().toStdString(); + std::string ldPath = ui.leveldesignPath->text().toUtf8(); Modules::config().getConfigFile().getVar("LeveldesignPath").forceAsString(ldPath); Q_EMIT ldPathChanged(ldPath.c_str()); // TODO: remove old Path from CPath @@ -171,7 +171,7 @@ namespace NLQT std::vector addList; for (sint i = 0; i < ui.pathsListWidget->count(); ++i) { - std::string str = ui.pathsListWidget->item(i)->text().toStdString(); + std::string str = ui.pathsListWidget->item(i)->text().toUtf8(); if (str != "") { list.push_back(str);