From bab02839d6ddb6b93e398c4b2325018081f3ea90 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Wed, 23 Apr 2014 00:49:17 +0200 Subject: [PATCH] Build fixes. --- .../src/plugins/georges_editor/actions.cpp | 6 +-- .../georges_treeview_dialog.cpp | 46 +++++++++---------- .../src/plugins/tile_editor/tile_item.cpp | 4 +- .../plugins/tile_editor/tile_item_delegate.h | 2 - 4 files changed, 28 insertions(+), 30 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/actions.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/actions.cpp index 9fe3b0fa6..c96bca95c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/actions.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/actions.cpp @@ -83,7 +83,7 @@ namespace GeorgesQt } else { - m_oldValue = QString::fromStdString(array->Elements[m_item->structId()].Name); + m_oldValue = QString(array->Elements[m_item->structId()].Name.c_str()); } } @@ -94,8 +94,8 @@ namespace GeorgesQt value = m_oldValue; - array->Elements[m_item->structId()].Name = value.toStdString(); - m_item->setName(value.toStdString()); + array->Elements[m_item->structId()].Name = value.toAscii().data(); + m_item->setName(value.toAscii().data()); m_model->emitDataChanged(m_model->index(m_item->row(), 0, m_item)); } 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 fa417019b..f1819f52a 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 @@ -108,30 +108,30 @@ namespace GeorgesQt NLGEORGES::CForm* CGeorgesTreeViewDialog::getFormByName(const QString formName) { - if(NLMISC::CPath::exists(formName.toStdString())) + if(NLMISC::CPath::exists(formName.toAscii().data())) { - //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.toAscii().data())); + return (NLGEORGES::CForm *)m_georges->loadForm(formName.toAscii().data()); } //else //{ // CForm *form = 0; // // Load the DFN - // std::string extStr = NLMISC::CFile::getExtension( formName.toStdString() ); + // std::string extStr = NLMISC::CFile::getExtension( formName.toAscii().data() ); // QString dfnName = QString("%1.dfn").arg(extStr.c_str()); // UFormDfn *formdfn; - // if (NLMISC::CPath::exists(dfnName.toStdString())) + // if (NLMISC::CPath::exists(dfnName.toAscii().data())) // { - // formdfn = _georges->loadFormDfn (dfnName.toStdString()); + // formdfn = _georges->loadFormDfn (dfnName.toAscii().data()); // if (!formdfn) // { - // nlwarning("Failed to load dfn: %s", dfnName.toStdString().c_str()); + // nlwarning("Failed to load dfn: %s", dfnName.toAscii().data()); // return 0; // } // } // else // { - // nlwarning("Cannot find dfn: %s", dfnName.toStdString().c_str()); + // nlwarning("Cannot find dfn: %s", dfnName.toAscii().data()); // return 0; // } @@ -147,20 +147,20 @@ namespace GeorgesQt // } // return form; //} - nlinfo("File '%s' does not exist!", formName.toStdString().c_str()); + nlinfo("File '%s' does not exist!", formName.toAscii().data()); return 0; } NLGEORGES::CForm* CGeorgesTreeViewDialog::getFormByDfnName(const QString dfnName) { - if(NLMISC::CPath::exists(dfnName.toStdString())) + if(NLMISC::CPath::exists(dfnName.toAscii().data())) { // 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.toAscii().data())); // Next we'll use the root node to build a new form. NLGEORGES::CFormElmStruct *fes = dynamic_cast(getRootNode(0)); @@ -175,7 +175,7 @@ namespace GeorgesQt return form; } - nlinfo("File '%s' does not exist!", dfnName.toStdString().c_str()); + nlinfo("File '%s' does not exist!", dfnName.toAscii().data()); return NULL; } @@ -243,7 +243,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(";").toAscii().data()); if (root) { loadedForm = m_form->getFilename().c_str(); @@ -263,7 +263,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.toAscii().data()); NLGEORGES::CForm *parentForm = dynamic_cast(uParentForm); NLGEORGES::CForm *mainForm = static_cast(m_form); @@ -277,11 +277,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.toAscii().data(), parentForm)) + nlwarning("Failed to add parent form: %s", parentFormNm.toAscii().data()); else { - nlinfo("Successfullyadded parent form: %s", parentFormNm.toStdString().c_str()); + nlinfo("Successfullyadded parent form: %s", parentFormNm.toAscii().data()); model->addParentForm(parentFormNm); } } @@ -303,7 +303,7 @@ namespace GeorgesQt { NLMISC::COFile file; - std::string s = NLMISC::CPath::lookup(loadedForm.toStdString(), false); + std::string s = NLMISC::CPath::lookup(loadedForm.toAscii().data(), false); if(file.open (s)) { try @@ -387,7 +387,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().toAscii().data(),false).c_str()); //} //// col containing additional stuff like icons @@ -397,7 +397,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.toAscii().data(),false).c_str(); // if(value.contains(".tga") || value.contains(".png")) // { @@ -425,7 +425,7 @@ namespace GeorgesQt // { // Modules::objViewInt()->resetScene(); // //Modules::config().configRemapExtensions(); - // Modules::objViewInt()->loadMesh(path.toStdString(),""); + // Modules::objViewInt()->loadMesh(path.toAscii().data(),""); // } // 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.toAscii().data()); // 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.toAscii().data()); // // // 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/tile_editor/tile_item.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_item.cpp index fcd14a61b..9d9418561 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_item.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_item.cpp @@ -223,7 +223,7 @@ TileItemNode::TileItemNode(int tileId, TileModel::TTileChannel channel, QString { m_tileFilename[channel] = filename; m_parentItem = parent; - //nlinfo("dispalying tile %d - %s", m_tileId, m_tileFilename[TileModel::TileDiffuse].toStdString().c_str()); + //nlinfo("dispalying tile %d - %s", m_tileId, m_tileFilename[TileModel::TileDiffuse].toAscii().data()); } TileItemNode::~TileItemNode() @@ -255,7 +255,7 @@ QVariant TileItemNode::data(int column, int role) const QPixmap pixmap;// = new QPixmap(); if(!pixmap.load(tileFilename)) - nlinfo("failed to load %s", tileFilename.toStdString().c_str()); + nlinfo("failed to load %s", tileFilename.toAscii().data()); if(TileModel::CurrentZoomFactor == TileModel::TileZoom200) tileSize *= 2; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_item_delegate.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_item_delegate.h index 1b7058b48..90c831fb8 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_item_delegate.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_item_delegate.h @@ -20,8 +20,6 @@ #include #include -#include "ui_tile_widget.h" - #include class TileItemDelegate : public QStyledItemDelegate