fixes #3 allow Qt without STLport to link to NeL with STLport

This commit is contained in:
kervala 2012-10-28 13:34:58 +01:00
parent 34bf41082f
commit a3376d32a4
55 changed files with 256 additions and 261 deletions

View file

@ -54,7 +54,7 @@ void PluginManager::addObject(QObject *obj)
nlwarning("trying to add duplicate object"); nlwarning("trying to add duplicate object");
return; return;
} }
nlinfo(QString("addObject: " + obj->objectName()).toStdString().c_str()); nlinfo("addObject: %s", obj->objectName().toUtf8().constData());
m_allObjects.append(obj); m_allObjects.append(obj);
@ -71,10 +71,10 @@ void PluginManager::removeObject(QObject *obj)
if (!m_allObjects.contains(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; return;
} }
nlinfo(QString("removeObject: " + obj->objectName()).toStdString().c_str()); nlinfo("removeObject: %s", obj->objectName().toUtf8().constData());
Q_EMIT aboutToRemoveObject(obj); Q_EMIT aboutToRemoveObject(obj);
QWriteLocker lock(&m_lock); QWriteLocker lock(&m_lock);

View file

@ -186,7 +186,7 @@ bool PluginSpec::setFileName(const QString &fileName)
#endif #endif
nlinfo(m_filePath.toStdString().c_str()); nlinfo(m_filePath.toUtf8().constData());
if (!exists) if (!exists)
return reportError(QCoreApplication::translate("PluginSpec", "File does not exist: %1").arg(file.fileName())); return reportError(QCoreApplication::translate("PluginSpec", "File does not exist: %1").arg(file.fileName()));

View file

@ -149,7 +149,7 @@ sint main(int argc, char **argv)
#if defined(NL_OS_MAC) #if defined(NL_OS_MAC)
QDir::setCurrent(qApp->applicationDirPath() + QString("/../Resources")); 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 #endif
ExtensionSystem::PluginManager pluginManager; ExtensionSystem::PluginManager pluginManager;

View file

@ -79,7 +79,7 @@ bool BnpFileListDialog::loadTable(const QString filePath)
int row = 0; int row = 0;
// read the header from the bnp file // read the header from the bnp file
if (!myBNPFileHandle.readHeader( filePath.toStdString()) ) if (!myBNPFileHandle.readHeader( filePath.toUtf8().constData()) )
{ {
return false; return false;
} }
@ -125,7 +125,7 @@ void BnpFileListDialog::getSelections(TSelectionList& SelectionList)
{ {
QVariant data = model->data(index); QVariant data = model->data(index);
QString filename = data.toString(); QString filename = data.toString();
SelectionList.push_back( filename.toStdString() ); SelectionList.push_back( filename.toUtf8().constData() );
} }
} }

View file

@ -94,7 +94,7 @@ void BNPManagerWindow::createDialogs()
{ {
// create dialog to list the contents of the specified // create dialog to list the contents of the specified
// bnp data file directory // 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); addDockWidget(Qt::LeftDockWidgetArea, m_BnpDirTreeDialog);
m_BnpDirTreeDialog->setVisible(true); m_BnpDirTreeDialog->setVisible(true);
restoreDockWidget(m_BnpDirTreeDialog); restoreDockWidget(m_BnpDirTreeDialog);
@ -187,7 +187,7 @@ void BNPManagerWindow::newFile()
m_openedBNPFile = filePath; m_openedBNPFile = filePath;
m_BnpFileListDialog->setWindowTitle (filePath); m_BnpFileListDialog->setWindowTitle (filePath);
myBNPFileHandle.createFile ( filePath.toStdString() ); myBNPFileHandle.createFile ( filePath.toUtf8().constData() );
} }
// *************************************************************************** // ***************************************************************************
@ -196,7 +196,7 @@ void BNPManagerWindow::open()
QString fileName; QString fileName;
// file dialog to select with file should be opened // file dialog to select with file should be opened
fileName = QFileDialog::getOpenFileName(this, 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 // Check if filename is empty
if (fileName.isNull()) if (fileName.isNull())
@ -234,7 +234,7 @@ void BNPManagerWindow::addFiles()
QStringList::iterator it_list = FileList.begin(); QStringList::iterator it_list = FileList.begin();
while (it_list != FileList.end() ) 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() ) if ( std::find(currentFiles.begin(), currentFiles.end(), fileName ) != currentFiles.end() )
{ {
// Ask the user if he wants to override the existing file // Ask the user if he wants to override the existing file
@ -246,7 +246,7 @@ void BNPManagerWindow::addFiles()
} }
else else
{ {
addFiles.push_back( it_list->toStdString() ); addFiles.push_back( it_list->toUtf8().constData() );
// log it // log it
nlinfo("Add file %s", fileName.c_str() ); nlinfo("Add file %s", fileName.c_str() );
} }
@ -277,7 +277,7 @@ void BNPManagerWindow::addFiles( QStringList FileList )
QStringList::iterator it_list = FileList.begin(); QStringList::iterator it_list = FileList.begin();
while (it_list != FileList.end() ) 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() ) if ( std::find(currentFiles.begin(), currentFiles.end(), fileName ) != currentFiles.end() )
{ {
// Ask the user if he wants to override the existing file // Ask the user if he wants to override the existing file
@ -289,7 +289,7 @@ void BNPManagerWindow::addFiles( QStringList FileList )
} }
else else
{ {
addFiles.push_back( it_list->toStdString() ); addFiles.push_back( it_list->toUtf8().constData() );
// log it // log it
nlinfo("Add file %s", fileName.c_str() ); nlinfo("Add file %s", fileName.c_str() );
} }
@ -346,7 +346,7 @@ void BNPManagerWindow::unpackFiles()
} }
QString dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"), QString dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"),
tr(m_DataPath.toStdString().c_str()), tr(m_DataPath.toUtf8().constData()),
QFileDialog::ShowDirsOnly QFileDialog::ShowDirsOnly
| QFileDialog::DontResolveSymlinks); | QFileDialog::DontResolveSymlinks);
@ -354,7 +354,7 @@ void BNPManagerWindow::unpackFiles()
if ( dir.isEmpty() ) if ( dir.isEmpty() )
return; return;
if (myBNPFileHandle.unpack(dir.toStdString(),selectedrows)) if (myBNPFileHandle.unpack(dir.toUtf8().constData(),selectedrows))
{ {
QMessageBox::information(this, tr("BNP Manager"), QMessageBox::information(this, tr("BNP Manager"),
tr("All files has been exported successfully."), tr("All files has been exported successfully."),
@ -426,7 +426,7 @@ void BNPManagerWindow::dropEvent(QDropEvent *event)
filePath = it->toLocalFile(); filePath = it->toLocalFile();
if ( filePath.endsWith(".bnp") ) 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 else
{ {

View file

@ -160,7 +160,7 @@ int ContextManager::indexOf(const QString &id) const
if (d->m_contexts.at(i)->id() == id) if (d->m_contexts.at(i)->id() == id)
return i; 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; return -1;
} }

View file

@ -99,10 +99,10 @@ void GeneralSettingsPage::applyGeneralSettings()
QString primitivePath = settings->value(Core::Constants::PRIMITIVES_PATH, QString("%1/primitives").arg(levelDesignPrefix)).toString(); 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 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(); 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::display();
NLMISC::CPath::addSearchFile(ligoConfigFile.toStdString()); NLMISC::CPath::addSearchFile(ligoConfigFile.toUtf8().constData());
NLMISC::CPath::addSearchPath(leveldesignPath.toStdString(), true, false); NLMISC::CPath::addSearchPath(leveldesignPath.toUtf8().constData(), true, false);
settings->endGroup(); settings->endGroup();
} }

View file

@ -62,7 +62,7 @@ QMenu *MenuManager::menu(const QString &id) const
{ {
QMenu *result = 0; QMenu *result = 0;
if (!d->m_menuMap.contains(id)) if (!d->m_menuMap.contains(id))
nlwarning("QMenu %s not found", id.toStdString().c_str()); nlwarning("QMenu %s not found", id.toUtf8().constData());
else else
result = d->m_menuMap.value(id); result = d->m_menuMap.value(id);
return result; return result;
@ -72,7 +72,7 @@ QAction *MenuManager::action(const QString &id) const
{ {
QAction *result = 0; QAction *result = 0;
if (!d->m_actionMap.contains(id)) if (!d->m_actionMap.contains(id))
nlwarning("QAction %s not found", id.toStdString().c_str()); nlwarning("QAction %s not found", id.toUtf8().constData());
else else
result = d->m_actionMap.value(id); result = d->m_actionMap.value(id);
return result; return result;

View file

@ -116,11 +116,11 @@ void SearchPathsSettingsPage::applySearchPaths()
settings->endGroup(); settings->endGroup();
for (int i = 1; i < remapExt.size(); i += 2) 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) Q_FOREACH(QString path, paths)
{ {
NLMISC::CPath::addSearchPath(path.toStdString(), m_recurse, false); NLMISC::CPath::addSearchPath(path.toUtf8().constData(), m_recurse, false);
} }
} }

View file

@ -95,7 +95,7 @@ namespace GeorgesQt
//QString min = QString(type->getMin().c_str()); //QString min = QString(type->getMin().c_str());
//QString max = QString(type->getMax().c_str()); //QString max = QString(type->getMax().c_str());
//QString inc = QString(type->getIncrement().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 // TODO: use saved min/max values
editor->setMinimum(-99999); editor->setMinimum(-99999);
@ -110,7 +110,7 @@ namespace GeorgesQt
//QString min = QString(type->getMin().c_str()); //QString min = QString(type->getMin().c_str());
//QString max = QString(type->getMax().c_str()); //QString max = QString(type->getMax().c_str());
//QString inc = QString(type->getIncrement().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 // TODO: use saved min/max values
editor->setMinimum(-99999); editor->setMinimum(-99999);
@ -201,7 +201,7 @@ namespace GeorgesQt
else else
{ {
nldebug(QString("setModelData from %1 to %2") 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); model->setData(index, value, Qt::EditRole);
} }
} }
@ -222,7 +222,7 @@ namespace GeorgesQt
else else
{ {
nldebug(QString("setModelData from %1 to %2") 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); model->setData(index, value, Qt::EditRole);
} }
break; break;
@ -239,7 +239,7 @@ namespace GeorgesQt
else else
{ {
nldebug(QString("setModelData from %1 to %2") 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); model->setData(index, value, Qt::EditRole);
} }
break; break;
@ -260,7 +260,7 @@ namespace GeorgesQt
else else
{ {
nldebug(QString("setModelData from %1 to %2") 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); model->setData(index, value, Qt::EditRole);
} }
break; break;

View file

@ -118,10 +118,10 @@ namespace GeorgesQt
{ {
if (elmt->isAtom()) 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") nldebug(QString("array element string %1 %2")
.arg(itemData[0].toString()).arg(value.toString()) .arg(itemData[0].toString()).arg(value.toString())
.toStdString().c_str()); .toUtf8().constData());
} }
} }
} }
@ -129,18 +129,18 @@ namespace GeorgesQt
else else
{ {
if(parentItem->formElm->setValueByName( if(parentItem->formElm->setValueByName(
value.toString().toStdString().c_str(), value.toString().toUtf8().constData(),
itemData[0].toString().toStdString().c_str())) itemData[0].toString().toUtf8().constData()))
{ {
nldebug(QString("string %1 %2") nldebug(QString("string %1 %2")
.arg(itemData[0].toString()).arg(value.toString()) .arg(itemData[0].toString()).arg(value.toString())
.toStdString().c_str()); .toUtf8().constData());
} }
else else
{ {
nldebug(QString("FAILED string %1 %2") nldebug(QString("FAILED string %1 %2")
.arg(itemData[0].toString()).arg(value.toString()) .arg(itemData[0].toString()).arg(value.toString())
.toStdString().c_str()); .toUtf8().constData());
} }
} }
break; break;

