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 049498fb20
commit 5bd389226f
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");
return;
}
nlinfo(QString("addObject: " + obj->objectName()).toStdString().c_str());
nlinfo("addObject: %s", obj->objectName().toUtf8().constData());
m_allObjects.append(obj);
@ -71,10 +71,10 @@ void PluginManager::removeObject(QObject *obj)
if (!m_allObjects.contains(obj))
{
nlinfo(QString("object not in list: " + obj->objectName()).toStdString().c_str());
nlinfo("object not in list: %s", obj->objectName().toUtf8().constData());
return;
}
nlinfo(QString("removeObject: " + obj->objectName()).toStdString().c_str());
nlinfo("removeObject: %s", obj->objectName().toUtf8().constData());
Q_EMIT aboutToRemoveObject(obj);
QWriteLocker lock(&m_lock);

View file

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

View file

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

View file

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

View file

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

View file

@ -78,16 +78,16 @@ Core::IContext *ContextManager::context(const QString &id) const
return 0;
}
void ContextManager::registerUndoStack(QUndoStack *stack)
{
nlassert(stack);
d->m_mainWindow->undoGroup()->addStack(stack);
}
void ContextManager::registerUndoStack(QUndoStack *stack)
{
nlassert(stack);
d->m_mainWindow->undoGroup()->addStack(stack);
}
void ContextManager::unregisterUndoStack(QUndoStack *stack)
{
nlassert(stack);
d->m_mainWindow->undoGroup()->removeStack(stack);
nlassert(stack);
d->m_mainWindow->undoGroup()->removeStack(stack);
}
void ContextManager::activateContext(const QString &id)
@ -160,7 +160,7 @@ int ContextManager::indexOf(const QString &id) const
if (d->m_contexts.at(i)->id() == id)
return i;
}
nlwarning(QString("Warning, no such context: %1").arg(id).toStdString().c_str());
nlwarning(QString("Warning, no such context: %1").arg(id).toUtf8().constData());
return -1;
}

View file

@ -99,10 +99,10 @@ void GeneralSettingsPage::applyGeneralSettings()
QString primitivePath = settings->value(Core::Constants::PRIMITIVES_PATH, QString("%1/primitives").arg(levelDesignPrefix)).toString();
QString ligoConfigFile = settings->value(Core::Constants::LIGOCONFIG_FILE, QString("%1/leveldesign/world_editor_files/world_editor_classes.xml").arg(levelDesignPrefix)).toString();
QString leveldesignPath = settings->value(Core::Constants::LEVELDESIGN_PATH, QString("%1/leveldesign").arg(levelDesignPrefix)).toString();
NLMISC::CPath::addSearchPath(primitivePath.toStdString(), true, false);
NLMISC::CPath::addSearchPath(primitivePath.toUtf8().constData(), true, false);
NLMISC::CPath::display();
NLMISC::CPath::addSearchFile(ligoConfigFile.toStdString());
NLMISC::CPath::addSearchPath(leveldesignPath.toStdString(), true, false);
NLMISC::CPath::addSearchFile(ligoConfigFile.toUtf8().constData());
NLMISC::CPath::addSearchPath(leveldesignPath.toUtf8().constData(), true, false);
settings->endGroup();
}

View file

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

View file

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

View file

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

View file

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

View file

@ -253,7 +253,7 @@ namespace GeorgesQt
}
else
{
nlwarning("Failed to load form: %s", info.fileName().toStdString().c_str());
nlwarning("Failed to load form: %s", info.fileName().toUtf8().constData());
m_dockedWidgets.last()->close();
}
}

View file

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

View file

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

View file

@ -239,11 +239,11 @@ void MissionCompilerMainWindow::compileMission(bool publish)
try
{
CMissionCompiler mc;
mc.compileMissions(primDoc.RootNode, filename.toStdString());
mc.compileMissions(primDoc.RootNode, filename.toUtf8().constData());
m_compileLog.append("Found "+QString::number(mc.getMissionsCount())+" valid missions\n");
updateCompileLog();
mc.installCompiledMission(m_ligoConfig, filename.toStdString());
mc.installCompiledMission(m_ligoConfig, filename.toUtf8().constData());
nbMission += mc.getMissionsCount();
// publish files to selected servers
@ -296,7 +296,7 @@ void MissionCompilerMainWindow::compileMission(bool publish)
{
m_compileLog.append(" "+QString(NLMISC::CFile::getFilename(mc.getFileToPublish(j)).c_str())+"\n");
}
mc.publishFiles(primPath.toStdString(), textPath.toStdString(), localPath.toStdString());
mc.publishFiles(primPath.toUtf8().constData(), textPath.toUtf8().constData(), localPath.toUtf8().constData());
}
column++;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -468,7 +468,7 @@ void CObjectViewer::loadConfig()
#endif
_CameraFocal = settings->value("CameraFocal", 75).toInt();
_FontName = settings->value(Constants::FONT, "andbasr.ttf").toString().toStdString();
_FontName = settings->value(Constants::FONT, "andbasr.ttf").toString().toUtf8();
_BloomEffect = settings->value(Constants::ENABLE_BLOOM, false).toBool();
_BloomDensity = settings->value(Constants::BLOOM_DENSITY, 0).toInt();
_BloomSquare = settings->value(Constants::ENABLE_SQUARE_BLOOM, false).toBool();

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -40,7 +40,7 @@ namespace TranslationManager
void CEditorPhrase::open(QString filename)
{
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->setUndoStack(current_stack);

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -152,7 +152,7 @@ retry:
CLoginCookie c;
c.set((uint32)(uintptr_t)from, rand(), uid);
reason = sqlQuery("update user set state='Authorized', Cookie='"+c.setToString()+"' where UId="+uid);
reason = sqlQuery("update user set state='Authorized', Cookie='"+c.setToString()+"' where UId=" + NLMISC::toString(uid));
if(!reason.empty()) break;
reason = sqlQuery("select * from shard where Online>0 and ClientApplication='"+application+"'", nbrow, row, result);

View file

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

View file

@ -98,7 +98,7 @@ namespace NLQT {
void CConfiguration::addLeveldesignPath()
{
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);
}

View file

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

View file

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

View file

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

View file

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

View file

@ -42,7 +42,7 @@ namespace NLQT
CFormItem *item = smodel->getItem(index);
//qDebug() << smodel->showParents() << (item->valueFrom() == NLGEORGES::UFormElm::NodeParentForm);
//nlinfo("%s %d %d %d %d", item->data(index.column()).toString().toStdString().c_str(),
//nlinfo("%s %d %d %d %d", item->data(index.column()).toString().toUtf8().constData(),
// item->valueFrom(),
// item->nodeFrom(),
// smodel->showParents(),

View file

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

View file

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

View file

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

View file

@ -87,9 +87,9 @@ namespace NLQT
QString path = Modules::mainWin().leveldesignPath();
QStringList typelist;
//nlinfo ("Searching files in directory '%s'...", dir.c_str());
NLMISC::CPath::getPathContent(path.toStdString(),true,false,true,_files);
NLMISC::CPath::getPathContent(path.toUtf8().constData(),true,false,true,_files);
getTypes( /* path.toStdString() // incompatible parameter type */ );
getTypes( /* path.toUtf8() // incompatible parameter type */ );
//nlinfo ("%d supported file types :",FileTypeToId.size());
for ( std::map<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] );
// filter files without existing dfn
if (!NLMISC::CPath::exists(QString("%1.dfn").arg(extStr.c_str()).toStdString()) &&
!NLMISC::CPath::exists(QString("%1.typ").arg(extStr.c_str()).toStdString()))
if (!NLMISC::CPath::exists(extStr + ".dfn") &&
!NLMISC::CPath::exists(extStr + ".typ"))
{
continue;
}
@ -253,7 +253,7 @@ namespace NLQT
{
std::string extStr = NLMISC::CFile::getExtension( fileName );
if (!NLMISC::CPath::exists(QString("%1.dfn").arg(extStr.c_str()).toStdString()))
if (!NLMISC::CPath::exists(extStr + ".dfn"))
{
return;
}

View file

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