View file

@ -253,7 +253,7 @@ namespace GeorgesQt
} }
else 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(); m_dockedWidgets.last()->close();
} }
} }

View file

@ -117,30 +117,30 @@ namespace GeorgesQt
NLGEORGES::CForm* CGeorgesTreeViewDialog::getFormByName(const QString formName) 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<NLGEORGES::CForm*>(m_georges->loadForm(formName.toStdString())); //NLGEORGES::CForm *form = dynamic_cast<NLGEORGES::CForm*>(m_georges->loadForm(formName.toUtf8()));
return (NLGEORGES::CForm *)m_georges->loadForm(formName.toStdString()); return (NLGEORGES::CForm *)m_georges->loadForm(formName.toUtf8().constData());
} }
//else //else
//{ //{
// CForm *form = 0; // CForm *form = 0;
// // Load the DFN // // 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()); // QString dfnName = QString("%1.dfn").arg(extStr.c_str());
// UFormDfn *formdfn; // 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) // if (!formdfn)
// { // {
// nlwarning("Failed to load dfn: %s", dfnName.toStdString().c_str()); // nlwarning("Failed to load dfn: %s", dfnName.toUtf8());
// return 0; // return 0;
// } // }
// } // }
// else // else
// { // {
// nlwarning("Cannot find dfn: %s", dfnName.toStdString().c_str()); // nlwarning("Cannot find dfn: %s", dfnName.toUtf8());
// return 0; // return 0;
// } // }
@ -156,20 +156,20 @@ namespace GeorgesQt
// } // }
// return form; // return form;
//} //}
nlinfo("File '%s' does not exist!", formName.toStdString().c_str()); nlinfo("File '%s' does not exist!", formName.toUtf8().constData());
return 0; return 0;
} }
NLGEORGES::CForm* CGeorgesTreeViewDialog::getFormByDfnName(const QString dfnName) 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. // Create a new form object.
NLGEORGES::CForm *form = new NLGEORGES::CForm(); NLGEORGES::CForm *form = new NLGEORGES::CForm();
m_form = form; m_form = form;
// Retrieve a copy of the root definition. // Retrieve a copy of the root definition.
NLGEORGES::CFormDfn *formDfn = dynamic_cast<NLGEORGES::CFormDfn *>(m_georges->loadFormDfn(dfnName.toStdString())); NLGEORGES::CFormDfn *formDfn = dynamic_cast<NLGEORGES::CFormDfn *>(m_georges->loadFormDfn(dfnName.toUtf8().constData()));
// Next we'll use the root node to build a new form. // Next we'll use the root node to build a new form.
NLGEORGES::CFormElmStruct *fes = dynamic_cast<NLGEORGES::CFormElmStruct *>(getRootNode(0)); NLGEORGES::CFormElmStruct *fes = dynamic_cast<NLGEORGES::CFormElmStruct *>(getRootNode(0));
@ -184,7 +184,7 @@ namespace GeorgesQt
return form; return form;
} }
nlinfo("File '%s' does not exist!", dfnName.toStdString().c_str()); nlinfo("File '%s' does not exist!", dfnName.toUtf8().constData());
return NULL; return NULL;
} }
@ -250,7 +250,7 @@ namespace GeorgesQt
nlinfo("typ's %d",deps["typ"].count()); nlinfo("typ's %d",deps["typ"].count());
nlinfo("dfn's %d",deps["dfn"].count()); nlinfo("dfn's %d",deps["dfn"].count());
//nlwarning(strList.join(";").toStdString().c_str()); //nlwarning(strList.join(";").toUtf8());
if (root) if (root)
{ {
loadedForm = m_form->getFilename().c_str(); loadedForm = m_form->getFilename().c_str();
@ -277,7 +277,7 @@ namespace GeorgesQt
void CGeorgesTreeViewDialog::addParentForm(QString parentFormNm) void CGeorgesTreeViewDialog::addParentForm(QString parentFormNm)
{ {
// Try to load the form // 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<NLGEORGES::CForm*>(uParentForm); NLGEORGES::CForm *parentForm = dynamic_cast<NLGEORGES::CForm*>(uParentForm);
NLGEORGES::CForm *mainForm = static_cast<NLGEORGES::CForm*>(m_form); NLGEORGES::CForm *mainForm = static_cast<NLGEORGES::CForm*>(m_form);
@ -292,11 +292,11 @@ namespace GeorgesQt
if (parentForm->Elements.FormDfn == mainForm->Elements.FormDfn) if (parentForm->Elements.FormDfn == mainForm->Elements.FormDfn)
{ {
// This is the parent form selector // This is the parent form selector
if(!mainForm->insertParent(mainForm->getParentCount(),parentFormNm.toStdString().c_str(), parentForm)) if(!mainForm->insertParent(mainForm->getParentCount(),parentFormNm.toUtf8(), parentForm))
nlwarning("Failed to add parent form: %s", parentFormNm.toStdString().c_str()); nlwarning("Failed to add parent form: %s", parentFormNm.toUtf8().constData());
else else
{ {
nlinfo("Successfullyadded parent form: %s", parentFormNm.toStdString().c_str()); nlinfo("Successfullyadded parent form: %s", parentFormNm.toUtf8().constData());
model->addParentForm(parentFormNm); model->addParentForm(parentFormNm);
} }
} }
@ -318,7 +318,7 @@ namespace GeorgesQt
{ {
NLMISC::COFile file; 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)) if(file.open (s))
{ {
try try
@ -406,7 +406,7 @@ namespace GeorgesQt
if (item->parent() && item->parent()->data(0) == "parents") 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 //// col containing additional stuff like icons
@ -416,7 +416,7 @@ namespace GeorgesQt
// CFormItem *item = m->getItem(in2); // CFormItem *item = m->getItem(in2);
// QString value = item->data(1).toString(); // 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")) // if(value.contains(".tga") || value.contains(".png"))
// { // {
@ -444,7 +444,7 @@ namespace GeorgesQt
// { // {
// Modules::objViewInt()->resetScene(); // Modules::objViewInt()->resetScene();
// //Modules::config().configRemapExtensions(); // //Modules::config().configRemapExtensions();
// Modules::objViewInt()->loadMesh(path.toStdString(),""); // Modules::objViewInt()->loadMesh(path.toUtf8(),"");
// } // }
// return; // return;
// } // }
@ -551,7 +551,7 @@ namespace GeorgesQt
file = file.remove(0,file.indexOf(".")+1); file = file.remove(0,file.indexOf(".")+1);
QString filePattern = "Parent Sheets (*."+file+")"; 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); QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Select parent sheets..."), m_lastSheetDir, filePattern);
if(!fileNames.isEmpty()) if(!fileNames.isEmpty())
{ {
@ -561,7 +561,7 @@ namespace GeorgesQt
QFileInfo pathInfo( fileToParent ); QFileInfo pathInfo( fileToParent );
QString tmpFileName( pathInfo.fileName() ); 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. // Call to add the form and load it into the Georges form.
addParentForm(tmpFileName); addParentForm(tmpFileName);

View file

@ -140,13 +140,13 @@ namespace GeorgesQt
CFormItem *item = getItem(in); CFormItem *item = getItem(in);
QString value = item->data(1).toString(); 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 (value.contains(".shape"))
{ {
if (Modules::objViewInt()) if (Modules::objViewInt())
{ {
QIcon *icon = Modules::objViewInt()->saveOneImage(value.toStdString()); QIcon *icon = Modules::objViewInt()->saveOneImage(value.toUtf8().constData());
if (icon) if (icon)
{ {
if(icon->isNull()) if(icon->isNull())
@ -162,7 +162,7 @@ namespace GeorgesQt
}*/ }*/
if(value.contains(".tga") || value.contains(".png")) 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()) if(path.isEmpty())
{ {
path = ":/images/pqrticles.png"; path = ":/images/pqrticles.png";
@ -185,7 +185,7 @@ namespace GeorgesQt
{ {
if (Modules::objViewInt()) if (Modules::objViewInt())
{ {
QIcon *icon = Modules::objViewInt()->saveOneImage(value.toStdString()); QIcon *icon = Modules::objViewInt()->saveOneImage(value.toUtf8().constData());
if (icon) if (icon)
{ {
if(icon->isNull()) if(icon->isNull())
@ -201,7 +201,7 @@ namespace GeorgesQt
}*/ }*/
if(value.contains(".tga") || value.contains(".png")) 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()) if(path.isEmpty())
{ {
path = ":/images/pqrticles.png"; path = ":/images/pqrticles.png";
@ -428,13 +428,13 @@ namespace GeorgesQt
switch (type->getType()) switch (type->getType())
{ {
case UType::UnsignedInt: 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; elmtType.append("_uint");break;
case UType::SignedInt: 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; elmtType.append("_sint");break;
case UType::Double: 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; elmtType.append("_double");break;
case UType::String: case UType::String:
elmtType.append("_string");break; elmtType.append("_string");break;

View file

@ -239,11 +239,11 @@ void MissionCompilerMainWindow::compileMission(bool publish)
try try
{ {
CMissionCompiler mc; 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"); m_compileLog.append("Found "+QString::number(mc.getMissionsCount())+" valid missions\n");
updateCompileLog(); updateCompileLog();
mc.installCompiledMission(m_ligoConfig, filename.toStdString()); mc.installCompiledMission(m_ligoConfig, filename.toUtf8().constData());
nbMission += mc.getMissionsCount(); nbMission += mc.getMissionsCount();
// publish files to selected servers // 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"); 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++; column++;

View file

@ -90,7 +90,7 @@ void CAnimationDialog::setCurrentShape(const QString &name)
{ {
if (name.isEmpty()) if (name.isEmpty())
return; return;
CEntity &entity = Modules::objView().getEntity(name.toStdString()); CEntity &entity = Modules::objView().getEntity(name.toUtf8().constData());
_ui.inPlaceCheckBox->setChecked(entity.getInPlace()); _ui.inPlaceCheckBox->setChecked(entity.getInPlace());
_ui.incPosCheckBox->setChecked(entity.getIncPos()); _ui.incPosCheckBox->setChecked(entity.getIncPos());

View file

@ -57,7 +57,7 @@ void CAnimationSetDialog::setCurrentShape(const QString &name)
if (name.isEmpty()) if (name.isEmpty())
return; return;
Modules::objView().setCurrentObject(name.toStdString()); Modules::objView().setCurrentObject(name.toUtf8().constData());
updateListAnim(); updateListAnim();
@ -161,7 +161,7 @@ void CAnimationSetDialog::loadAnim()
QStringList::Iterator it = list.begin(); QStringList::Iterator it = list.begin();
while(it != list.end()) while(it != list.end())
{ {
std::string animName = it->toStdString(); std::string animName = it->toUtf8();
entity.loadAnimation(animName); entity.loadAnimation(animName);
++it; ++it;
} }
@ -187,7 +187,7 @@ void CAnimationSetDialog::loadSwt()
QStringList::Iterator it = list.begin(); QStringList::Iterator it = list.begin();
while(it != list.end()) while(it != list.end())
{ {
std::string swtName = it->toStdString(); std::string swtName = it->toUtf8();
entity.loadSWT(swtName); entity.loadSWT(swtName);
++it; ++it;
} }
@ -212,7 +212,7 @@ void CAnimationSetDialog::addAnim()
Q_FOREACH(QTreeWidgetItem *item, list) Q_FOREACH(QTreeWidgetItem *item, list)
{ {
std::string animName = item->text(0).toStdString(); std::string animName = item->text(0).toUtf8();
entity.addAnimToPlayList(animName); entity.addAnimToPlayList(animName);
ui.animPlaylistWidget->addItem(item->text(0)); ui.animPlaylistWidget->addItem(item->text(0));
} }

View file

@ -449,9 +449,9 @@ bool CMainWindow::loadFile(const QString &fileName, const QString &skelName)
QFileInfo fileInfo(fileName); QFileInfo fileInfo(fileName);
bool loaded; bool loaded;
if (fileInfo.suffix() == "ig") if (fileInfo.suffix() == "ig")
loaded = Modules::objView().loadInstanceGroup(fileName.toStdString()); loaded = Modules::objView().loadInstanceGroup(fileName.toUtf8().constData());
else else
loaded = Modules::objView().loadMesh(fileName.toStdString(), skelName.toStdString()); loaded = Modules::objView().loadMesh(fileName.toUtf8().constData(), skelName.toUtf8().constData());
if (!loaded) if (!loaded)
{ {

View file

@ -86,10 +86,10 @@ void CMeshWidget::browseShape()
setCursor(Qt::WaitCursor); setCursor(Qt::WaitCursor);
if (!fileName.isEmpty()) if (!fileName.isEmpty())
{ {
NLMISC::CPath::addSearchPath(NLMISC::CFile::getPath(fileName.toStdString())); NLMISC::CPath::addSearchPath(NLMISC::CFile::getPath(fileName.toUtf8().constData()));
try try
{ {
std::string shapeName = NLMISC::CFile::getFilename(fileName.toStdString()); std::string shapeName = NLMISC::CFile::getFilename(fileName.toUtf8().constData());
_ShapeParticle->setShape(shapeName); _ShapeParticle->setShape(shapeName);
_ui.meshLineEdit->setText(shapeName.c_str()); _ui.meshLineEdit->setText(shapeName.c_str());
touchPSState(); touchPSState();

View file

@ -110,7 +110,7 @@ void CMorphMeshDialog::add()
shapeNames.resize(_CM->getNumShapes() + 1); shapeNames.resize(_CM->getNumShapes() + 1);
_CM->getShapesNames(&shapeNames[0]); _CM->getShapesNames(&shapeNames[0]);
uint index = (uint)shapeNames.size() - 1; uint index = (uint)shapeNames.size() - 1;
shapeNames[index] = fileName.toStdString(); shapeNames[index] = fileName.toUtf8();
_CM->setShapes(&shapeNames[0], (uint)shapeNames.size()); _CM->setShapes(&shapeNames[0], (uint)shapeNames.size());
std::vector<sint> numVerts; std::vector<sint> numVerts;
_CM->getShapeNumVerts(numVerts); _CM->getShapeNumVerts(numVerts);
@ -152,7 +152,7 @@ void CMorphMeshDialog::insert()
std::vector<std::string> shapeNames; std::vector<std::string> shapeNames;
shapeNames.resize(_CM->getNumShapes()); shapeNames.resize(_CM->getNumShapes());
_CM->getShapesNames(&shapeNames[0]); _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()); _CM->setShapes(&shapeNames[0], (uint)shapeNames.size());
touchPSState(); touchPSState();
updateMeshList(); updateMeshList();
@ -172,7 +172,7 @@ void CMorphMeshDialog::change()
if (!fileName.isEmpty()) if (!fileName.isEmpty())
{ {
sint row = _ui.listWidget->currentRow(); sint row = _ui.listWidget->currentRow();
_CM->setShape(row, fileName.toStdString()); _CM->setShape(row, fileName.toUtf8().constData());
updateMeshList(); updateMeshList();
touchPSState(); touchPSState();
} }

View file

@ -468,7 +468,7 @@ void CObjectViewer::loadConfig()
#endif #endif
_CameraFocal = settings->value("CameraFocal", 75).toInt(); _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(); _BloomEffect = settings->value(Constants::ENABLE_BLOOM, false).toBool();
_BloomDensity = settings->value(Constants::BLOOM_DENSITY, 0).toInt(); _BloomDensity = settings->value(Constants::BLOOM_DENSITY, 0).toInt();
_BloomSquare = settings->value(Constants::ENABLE_SQUARE_BLOOM, false).toBool(); _BloomSquare = settings->value(Constants::ENABLE_SQUARE_BLOOM, false).toBool();

View file

@ -185,11 +185,11 @@ void CForcePage::setDir(const NLMISC::CVector &value)
void CForcePage::setGlobalName(const QString &globalName) void CForcePage::setGlobalName(const QString &globalName)
{ {
nlassert(_LBTarget); nlassert(_LBTarget);
dynamic_cast<NL3D::CPSDirection *>(_LBTarget)->enableGlobalVectorValue(globalName.toStdString()); dynamic_cast<NL3D::CPSDirection *>(_LBTarget)->enableGlobalVectorValue(globalName.toUtf8().constData());
if (!globalName.isEmpty()) if (!globalName.isEmpty())
{ {
// take a non NULL value for the direction // 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(); updateModifiedFlag();
} }

View file

@ -122,7 +122,7 @@ void CSoundPage::browse()
void CSoundPage::play() void CSoundPage::play()
{ {
Modules::sound().play(_ui.soundNameLineEdit->text().toStdString()); Modules::sound().play(_ui.soundNameLineEdit->text().toUtf8().constData());
} }
void CSoundPage::setSpawn(bool state) void CSoundPage::setSpawn(bool state)
@ -162,7 +162,7 @@ void CSoundPage::setKeepPitch(bool state)
void CSoundPage::setSoundName(const QString &text) void CSoundPage::setSoundName(const QString &text)
{ {
_Sound->setSoundName(NLMISC::CSheetId(text.toStdString())); _Sound->setSoundName(NLMISC::CSheetId(text.toUtf8().constData()));
} }
void CSoundPage::setEmissionPercent(float value) void CSoundPage::setEmissionPercent(float value)

View file

@ -50,7 +50,7 @@ static void chooseGlobalUserParam(uint userParam, NL3D::CParticleSystem *ps, QWi
QString(ps->getGlobalValueName(userParam).c_str()), &ok); QString(ps->getGlobalValueName(userParam).c_str()), &ok);
if (ok) if (ok)
ps->bindGlobalValueToUserParam(text.toStdString(), userParam); ps->bindGlobalValueToUserParam(text.toUtf8().constData(), userParam);
} }
CParticleSystemPage::CParticleSystemPage(QWidget *parent) CParticleSystemPage::CParticleSystemPage(QWidget *parent)

View file

@ -76,10 +76,10 @@ void CParticleTextureWidget::chooseTexture()
if (!fileName.isEmpty()) if (!fileName.isEmpty())
{ {
// Add search path for the texture // Add search path for the texture
NLMISC::CPath::addSearchPath(NLMISC::CFile::getPath(fileName.toStdString())); NLMISC::CPath::addSearchPath(NLMISC::CFile::getPath(fileName.toUtf8().constData()));
try try
{ {
texName = NLMISC::CFile::getFilename(fileName.toStdString()); texName = NLMISC::CFile::getFilename(fileName.toUtf8().constData());
NL3D::CTextureFile *tf = new NL3D::CTextureFile(texName); NL3D::CTextureFile *tf = new NL3D::CTextureFile(texName);
_Wrapper->setAndUpdateModifiedFlag(tf); _Wrapper->setAndUpdateModifiedFlag(tf);
_Texture = tf; _Texture = tf;

View file

@ -319,7 +319,7 @@ bool CParticleTreeModel::setData(const QModelIndex &index, const QVariant &value
QList<QVariant> listData; QList<QVariant> listData;
listData << value; listData << value;
item->replace(listData); item->replace(listData);
std::string name = value.toString().toStdString(); std::string name = value.toString().toUtf8();
if (item->itemType() == ItemType::Located) if (item->itemType() == ItemType::Located)
item->getLoc()->setName(name); item->getLoc()->setName(name);
else else

View file

@ -348,7 +348,7 @@ void CParticleWorkspaceDialog::saveAsPS()
tr("ps files (*.ps)")); tr("ps files (*.ps)"));
// after check // after check
if (!fileName.isEmpty()) 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(); std::string name = toCreate->getName();
if (_PSElementIdentifiers.count(name)) if (_PSElementIdentifiers.count(name))
{ {
name += (QString("%1").arg(++_PSElementIdentifiers[name])).toStdString(); name += NLMISC::toString("%u", ++_PSElementIdentifiers[name]);
toCreate->setName(name); toCreate->setName(name);
} }
else else
@ -771,7 +771,7 @@ NL3D::CPSLocated *CParticleWorkspaceDialog::createLocated(NL3D::CParticleSystem
// build new name // build new name
std::string name; std::string name;
if (_PSElementIdentifiers.count(std::string("located"))) 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 else
{ {

View file

@ -63,7 +63,7 @@ void CWorkspacePage::newWP()
tr("pws files (*.pws)")); tr("pws files (*.pws)"));
if (!fileName.isEmpty()) if (!fileName.isEmpty())
{ {
Modules::psEdit().createNewWorkspace(fileName.toStdString()); Modules::psEdit().createNewWorkspace(fileName.toUtf8().constData());
_treeModel->setupModelFromWorkSpace(); _treeModel->setupModelFromWorkSpace();
_ui.saveToolButton->setEnabled(true); _ui.saveToolButton->setEnabled(true);
_ui.saveAsToolButton->setEnabled(true); _ui.saveAsToolButton->setEnabled(true);
@ -83,7 +83,7 @@ void CWorkspacePage::loadWP()
setCursor(Qt::WaitCursor); setCursor(Qt::WaitCursor);
if (!fileName.isEmpty()) if (!fileName.isEmpty())
{ {
Modules::psEdit().loadWorkspace(fileName.toStdString()); Modules::psEdit().loadWorkspace(fileName.toUtf8().constData());
_treeModel->setupModelFromWorkSpace(); _treeModel->setupModelFromWorkSpace();
_ui.unloadToolButton->setEnabled(true); _ui.unloadToolButton->setEnabled(true);
_ui.saveToolButton->setEnabled(true); _ui.saveToolButton->setEnabled(true);
@ -109,7 +109,7 @@ void CWorkspacePage::saveAsWP()
tr("pws files (*.pws)")); tr("pws files (*.pws)"));
if (!fileName.isEmpty()) if (!fileName.isEmpty())
{ {
Modules::psEdit().getParticleWorkspace()->setFileName(fileName.toStdString()); Modules::psEdit().getParticleWorkspace()->setFileName(fileName.toUtf8().constData());
Modules::psEdit().saveWorkspaceStructure(); Modules::psEdit().saveWorkspaceStructure();
Modules::psEdit().saveWorkspaceContent(); Modules::psEdit().saveWorkspaceContent();
_treeModel->setupModelFromWorkSpace(); _treeModel->setupModelFromWorkSpace();
@ -125,7 +125,7 @@ void CWorkspacePage::insertPS()
if (!fileName.isEmpty()) if (!fileName.isEmpty())
{ {
// TODO: create method particle editor insertNewPS and multiple add // 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) if (node != 0)
{ {
try try
@ -158,14 +158,14 @@ void CWorkspacePage::createPS()
{ {
// TODO: create method particle editor createNewPS // 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"), QMessageBox::critical(this, tr("NeL particle system editor"),
tr("Failed to create new particle system"), tr("Failed to create new particle system"),
QMessageBox::Ok); QMessageBox::Ok);
return; 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 // should always succeed because we tested if file already exists
nlassert(node); nlassert(node);
node->createEmptyPS(); node->createEmptyPS();

View file

@ -61,7 +61,7 @@ void CSchemeBankDialog::createScheme()
if (ok && !text.isEmpty()) if (ok && !text.isEmpty())
{ {
NL3D::CPSAttribMakerBase *attribMakerBase = _attribWidget->getCurrentSchemePtr()->clone(); 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); CSchemeItem *item = new CSchemeItem(text, _ui.listWidget);
item->setUserData(attribMakerBase); item->setUserData(attribMakerBase);
@ -108,7 +108,7 @@ void CSchemeBankDialog::saveBank()
try try
{ {
NLMISC::COFile iF; NLMISC::COFile iF;
iF.open(fileName.toStdString()); iF.open(fileName.toUtf8().constData());
NLQT::CSchemeManager *schemeManager = Modules::psEdit().getSchemeManager(); NLQT::CSchemeManager *schemeManager = Modules::psEdit().getSchemeManager();
iF.serial(*schemeManager); iF.serial(*schemeManager);
} }
@ -132,7 +132,7 @@ void CSchemeBankDialog::loadBank()
try try
{ {
NLMISC::CIFile iF; NLMISC::CIFile iF;
iF.open(fileName.toStdString()); iF.open(fileName.toUtf8().constData());
iF.serial(sm); iF.serial(sm);
Modules::psEdit().getSchemeManager()->swap(sm); Modules::psEdit().getSchemeManager()->swap(sm);
} }
@ -152,7 +152,7 @@ void CSchemeBankDialog::changeNameScheme(QListWidgetItem *item)
NL3D::CPSAttribMakerBase *attrib = schemeItem->getUserData(); NL3D::CPSAttribMakerBase *attrib = schemeItem->getUserData();
nlassert(attrib); nlassert(attrib);
Modules::psEdit().getSchemeManager()->rename(attrib, item->text().toStdString()); Modules::psEdit().getSchemeManager()->rename(attrib, item->text().toUtf8().constData());
} }
void CSchemeBankDialog::enableButtons() void CSchemeBankDialog::enableButtons()

View file

@ -93,8 +93,8 @@ void CSkeletonScaleDialog::setCurrentShape(const QString &name)
if (name.isEmpty()) if (name.isEmpty())
return; return;
_Skeleton = Modules::objView().getEntity(name.toStdString()).getSkeleton(); _Skeleton = Modules::objView().getEntity(name.toUtf8().constData()).getSkeleton();
_SkeletonFileName = Modules::objView().getEntity(name.toStdString()).getFileNameSkeleton(); _SkeletonFileName = Modules::objView().getEntity(name.toUtf8().constData()).getFileNameSkeleton();
// Setup Bone mirror // Setup Bone mirror
_Bones.clear(); _Bones.clear();
@ -290,7 +290,7 @@ void CSkeletonScaleDialog::clickSaveAsSkel()
{ {
NLMISC::COFile f; NLMISC::COFile f;
if( f.open(fileName.toStdString()) ) if( f.open(fileName.toUtf8().constData()) )
{ {
if(saveCurrentInStream(f)) if(saveCurrentInStream(f))
{ {
@ -300,7 +300,7 @@ void CSkeletonScaleDialog::clickSaveAsSkel()
} }
// bkup the valid fileName (new file edited) // bkup the valid fileName (new file edited)
_SkeletonFileName = fileName.toStdString(); _SkeletonFileName = fileName.toUtf8();
} }
else else
{ {
@ -324,7 +324,7 @@ void CSkeletonScaleDialog::clickLoadScale()
if (!fileName.isEmpty()) if (!fileName.isEmpty())
{ {
NLMISC::CIFile f; NLMISC::CIFile f;
if( f.open(fileName.toStdString()) ) if( f.open(fileName.toUtf8().constData()) )
loadSkelScaleFromStream(f); loadSkelScaleFromStream(f);
else else
QMessageBox::critical(this, tr("Skeleton scale editor"), tr("Failed to open file for read!"), QMessageBox::Ok); 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()) if (!fileName.isEmpty())
{ {
NLMISC::COFile f; NLMISC::COFile f;
if( f.open(fileName.toStdString()) ) if( f.open(fileName.toUtf8().constData()) )
saveSkelScaleInStream(f); saveSkelScaleInStream(f);
else else
QMessageBox::critical(this, tr("Skeleton scale editor"), tr("Failed to open file for write!"), QMessageBox::Ok); QMessageBox::critical(this, tr("Skeleton scale editor"), tr("Failed to open file for write!"), QMessageBox::Ok);

View file

@ -111,8 +111,8 @@ void CSlotGroupBox::updateUi()
void CSlotGroupBox::saveSlotInfo() void CSlotGroupBox::saveSlotInfo()
{ {
CSlotInfo slotInfo; CSlotInfo slotInfo;
slotInfo.Animation = _animName.toStdString(); slotInfo.Animation = _animName.toUtf8();
slotInfo.Skeleton = _skelName.toStdString(); slotInfo.Skeleton = _skelName.toUtf8();
slotInfo.EndBlend = _ui.endBlendSpinBox->value(); slotInfo.EndBlend = _ui.endBlendSpinBox->value();
slotInfo.EndTime = float(_ui.endFrameSpinBox->value()) / Modules::mainWin().getFrameRate(); slotInfo.EndTime = float(_ui.endFrameSpinBox->value()) / Modules::mainWin().getFrameRate();
slotInfo.Offset = float(_ui.offsetSpinBox->value()) / Modules::mainWin().getFrameRate(); slotInfo.Offset = float(_ui.offsetSpinBox->value()) / Modules::mainWin().getFrameRate();
@ -182,7 +182,7 @@ void CSlotGroupBox::selectAnim()
_animName = item; _animName = item;
QString title = tr("Slot %1 : ").arg(_numSlot) + _animName + " : " + _skelName; QString title = tr("Slot %1 : ").arg(_numSlot) + _animName + " : " + _skelName;
this->setTitle(title); 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(); saveSlotInfo();
} }
} }

View file

@ -86,12 +86,12 @@ void CSoundSystem::init()
QSettings *settings = Core::ICore::instance()->settings(); QSettings *settings = Core::ICore::instance()->settings();
settings->beginGroup(Constants::OBJECT_VIEWER_SECTION); settings->beginGroup(Constants::OBJECT_VIEWER_SECTION);
_PackedSheetPath = settings->value(Constants::SOUND_PACKED_SHEET_PATH, "").toString().toStdString(); _PackedSheetPath = settings->value(Constants::SOUND_PACKED_SHEET_PATH, "").toString().toUtf8();
_SamplePath = settings->value(Constants::SOUND_SAMPLE_PATH, "").toString().toStdString(); _SamplePath = settings->value(Constants::SOUND_SAMPLE_PATH, "").toString().toUtf8();
_AudioMixer->setSamplePath(_SamplePath); _AudioMixer->setSamplePath(_SamplePath);
_AudioMixer->setPackedSheetOption(_PackedSheetPath, true); _AudioMixer->setPackedSheetOption(_PackedSheetPath, true);
std::vector<std::string> devices; std::vector<std::string> 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); _AudioMixer->getDevices(devices);
NLSOUND::UAudioMixer::CInitInfo audioInfo; NLSOUND::UAudioMixer::CInitInfo audioInfo;
audioInfo.AutoLoadSample = settings->value(Constants::SOUND_AUTO_LOAD_SAMPLE, true).toBool(); 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.ForceSoftware = settings->value(Constants::SOUND_FORCE_SOFTWARE, false).toBool();
audioInfo.MaxTrack = settings->value(Constants::SOUND_MAX_TRACK, 48).toInt(); audioInfo.MaxTrack = settings->value(Constants::SOUND_MAX_TRACK, 48).toInt();
audioInfo.UseADPCM = settings->value(Constants::SOUND_USE_ADCPM, false).toBool(); 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); _AudioMixer->setLowWaterMark(1);
settings->endGroup(); settings->endGroup();

View file

@ -145,13 +145,13 @@ void CVegetableDensityPage::browseShapeVeget()
if (!fileName.isEmpty()) if (!fileName.isEmpty())
{ {
// Add search path for the .veget // Add search path for the .veget
NLMISC::CPath::addSearchPath (NLMISC::CFile::getPath(fileName.toStdString())); NLMISC::CPath::addSearchPath (NLMISC::CFile::getPath(fileName.toUtf8().constData()));
try try
{ {
// update shapeName and view // update shapeName and view
_Vegetable->ShapeName = NLMISC::CFile::getFilename(fileName.toStdString()); _Vegetable->ShapeName = NLMISC::CFile::getFilename(fileName.toUtf8().constData());
_ui.meshLineEdit->setText(QString(NLMISC::CFile::getFilename(fileName.toStdString()).c_str())); _ui.meshLineEdit->setText(QString::fromUtf8(_Vegetable->ShapeName.c_str()));
// update the name in the list-box // update the name in the list-box
Q_EMIT vegetNameChanged(); Q_EMIT vegetNameChanged();

View file

@ -68,7 +68,7 @@ void CVegetableDialog::loadVegetset()
{ {
NL3D::CTileVegetableDesc vegetSet; NL3D::CTileVegetableDesc vegetSet;
// if succes to load the 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. // Delete all vegetables.
Modules::veget().clearVegetables(); Modules::veget().clearVegetables();
@ -94,7 +94,7 @@ void CVegetableDialog::appendVegetset()
{ {
NL3D::CTileVegetableDesc vegetSet; NL3D::CTileVegetableDesc vegetSet;
// if succes to load the 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. // Do not Delete any vegetables.
// build them from list. // build them from list.
@ -124,7 +124,7 @@ void CVegetableDialog::saveVegetset()
{ {
NLMISC::COFile f; NLMISC::COFile f;
if( f.open(fileName.toStdString()) ) if( f.open(fileName.toUtf8().constData()) )
{ {
try try
{ {
@ -226,7 +226,7 @@ void CVegetableDialog::loadVegetdesc()
{ {
NLMISC::CIFile f; NLMISC::CIFile f;
if( f.open(fileName.toStdString()) ) if( f.open(fileName.toUtf8().constData()) )
{ {
NL3D::CVegetable veget; NL3D::CVegetable veget;
try try
@ -272,7 +272,7 @@ void CVegetableDialog::saveVegetdesc()
{ {
NLMISC::COFile f; NLMISC::COFile f;
if( f.open(fileName.toStdString()) ) if( f.open(fileName.toUtf8().constData()) )
{ {
try try
{ {

View file

@ -596,15 +596,15 @@ void CVegetableEditor::loadLandscapeSetup()
QSettings *settings = Core::ICore::instance()->settings(); QSettings *settings = Core::ICore::instance()->settings();
settings->beginGroup(Constants::OBJECT_VIEWER_SECTION); settings->beginGroup(Constants::OBJECT_VIEWER_SECTION);
_VegetableLandscapeTileBank = settings->value(Constants::VEGET_TILE_BANK, "").toString().toStdString(); _VegetableLandscapeTileBank = settings->value(Constants::VEGET_TILE_BANK, "").toString().toUtf8();
_VegetableLandscapeTileFarBank = settings->value(Constants::VEGET_TILE_FAR_BANK, "").toString().toStdString(); _VegetableLandscapeTileFarBank = settings->value(Constants::VEGET_TILE_FAR_BANK, "").toString().toUtf8();
_CoarseMeshTexture = settings->value(Constants::COARSE_MESH_TEXTURE, "").toString().toStdString(); _CoarseMeshTexture = settings->value(Constants::COARSE_MESH_TEXTURE, "").toString().toUtf8();
_VegetableTexture = settings->value(Constants::VEGET_TEXTURE, "").toString().toStdString(); _VegetableTexture = settings->value(Constants::VEGET_TEXTURE, "").toString().toUtf8();
QStringList list = settings->value(Constants::VEGET_LANDSCAPE_ZONES).toStringList(); QStringList list = settings->value(Constants::VEGET_LANDSCAPE_ZONES).toStringList();
_VegetableLandscapeZoneNames.clear(); _VegetableLandscapeZoneNames.clear();
for (int i = 0; i < list.size(); ++i) for (int i = 0; i < list.size(); ++i)
_VegetableLandscapeZoneNames.push_back(list[i].toStdString()); _VegetableLandscapeZoneNames.push_back(list[i].toUtf8().constData());
settings->endGroup(); settings->endGroup();
} }

View file

@ -119,7 +119,7 @@ void SheetBuilderDialog::buildSheet()
bool clean = chckClean->isChecked(); bool clean = chckClean->isChecked();
string outputFileName(outputFile.toStdString()); string outputFileName(outputFile.toUtf8());
if (outputFileName.empty()) if (outputFileName.empty())
{ {
@ -129,11 +129,11 @@ void SheetBuilderDialog::buildSheet()
list<string> inputDirs; list<string> inputDirs;
Q_FOREACH (QString str, paths) Q_FOREACH (QString str, paths)
inputDirs.push_back(str.toStdString()); inputDirs.push_back(str.toUtf8().constData());
Q_FOREACH (QString str, extensions) 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) // get the current associations (read the sheet_id and fill the working structures)

View file

@ -40,7 +40,7 @@ namespace TranslationManager
void CEditorPhrase::open(QString filename) void CEditorPhrase::open(QString filename)
{ {
std::vector<STRING_MANAGER::TPhrase> phrases; std::vector<STRING_MANAGER::TPhrase> phrases;
if(readPhraseFile(filename.toStdString(), phrases, false)) if(readPhraseFile(filename.toUtf8().constData(), phrases, false))
{ {
text_edit = new CTextEdit(this); text_edit = new CTextEdit(this);
text_edit->setUndoStack(current_stack); text_edit->setUndoStack(current_stack);

View file

@ -37,7 +37,7 @@ namespace TranslationManager
void CEditorWorksheet::open(QString filename) void CEditorWorksheet::open(QString filename)
{ {
STRING_MANAGER::TWorksheet wk_file; 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; bool hasHashValue = false;
table_editor = new QTableWidget(); table_editor = new QTableWidget();
@ -149,7 +149,7 @@ void CEditorWorksheet::save()
void CEditorWorksheet::saveAs(QString filename) void CEditorWorksheet::saveAs(QString filename)
{ {
STRING_MANAGER::TWorksheet new_file, wk_file; STRING_MANAGER::TWorksheet new_file, wk_file;
loadExcelSheet(current_file.toStdString(), wk_file, true); loadExcelSheet(current_file.toUtf8().constData(), wk_file, true);
// set columns // set columns
new_file.resize(new_file.size() + 1); new_file.resize(new_file.size() + 1);
for(unsigned int i = 0; i < wk_file.ColCount; i++) for(unsigned int i = 0; i < wk_file.ColCount; i++)
@ -185,7 +185,7 @@ void CEditorWorksheet::saveAs(QString filename)
makeHashCode(wk_file, true); makeHashCode(wk_file, true);
} }
ucstring s = prepareExcelSheet(new_file); ucstring s = prepareExcelSheet(new_file);
NLMISC::CI18N::writeTextFile(filename.toStdString(), s, false); NLMISC::CI18N::writeTextFile(filename.toUtf8().constData(), s, false);
current_file = filename; current_file = filename;
setCurrentFile(filename); setCurrentFile(filename);
} }
@ -299,29 +299,29 @@ void CEditorWorksheet::extractWords(QString filename, QString columnId, IWordLis
// **** Load the excel sheet // **** Load the excel sheet
// load // load
STRING_MANAGER::TWorksheet workSheet; 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; return;
} }
// get the key column index // get the key column index
uint keyColIndex = 0; 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; return;
} }
// get the name column index // get the name column index
uint nameColIndex; uint nameColIndex;
if(!workSheet.findCol(ucstring("name"), 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; return;
} }
// **** List all words with the builder given // **** List all words with the builder given
std::vector<std::string> allWords; std::vector<std::string> allWords;
if(!wordListBuilder.buildWordList(allWords, filename.toStdString())) if(!wordListBuilder.buildWordList(allWords, filename.toUtf8().constData()))
{ {
return; return;
} }
@ -380,7 +380,7 @@ bool CEditorWorksheet::compareWorksheetFile(QString filename)
{ {
STRING_MANAGER::TWorksheet wk_file; STRING_MANAGER::TWorksheet wk_file;
int colIndex = 0; 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")) 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++) 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); 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()); nlwarning(itemC.toString().c_str());
return false; return false;
} }
@ -412,7 +413,7 @@ bool CEditorWorksheet::compareWorksheetFile(QString filename)
void CEditorWorksheet::mergeWorksheetFile(QString filename) void CEditorWorksheet::mergeWorksheetFile(QString filename)
{ {
STRING_MANAGER::TWorksheet wk_file; 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; bool hasHashValue = false;
int colIndex = 0; int colIndex = 0;

View file

@ -300,8 +300,8 @@ void CMainWindow::initializeSettings(bool georges = false)
{ {
if(georges == true && initialize_settings["georges"] == false) if(georges == true && initialize_settings["georges"] == false)
{ {
NLMISC::CPath::addSearchPath(level_design_path.toStdString() + "/DFN", true, false); NLMISC::CPath::addSearchPath(std::string(level_design_path.toUtf8().constData()) + "/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()) + "/Game_elem/Creature", true, false);
initialize_settings["georges"] = true; initialize_settings["georges"] = true;
} }
@ -357,34 +357,34 @@ void CMainWindow::extractWords(QString typeq)
{ {
column_name = "item ID"; column_name = "item ID";
builderS.SheetExt = "sitem"; 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; isSheet = true;
} }
else if(typeq.toAscii() == Constants::WK_CREATURE) else if(typeq.toAscii() == Constants::WK_CREATURE)
{ {
column_name = "creature ID"; column_name = "creature ID";
builderS.SheetExt = "creature"; 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; isSheet = true;
} }
else if(typeq.toAscii() == Constants::WK_SBRICK) else if(typeq.toAscii() == Constants::WK_SBRICK)
{ {
column_name = "sbrick ID"; column_name = "sbrick ID";
builderS.SheetExt = "sbrick"; 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; isSheet = true;
} }
else if(typeq.toAscii() == Constants::WK_SPHRASE) else if(typeq.toAscii() == Constants::WK_SPHRASE)
{ {
column_name = "sphrase ID"; column_name = "sphrase ID";
builderS.SheetExt = "sphrase"; 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; isSheet = true;
} }
else if(typeq.toAscii() == Constants::WK_PLACE) else if(typeq.toAscii() == Constants::WK_PLACE)
{ {
column_name = "placeId"; column_name = "placeId";
builderP.PrimPath = primitives_path.toStdString(); builderP.PrimPath = primitives_path.toUtf8();
builderP.PrimFilter.push_back("region_*.primitive"); builderP.PrimFilter.push_back("region_*.primitive");
builderP.PrimFilter.push_back("indoors_*.primitive"); builderP.PrimFilter.push_back("indoors_*.primitive");
isSheet = false; isSheet = false;
@ -428,7 +428,7 @@ void CMainWindow::extractBotNames()
QApplication::setOverrideCursor(Qt::WaitCursor); QApplication::setOverrideCursor(Qt::WaitCursor);
initializeSettings(true); 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(); QApplication::restoreOverrideCursor();
} }
} }
@ -627,7 +627,7 @@ std::list<std::string> CMainWindow::convertQStringList(QStringList listq)
Q_FOREACH(QString text, listq) Q_FOREACH(QString text, listq)
{ {
stdlist.push_back(text.toStdString()); stdlist.push_back(text.toUtf8().constData());
} }
return stdlist; return stdlist;
} }
@ -635,7 +635,7 @@ std::list<std::string> CMainWindow::convertQStringList(QStringList listq)
bool CMainWindow::isWorksheetEditor(QString filename) bool CMainWindow::isWorksheetEditor(QString filename)
{ {
STRING_MANAGER::TWorksheet wk_file; 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) if(wk_file.ColCount > 1)
return true; return true;
@ -646,7 +646,7 @@ bool CMainWindow::isWorksheetEditor(QString filename)
bool CMainWindow::isPhraseEditor(QString filename) bool CMainWindow::isPhraseEditor(QString filename)
{ {
vector<STRING_MANAGER::TPhrase> phrases; vector<STRING_MANAGER::TPhrase> phrases;
return readPhraseFile(filename.toStdString(), phrases, false); return readPhraseFile(filename.toUtf8().constData(), phrases, false);
} }
} /* namespace TranslationManager */ } /* namespace TranslationManager */

View file

@ -235,7 +235,7 @@ void CTile_browser_dlg::on_actionAddTile_triggered(bool checked)
{ {
tileId = browserModel.addTile128 (); tileId = browserModel.addTile128 ();
fileName = QDir::toNativeSeparators(fileNames.at(i)); 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); browserModel.removeTile128 (tileId);
break; break;
@ -247,7 +247,7 @@ void CTile_browser_dlg::on_actionAddTile_triggered(bool checked)
{ {
tileId = browserModel.addTile256 (); tileId = browserModel.addTile256 ();
fileName = QDir::toNativeSeparators(fileNames.at(i)); 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); browserModel.removeTile256 (tileId);
break; 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(); 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;
} }
break; break;
@ -315,7 +315,7 @@ void CTile_browser_dlg::on_actionReplaceImage_triggered(bool checked)
for (int i=0; i<ui.tileBrowserListView->selectionModel()->selectedRows().count(); i++) for (int i=0; i<ui.tileBrowserListView->selectionModel()->selectedRows().count(); i++)
{ {
int tileId = (ui.tileBrowserListView->selectionModel()->selectedRows().at(i).data(Qt::UserRole + 1)).toInt(); 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;
} }
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(); int tileId = (ui.tileBrowserListView->selectionModel()->selectedRows().at(i).data(Qt::UserRole + 1)).toInt();
if ( tileTextureButtonGroup->checkedId() != Alpha ) 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; break;
} }
else else
@ -334,7 +334,7 @@ void CTile_browser_dlg::on_actionReplaceImage_triggered(bool checked)
int rot = CTile_rotation_dlg::getRotation(this, &rotationOk); int rot = CTile_rotation_dlg::getRotation(this, &rotationOk);
if (rotationOk) if (rotationOk)
{ {
if ( ! browserModel.setTileTransitionAlpha (tileId, fileName.toStdString(), rot) ) if ( ! browserModel.setTileTransitionAlpha (tileId, fileName.toUtf8().constData(), rot) )
break; break;
} }
} }
@ -344,7 +344,7 @@ void CTile_browser_dlg::on_actionReplaceImage_triggered(bool checked)
for (int i=0; i<ui.tileBrowserListView->selectionModel()->selectedRows().count(); i++) for (int i=0; i<ui.tileBrowserListView->selectionModel()->selectedRows().count(); i++)
{ {
int tileId = (ui.tileBrowserListView->selectionModel()->selectedRows().at(i).data(Qt::UserRole + 1)).toInt(); 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;
} }
break; break;
@ -444,13 +444,13 @@ void CTile_browser_dlg::on_batchLoadPushButton_clicked()
QString batchNumber = transitionNumber.rightJustified(2, '0'); QString batchNumber = transitionNumber.rightJustified(2, '0');
QString nextBaseName = baseName + batchNumber; QString nextBaseName = baseName + batchNumber;
QString nextFileName = QDir::toNativeSeparators(fi.absolutePath()) + QDir::separator() + nextBaseName + QString(".") + fi.suffix(); 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 // Close the file and add the tile if opened
if (pFile) if (pFile)
{ {
fclose (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 // End
break; break;
@ -545,7 +545,7 @@ void CTile_browser_dlg::on_exportBorderPushButton_clicked()
try try
{ {
COFile file; COFile file;
if (file.open (fileName.toStdString().c_str())) if (file.open (fileName.toUtf8().constData()))
{ {
// Export // Export
bitmap.writeTGA (file, 32); bitmap.writeTGA (file, 32);
@ -594,7 +594,7 @@ void CTile_browser_dlg::on_importBorderPushButton_clicked()
try try
{ {
CIFile file; CIFile file;
if (file.open (fileName.toStdString().c_str())) if (file.open (fileName.toUtf8().constData()))
{ {
// Export // Export
bitmap.load (file); bitmap.load (file);

View file

@ -103,7 +103,7 @@ void CTile_edit_dlg::on_addLandPushButton_clicked()
} }
else else
{ {
tileBank.addLand( text.toStdString() ); tileBank.addLand( text.toUtf8().constData() );
ui.landListWidget->addItem(text); ui.landListWidget->addItem(text);
ui.landListWidget->setCurrentRow(ui.landListWidget->count() - 1); ui.landListWidget->setCurrentRow(ui.landListWidget->count() - 1);
@ -138,7 +138,7 @@ void CTile_edit_dlg::on_editLandPushButton_clicked()
for (int i=0; i<items.count(); i++) for (int i=0; i<items.count(); i++)
{ {
QString rString = items[i]; QString rString = items[i];
tileBank.getLand(nindex)->addTileSet( rString.toStdString().c_str() ); tileBank.getLand(nindex)->addTileSet( rString.toUtf8().constData() );
} }
} }
} }
@ -176,7 +176,7 @@ void CTile_edit_dlg::on_addTileSetPushButton_clicked()
} }
else else
{ {
tileBank.addTileSet( text.toStdString() ); tileBank.addTileSet( text.toUtf8().constData() );
ui.tileSetListWidget->addItem(text); ui.tileSetListWidget->addItem(text);
ui.tileSetListWidget->setCurrentRow(ui.tileSetListWidget->count() - 1); ui.tileSetListWidget->setCurrentRow(ui.tileSetListWidget->count() - 1);
@ -239,7 +239,7 @@ void CTile_edit_dlg::on_chooseVegetPushButton_clicked()
if (!fileName.isEmpty()) if (!fileName.isEmpty())
{ {
QFileInfo fi(fileName); QFileInfo fi(fileName);
tileBank.getTileSet (nindex)->setTileVegetableDescFileName (fi.fileName().toStdString()); tileBank.getTileSet (nindex)->setTileVegetableDescFileName (fi.fileName().toUtf8().constData());
ui.chooseVegetPushButton->setText(fi.fileName()); ui.chooseVegetPushButton->setText(fi.fileName());
} }
} }
@ -347,7 +347,7 @@ void CTile_edit_dlg::on_loadPushButton_clicked()
if (!fileName.isEmpty()) if (!fileName.isEmpty())
{ {
CIFile stream; CIFile stream;
if ( stream.open( fileName.toStdString().c_str() ) ) if ( stream.open( fileName.toUtf8().constData() ) )
{ {
ui.landListWidget->clear(); ui.landListWidget->clear();
ui.tileSetListWidget->clear(); ui.tileSetListWidget->clear();
@ -383,7 +383,7 @@ void CTile_edit_dlg::on_loadPushButton_clicked()
void CTile_edit_dlg::on_savePushButton_clicked() void CTile_edit_dlg::on_savePushButton_clicked()
{ {
string fullPath = this->mainFile.absoluteFilePath().toStdString(); string fullPath = this->mainFile.absoluteFilePath().toUtf8();
if ( !fullPath.empty() ) if ( !fullPath.empty() )
{ {
COFile stream; COFile stream;
@ -411,7 +411,7 @@ void CTile_edit_dlg::on_saveAsPushButton_clicked()
ui.savePushButton->setEnabled(true); ui.savePushButton->setEnabled(true);
string fullPath = this->mainFile.absoluteFilePath().toStdString(); string fullPath = this->mainFile.absoluteFilePath().toUtf8();
if ( !fullPath.empty() ) if ( !fullPath.empty() )
{ {
COFile stream; COFile stream;
@ -445,7 +445,7 @@ void CTile_edit_dlg::on_exportPushButton_clicked()
copy.cleanUnusedData (); copy.cleanUnusedData ();
QFileInfo fileInfo(fileName); QFileInfo fileInfo(fileName);
string fullPath = fileInfo.absoluteFilePath().toStdString(); string fullPath = fileInfo.absoluteFilePath().toUtf8();
if ( !fullPath.empty() ) if ( !fullPath.empty() )
{ {
COFile stream; COFile stream;
@ -524,7 +524,7 @@ void CTile_edit_dlg::on_absolutePathPushButton_clicked()
if (bitmapPath!="") if (bitmapPath!="")
{ {
// Check the path // Check the path
if ( CheckPath( bitmapPath, path.toStdString().c_str() ) == false ) if ( CheckPath( bitmapPath, path.toUtf8() ) == false )
{ {
// Bad path // Bad path
goodPath=false; goodPath=false;
@ -552,7 +552,7 @@ void CTile_edit_dlg::on_absolutePathPushButton_clicked()
if (strcmp (bitmapPath, "")!=0) if (strcmp (bitmapPath, "")!=0)
{ {
// Check the path // Check the path
if (CheckPath( bitmapPath, path.toStdString().c_str() )==false) if (CheckPath( bitmapPath, path.toUtf8() )==false)
{ {
// Bad path // Bad path
goodPath=false; goodPath=false;
@ -593,7 +593,7 @@ void CTile_edit_dlg::on_absolutePathPushButton_clicked()
if (bitmapPath!="") if (bitmapPath!="")
{ {
// Remove the absolute path // Remove the absolute path
bool res=RemovePath (bitmapPath, path.toStdString().c_str()); bool res=RemovePath (bitmapPath, path.toUtf8());
nlassert (res); nlassert (res);
// Set the bitmap // Set the bitmap
@ -613,7 +613,7 @@ void CTile_edit_dlg::on_absolutePathPushButton_clicked()
if (bitmapPath!="") if (bitmapPath!="")
{ {
// Remove the absolute path // Remove the absolute path
bool res=RemovePath (bitmapPath, path.toStdString().c_str()); bool res=RemovePath (bitmapPath, path.toUtf8());
nlassert (res); nlassert (res);
// Set the bitmap // Set the bitmap
@ -633,7 +633,7 @@ void CTile_edit_dlg::on_absolutePathPushButton_clicked()
if (goodPath) if (goodPath)
{ {
// Change the abs path of the bank // Change the abs path of the bank
tileBank.setAbsPath (path.toStdString()); tileBank.setAbsPath (path.toUtf8().constData());
// Change the bouton text // Change the bouton text
ui.absolutePathPushButton->setText(path); ui.absolutePathPushButton->setText(path);

View file

@ -151,7 +151,7 @@ void CWords_dicDlg::on_findButton_clicked()
{ {
QString inputStr = ui.lookUpEdit->text(); QString inputStr = ui.lookUpEdit->text();
bool showAll = ui.showAllCheckBox->isChecked(); bool showAll = ui.showAllCheckBox->isChecked();
lookUp( inputStr.toStdString(), showAll ); lookUp( inputStr.toUtf8().constData(), showAll );
} }
void CWords_dicDlg::on_lookUpEdit_textChanged() void CWords_dicDlg::on_lookUpEdit_textChanged()
@ -191,7 +191,7 @@ void CWords_dicDlg::on_fileListButton_clicked()
void CWords_dicDlg::on_resultsListWidget_itemSelectionChanged() void CWords_dicDlg::on_resultsListWidget_itemSelectionChanged()
{ {
QListWidgetItem *i = ui.resultsListWidget->currentItem(); QListWidgetItem *i = ui.resultsListWidget->currentItem();
copyIntoClipboard( i->text().toStdString() ); copyIntoClipboard( i->text().toUtf8().constData() );
} }

View file

@ -152,7 +152,7 @@ retry:
CLoginCookie c; CLoginCookie c;
c.set((uint32)(uintptr_t)from, rand(), uid); 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; if(!reason.empty()) break;
reason = sqlQuery("select * from shard where Online>0 and ClientApplication='"+application+"'", nbrow, row, result); reason = sqlQuery("select * from shard where Online>0 and ClientApplication='"+application+"'", nbrow, row, result);

View file

@ -72,8 +72,8 @@ void CNelLauncherDlg::clickedSignUp()
void CNelLauncherDlg::clickedLogin() void CNelLauncherDlg::clickedLogin()
{ {
std::string username = leUsername->text().toStdString(); std::string username = leUsername->text().toUtf8();
std::string password = lePassword->text().toStdString(); std::string password = lePassword->text().toUtf8();
nlinfo("received login attempt for %s with %s", username.c_str(), password.c_str()); nlinfo("received login attempt for %s with %s", username.c_str(), password.c_str());

View file

@ -98,7 +98,7 @@ namespace NLQT {
void CConfiguration::addLeveldesignPath() void CConfiguration::addLeveldesignPath()
{ {
std::vector<std::string> list; std::vector<std::string> list;
list.push_back(Modules::config().getValue("LeveldesignPath", QString("").toStdString())); list.push_back(Modules::config().getValue("LeveldesignPath", std::string()));
addSearchPaths(&list); addSearchPaths(&list);
} }

View file

@ -96,7 +96,7 @@ namespace NLQT
//QString min = QString(type->getMin().c_str()); //QString min = QString(type->getMin().c_str());
//QString max = QString(type->getMax().c_str()); //QString max = QString(type->getMax().c_str());
//QString inc = QString(type->getIncrement().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 // TODO: use saved min/max values
editor->setMinimum(-99999); editor->setMinimum(-99999);
@ -203,7 +203,7 @@ namespace NLQT
else else
{ {
nldebug(QString("setModelData from %1 to %2") 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); model->setData(index, value, Qt::EditRole);
} }
} }
@ -224,7 +224,7 @@ namespace NLQT
else else
{ {
nldebug(QString("setModelData from %1 to %2") 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); model->setData(index, value, Qt::EditRole);
} }
break; break;
@ -241,7 +241,7 @@ namespace NLQT
else else
{ {
nldebug(QString("setModelData from %1 to %2") 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); model->setData(index, value, Qt::EditRole);
} }
break; break;
@ -262,7 +262,7 @@ namespace NLQT
else else
{ {
nldebug(QString("setModelData from %1 to %2") 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); model->setData(index, value, Qt::EditRole);
} }
break; break;

View file

@ -120,10 +120,8 @@ namespace NLQT
{ {
if (elmt->isAtom()) 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") nldebug("array element string %s %s", itemData[0].toString().toUtf8().constData(), value.toString().toUtf8().constData());
.arg(itemData[0].toString()).arg(value.toString())
.toStdString().c_str());
} }
} }
} }
@ -131,18 +129,14 @@ namespace NLQT
else else
{ {
if(parentItem->formElm->setValueByName( if(parentItem->formElm->setValueByName(
value.toString().toStdString().c_str(), value.toString().toUtf8().constData(),
itemData[0].toString().toStdString().c_str())) itemData[0].toString().toUtf8().constData()))
{ {
nldebug(QString("string %1 %2") nldebug("string %s %s", itemData[0].toString().toUtf8().constData(), value.toString().toUtf8().constData());
.arg(itemData[0].toString()).arg(value.toString())
.toStdString().c_str());
} }
else else
{ {
nldebug(QString("FAILED string %1 %2") nldebug("FAILED string %s %s", itemData[0].toString().toUtf8().constData(), value.toString().toUtf8().constData());
.arg(itemData[0].toString()).arg(value.toString())
.toStdString().c_str());
} }
} }
break; break;

View file

@ -93,29 +93,29 @@ namespace NLQT
CForm* CGeorgesTreeViewDialog::getFormByName(const QString formName) 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 else
{ {
CForm *form = 0; CForm *form = 0;
// Load the DFN // Load the DFN
std::string extStr = NLMISC::CFile::getExtension( formName.toStdString() ); std::string extStr = NLMISC::CFile::getExtension( formName.toUtf8().constData() );
QString dfnName = QString("%1.dfn").arg(extStr.c_str()); std::string dfnName = extStr + ".dfn";
UFormDfn *formdfn; UFormDfn *formdfn;
if (NLMISC::CPath::exists(dfnName.toStdString())) if (NLMISC::CPath::exists(dfnName))
{ {
formdfn = _georges->loadFormDfn (dfnName.toStdString()); formdfn = _georges->loadFormDfn (dfnName);
if (!formdfn) if (!formdfn)
{ {
nlwarning("Failed to load dfn: %s", dfnName.toStdString().c_str()); nlwarning("Failed to load dfn: %s", dfnName.c_str());
return 0; return 0;
} }
} }
else else
{ {
nlwarning("Cannot find dfn: %s", dfnName.toStdString().c_str()); nlwarning("Cannot find dfn: %s", dfnName.c_str());
return 0; return 0;
} }
@ -175,7 +175,7 @@ namespace NLQT
nlinfo("typ's %d",deps["typ"].count()); nlinfo("typ's %d",deps["typ"].count());
nlinfo("dfn's %d",deps["dfn"].count()); nlinfo("dfn's %d",deps["dfn"].count());
//nlwarning(strList.join(";").toStdString().c_str()); //nlwarning(strList.join(";").toUtf8().constData());
if (root) if (root)
{ {
loadedForm = _form->getFilename().c_str(); loadedForm = _form->getFilename().c_str();
@ -222,7 +222,7 @@ namespace NLQT
{ {
COFile file; COFile file;
std::string s = CPath::lookup(loadedForm.toStdString(), false); std::string s = CPath::lookup(loadedForm.toUtf8().constData(), false);
if (file.open (s)) if (file.open (s))
{ {
try try
@ -313,7 +313,7 @@ namespace NLQT
CFormItem *item = m->getItem(in2); CFormItem *item = m->getItem(in2);
QString value = item->data(1).toString(); 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")) if(value.contains(".tga") || value.contains(".png"))
{ {
@ -341,7 +341,7 @@ namespace NLQT
{ {
Modules::objViewInt()->resetScene(); Modules::objViewInt()->resetScene();
//Modules::config().configRemapExtensions(); //Modules::config().configRemapExtensions();
Modules::objViewInt()->loadMesh(path.toStdString(),""); Modules::objViewInt()->loadMesh(path.toUtf8().constData(),"");
} }
return; return;
} }

View file

@ -140,13 +140,13 @@ namespace NLQT
CFormItem *item = getItem(in); CFormItem *item = getItem(in);
QString value = item->data(1).toString(); 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 (value.contains(".shape"))
{ {
if (Modules::objViewInt()) if (Modules::objViewInt())
{ {
QIcon *icon = Modules::objViewInt()->saveOneImage(value.toStdString()); QIcon *icon = Modules::objViewInt()->saveOneImage(value.toUtf8().constData());
if (icon) if (icon)
{ {
if(icon->isNull()) if(icon->isNull())
@ -162,7 +162,7 @@ namespace NLQT
} }
else if(value.contains(".tga") || value.contains(".png")) 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()) if(path.isEmpty())
{ {
path = ":/images/pqrticles.png"; path = ":/images/pqrticles.png";
@ -185,7 +185,7 @@ namespace NLQT
{ {
if (Modules::objViewInt()) if (Modules::objViewInt())
{ {
QIcon *icon = Modules::objViewInt()->saveOneImage(value.toStdString()); QIcon *icon = Modules::objViewInt()->saveOneImage(value.toUtf8().constData());
if (icon) if (icon)
{ {
if(icon->isNull()) if(icon->isNull())
@ -201,7 +201,7 @@ namespace NLQT
} }
else if(value.contains(".tga") || value.contains(".png")) 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()) if(path.isEmpty())
{ {
path = ":/images/pqrticles.png"; path = ":/images/pqrticles.png";
@ -401,13 +401,13 @@ namespace NLQT
switch (type->getType()) switch (type->getType())
{ {
case UType::UnsignedInt: 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; elmtType.append("_uint");break;
case UType::SignedInt: 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; elmtType.append("_sint");break;
case UType::Double: 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; elmtType.append("_double");break;
case UType::String: case UType::String:
elmtType.append("_string");break; elmtType.append("_string");break;

View file

@ -42,7 +42,7 @@ namespace NLQT
CFormItem *item = smodel->getItem(index); CFormItem *item = smodel->getItem(index);
//qDebug() << smodel->showParents() << (item->valueFrom() == NLGEORGES::UFormElm::NodeParentForm); //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->valueFrom(),
// item->nodeFrom(), // item->nodeFrom(),
// smodel->showParents(), // smodel->showParents(),

View file

@ -96,7 +96,7 @@ sint main(int argc, char **argv)
#if defined(NL_OS_MAC) #if defined(NL_OS_MAC)
QDir::setCurrent(qApp->applicationDirPath() + QString("/../Resources")); QDir::setCurrent(qApp->applicationDirPath() + QString("/../Resources"));
CLibrary::addLibPath( CLibrary::addLibPath(
(qApp->applicationDirPath() + QString("/../PlugIns/nel")).toStdString()); (qApp->applicationDirPath() + QString("/../PlugIns/nel")).toUtf8().constData());
#endif #endif
// go nel! // go nel!

View file

@ -63,7 +63,7 @@ namespace NLQT
// load and set leveldesign path from config // load and set leveldesign path from config
_leveldesignPath = Modules::config(). _leveldesignPath = Modules::config().
getValue("LeveldesignPath", QString("").toStdString()).c_str(); getValue("LeveldesignPath", std::string()).c_str();
QFileInfo info(_leveldesignPath); QFileInfo info(_leveldesignPath);
if (!info.isDir()) if (!info.isDir())
_leveldesignPath = ""; _leveldesignPath = "";
@ -229,7 +229,7 @@ namespace NLQT
setCursor(Qt::WaitCursor); setCursor(Qt::WaitCursor);
//TODO: if not exists open FileDialog SaveAs... //TODO: if not exists open FileDialog SaveAs...
if(!CPath::exists(_currentView->loadedForm.toStdString())) if(!CPath::exists(_currentView->loadedForm.toUtf8().constData()))
{ {
QString fileName = QFileDialog::getSaveFileName( QString fileName = QFileDialog::getSaveFileName(
this, this,
@ -239,7 +239,7 @@ namespace NLQT
QFile file(fileName); QFile file(fileName);
file.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text); file.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text);
file.close(); file.close();
CPath::addSearchFile(fileName.toStdString()); CPath::addSearchFile(fileName.toUtf8().constData());
//QFileInfo info = QFileInfo(file); //QFileInfo info = QFileInfo(file);
//m->setData(in2, info.fileName()); //m->setData(in2, info.fileName());
} }
@ -417,7 +417,7 @@ namespace NLQT
//tabList = _mainWindow->findChildren<QTabBar *>(); //tabList = _mainWindow->findChildren<QTabBar *>();
//nlinfo(QString("%1 %2").arg(QString::number((int)this,16)). //nlinfo(QString("%1 %2").arg(QString::number((int)this,16)).
// arg(QString::number((int)_mainWindow,16)). // arg(QString::number((int)_mainWindow,16)).
// toStdString().c_str()); // toUtf8().constData());
QTabBar *tb = 0; QTabBar *tb = 0;
Q_FOREACH(QTabBar *tabBar, tabList) Q_FOREACH(QTabBar *tabBar, tabList)
{ {
@ -427,11 +427,11 @@ namespace NLQT
// arg(QString::number((int)tabBar,16)). // arg(QString::number((int)tabBar,16)).
// arg(QString::number((int)tabBar->parentWidget(),16)). // arg(QString::number((int)tabBar->parentWidget(),16)).
// arg(QString::number((int)tabBar->parent(),16)). // arg(QString::number((int)tabBar->parent(),16)).
// toStdString().c_str()); // toUtf8().constData());
for (int i = 0; i < tabBar->count(); i++) for (int i = 0; i < tabBar->count(); i++)
{ {
QString currentTab = tabBar->tabText(i); QString currentTab = tabBar->tabText(i);
//nlinfo(currentTab.toStdString().c_str()); //nlinfo(currentTab.toUtf8().constData());
} }
tb = tabBar; tb = tabBar;
} }
@ -440,7 +440,7 @@ namespace NLQT
void CMainWindow::tabChanged(int index) void CMainWindow::tabChanged(int index)
{ {
nlinfo(QString("%1").arg(index).toStdString().c_str()); nlinfo("%d", index);
if (index == -1) if (index == -1)
{ {
setWindowTitle("Qt Georges Editor"); setWindowTitle("Qt Georges Editor");
@ -448,7 +448,7 @@ namespace NLQT
} }
QTabBar *tb = getTabBar(); QTabBar *tb = getTabBar();
//nlinfo(QString("%1").arg(index).toStdString().c_str()); //nlinfo(QString("%1").arg(index).toUtf8().constData());
Q_FOREACH(CGeorgesTreeViewDialog* dlg, _treeViewList) Q_FOREACH(CGeorgesTreeViewDialog* dlg, _treeViewList)
{ {
@ -456,7 +456,7 @@ namespace NLQT
{ {
//nlinfo(QString("%1 modified %2").arg(tb->tabText(index)). //nlinfo(QString("%1 modified %2").arg(tb->tabText(index)).
// arg(dlg->modified()). // arg(dlg->modified()).
// toStdString().c_str()); // toUtf8().constData());
_currentView = dlg; _currentView = dlg;
setWindowTitle("Qt Georges Editor - " + tb->tabText(index)); setWindowTitle("Qt Georges Editor - " + tb->tabText(index));
_saveAction->setEnabled(dlg->modified()); _saveAction->setEnabled(dlg->modified());

View file

@ -68,12 +68,12 @@ bool Modules::loadPlugin()
// if(!QFile::exists(pluginPath + pluginFilename)) // if(!QFile::exists(pluginPath + pluginFilename))
// { // {
// nlwarning("Cannot find %s in %s, fallback to working dir", // 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 = ""; // pluginPath = "";
// //
// Q_FOREACH (QString path, qApp->libraryPaths()) // Q_FOREACH (QString path, qApp->libraryPaths())
// nlwarning("libraryPaths %s", path.toStdString().c_str()); // nlwarning("libraryPaths %s", path.toUtf8().constData());
// } // }
QDir pluginsDir(pluginPath); QDir pluginsDir(pluginPath);
@ -86,20 +86,20 @@ bool Modules::loadPlugin()
if (_objViewerInterface) if (_objViewerInterface)
{ {
nlinfo("Loaded %s", nlinfo("Loaded %s",
pluginsDir.absoluteFilePath(pluginFilename).toStdString().c_str()); pluginsDir.absoluteFilePath(pluginFilename).toUtf8().constData());
return true; return true;
} }
else else
{ {
nlwarning("Loaded %s, but cannot cast to NLQT::IObjectViewer*", nlwarning("Loaded %s, but cannot cast to NLQT::IObjectViewer*",
pluginFilename.toStdString().c_str()); pluginFilename.toUtf8().constData());
} }
} }
else else
{ {
nlwarning("Cannot get plugin instance for %s (searched in %s)", nlwarning("Cannot get plugin instance for %s (searched in %s)",
pluginFilename.toStdString().c_str(), pluginFilename.toUtf8().constData(),
(qApp->applicationDirPath() + pluginPath).toStdString().c_str()); (qApp->applicationDirPath() + pluginPath).toUtf8().constData());
} }
return false; return false;

View file

@ -87,9 +87,9 @@ namespace NLQT
QString path = Modules::mainWin().leveldesignPath(); QString path = Modules::mainWin().leveldesignPath();
QStringList typelist; QStringList typelist;
//nlinfo ("Searching files in directory '%s'...", dir.c_str()); //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()); //nlinfo ("%d supported file types :",FileTypeToId.size());
for ( std::map<std::string,uint8>::iterator it = FileTypeToId.begin(); it != FileTypeToId.end(); ++it ) for ( std::map<std::string,uint8>::iterator it = FileTypeToId.begin(); it != FileTypeToId.end(); ++it )
{ {
@ -103,8 +103,8 @@ namespace NLQT
std::string extStr = NLMISC::CFile::getExtension( _files[i] ); std::string extStr = NLMISC::CFile::getExtension( _files[i] );
// filter files without existing dfn // filter files without existing dfn
if (!NLMISC::CPath::exists(QString("%1.dfn").arg(extStr.c_str()).toStdString()) && if (!NLMISC::CPath::exists(extStr + ".dfn") &&
!NLMISC::CPath::exists(QString("%1.typ").arg(extStr.c_str()).toStdString())) !NLMISC::CPath::exists(extStr + ".typ"))
{ {
continue; continue;
} }
@ -253,7 +253,7 @@ namespace NLQT
{ {
std::string extStr = NLMISC::CFile::getExtension( fileName ); 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; return;
} }

View file

@ -146,13 +146,13 @@ namespace NLQT
QMessageBox::Ok);*/ QMessageBox::Ok);*/
// save graphics settings to config file // 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 // save leveldesign path to config file
QString oldLdPath = Modules::config().getValue("LeveldesignPath", std::string("")).c_str(); QString oldLdPath = Modules::config().getValue("LeveldesignPath", std::string("")).c_str();
if (oldLdPath != ui.leveldesignPath->text()) 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); Modules::config().getConfigFile().getVar("LeveldesignPath").forceAsString(ldPath);
Q_EMIT ldPathChanged(ldPath.c_str()); Q_EMIT ldPathChanged(ldPath.c_str());
// TODO: remove old Path from CPath // TODO: remove old Path from CPath
@ -171,7 +171,7 @@ namespace NLQT
std::vector<std::string> addList; std::vector<std::string> addList;
for (sint i = 0; i < ui.pathsListWidget->count(); ++i) 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 != "") if (str != "")
{ {
list.push_back(str); list.push_back(str);