From 9bae8dbd8d256e57beba2372e3b4fa4b53196403 Mon Sep 17 00:00:00 2001 From: Marco Callieri Date: Mon, 19 Feb 2018 16:36:31 +0100 Subject: [PATCH] qPrintable to qUtf8Printable in the WHOLE project qUtf8Printable is better to deal with special characters. also in QT documentation it is said is better when logging strings. However, we use it also to store filenames and text-based ID, if we only use one, and not alternating between qUtf8Printable and qPrintable, thins should be smoother, but since it is a project-wide change, it is potentially DANGEROUS, NOT YET FULLY TESTED --- src/common/GLLogStream.cpp | 2 +- src/common/filterparameter.cpp | 6 +- src/common/filterscript.cpp | 14 ++--- src/common/interfaces.h | 10 ++-- src/common/meshlabdocumentbundler.cpp | 4 +- src/common/meshmodel.cpp | 2 +- src/common/pluginmanager.cpp | 6 +- src/common/scriptsyntax.cpp | 2 +- src/meshlab/customDialog.cpp | 4 +- src/meshlab/glarea.cpp | 32 +++++----- src/meshlab/layerDialog.cpp | 2 +- src/meshlab/mainwindow.h | 2 +- src/meshlab/mainwindow_Init.cpp | 6 +- src/meshlab/mainwindow_RunTime.cpp | 4 +- src/meshlab/plugindialog.cpp | 2 +- src/meshlab/stdpardialog.cpp | 2 +- src/meshlab/xmlgeneratorgui.cpp | 4 +- .../decorate_background/cubemap.cpp | 4 +- .../decorate_background.cpp | 4 +- .../decorate_base/decorate_base.cpp | 8 +-- .../decorate_shadow/decorate_shader.h | 2 +- src/meshlabplugins/edit_align/alignDialog.cpp | 2 +- src/meshlabplugins/edit_align/edit_align.cpp | 2 +- src/meshlabplugins/edit_align/meshtree.cpp | 24 ++++---- .../edit_manipulators/edit_manipulators.cpp | 2 +- .../edit_mutualcorrs/alignset.cpp | 4 +- src/meshlabplugins/filter_ao/filter_ao.cpp | 2 +- .../filter_bnpts/filter_bnpts.cpp | 4 +- .../filter_isoparametrization.cpp | 4 +- .../filter_layer/filter_layer.cpp | 2 +- .../filter_mutualglobal/alignset.cpp | 4 +- .../filter_mutualinfoxml/alignset.cpp | 4 +- .../filter_plymc/filter_plymc.cpp | 12 ++-- .../filter_qhull/filter_qhull.cpp | 2 +- .../filter_sampling/filter_sampling.cpp | 4 +- .../filter_sketchfab/filter_sketchfab.cpp | 14 ++--- src/meshlabplugins/io_3ds/meshio.cpp | 2 +- src/meshlabplugins/io_base/baseio.cpp | 2 +- src/meshlabplugins/io_collada/io_collada.cpp | 2 +- src/meshlabplugins/io_ctm/io_ctm.cpp | 6 +- src/meshlabplugins/io_pdb/io_pdb.cpp | 2 +- src/meshlabplugins/io_tri/io_tri.cpp | 14 ++--- src/meshlabplugins/io_u3d/io_u3d.cpp | 4 +- src/meshlabplugins/render_gdp/meshrender.cpp | 8 +-- src/meshlabserver/mainserver.cpp | 60 +++++++++---------- 45 files changed, 154 insertions(+), 154 deletions(-) diff --git a/src/common/GLLogStream.cpp b/src/common/GLLogStream.cpp index e1e4cb190..6cef1947a 100644 --- a/src/common/GLLogStream.cpp +++ b/src/common/GLLogStream.cpp @@ -68,7 +68,7 @@ void GLLogStream::Save(int /*Level*/, const char * filename ) FILE *fp=fopen(filename,"wb"); QList > ::iterator li; for(li=S.begin();li!=S.end();++li) - fprintf(fp,"%s",qPrintable((*li).second)); + fprintf(fp,"%s", qUtf8Printable((*li).second)); } void GLLogStream::ClearBookmark() diff --git a/src/common/filterparameter.cpp b/src/common/filterparameter.cpp index 69e3df3bf..f99579ef6 100644 --- a/src/common/filterparameter.cpp +++ b/src/common/filterparameter.cpp @@ -55,7 +55,7 @@ RichParameter* RichParameterSet::findParameter(QString name) const return *fpli; } qDebug("FilterParameter Warning: Unable to find a parameter with name '%s',\n" - " Please check types and names of the parameter in the calling filter",qPrintable(name)); + " Please check types and names of the parameter in the calling filter", qUtf8Printable(name)); assert(0); return 0; } @@ -407,7 +407,7 @@ bool RichParameterAdapter::create( const QDomElement& np,RichParameter** par ) if (isxml.isNull()) isxml = QString("0"); - qDebug(" Reading Param with name %s : %s",qPrintable(name),qPrintable(type)); + qDebug(" Reading Param with name %s : %s", qUtf8Printable(name), qUtf8Printable(type)); bool corrconv = false; if(type=="RichBool") @@ -602,7 +602,7 @@ bool RichParameterAdapter::create(const QString& namepreamble, const MLXMLPlugin QString desc = xmlparam[MLXMLElNames::guiLabel]; QString tooltip = xmlparam[MLXMLElNames::paramHelpTag]; - qDebug(" Reading Param with name %s : %s", qPrintable(name), qPrintable(xmlparam[MLXMLElNames::paramDefExpr])); + qDebug(" Reading Param with name %s : %s", qUtf8Printable(name), qUtf8Printable(xmlparam[MLXMLElNames::paramDefExpr])); *par = new RichString(name, xmlparam[MLXMLElNames::paramDefExpr], desc, tooltip); if (par != NULL) diff --git a/src/common/filterscript.cpp b/src/common/filterscript.cpp index 5290057f3..f501f801c 100644 --- a/src/common/filterscript.cpp +++ b/src/common/filterscript.cpp @@ -106,22 +106,22 @@ bool FilterScript::open(QString filename) QFile file(filename); if (!file.open(QIODevice::ReadOnly)) { - qDebug("Failure in opening Script %s",qPrintable(filename)); - qDebug("Current dir is %s",qPrintable(QDir::currentPath())); + qDebug("Failure in opening Script %s", qUtf8Printable(filename)); + qDebug("Current dir is %s", qUtf8Printable(QDir::currentPath())); return false; } QString errorMsg; int errorLine,errorColumn; if(!doc.setContent(&file,false,&errorMsg,&errorLine,&errorColumn)) { - qDebug("Failure in setting Content line %i column %i \nError'%s'",errorLine,errorColumn,qPrintable(errorMsg)); + qDebug("Failure in setting Content line %i column %i \nError'%s'",errorLine,errorColumn, qUtf8Printable(errorMsg)); return false; } file.close(); QDomElement root = doc.documentElement(); if(root.nodeName() != "FilterScript") { - qDebug("Failure in parsing script %s\nNo root node with name FilterScript\n",qPrintable(filename)); - qDebug("Current rootname is %s",qPrintable(root.nodeName())); + qDebug("Failure in parsing script %s\nNo root node with name FilterScript\n", qUtf8Printable(filename)); + qDebug("Current rootname is %s", qUtf8Printable(root.nodeName())); return false; } @@ -132,7 +132,7 @@ bool FilterScript::open(QString filename) { RichParameterSet par; QString name=nf.attribute("name"); - qDebug("Reading filter with name %s",qPrintable(name)); + qDebug("Reading filter with name %s", qUtf8Printable(name)); for(QDomElement np = nf.firstChildElement("Param"); !np.isNull(); np = np.nextSiblingElement("Param")) { RichParameter* rp = NULL; @@ -147,7 +147,7 @@ bool FilterScript::open(QString filename) else { QString name=nf.attribute("name"); - qDebug("Reading filter with name %s",qPrintable(name)); + qDebug("Reading filter with name %s", qUtf8Printable(name)); QMap map; for(QDomElement np = nf.firstChildElement("xmlparam"); !np.isNull(); np = np.nextSiblingElement("xmlparam")) map[np.attribute("name")] = np.attribute("value"); diff --git a/src/common/interfaces.h b/src/common/interfaces.h index 3c6bb705f..fbb70a445 100644 --- a/src/common/interfaces.h +++ b/src/common/interfaces.h @@ -368,7 +368,7 @@ public: if (a->text() == this->filterName(tt)) return tt; - qDebug("unable to find the id corresponding to action '%s'", qPrintable(a->text())); + qDebug("unable to find the id corresponding to action '%s'", qUtf8Printable(a->text())); assert(0); return -1; } @@ -384,7 +384,7 @@ public: foreach(QAction *tt, actionList) if (idName == tt->text()) return tt; - qDebug("unable to find the action corresponding to action '%s'", qPrintable(idName)); + qDebug("unable to find the action corresponding to action '%s'", qUtf8Printable(idName)); assert(0); return 0; } @@ -523,7 +523,7 @@ protected: { foreach(FilterIDType tt, types()) if (a->text() == this->decorationName(tt)) return tt; - qDebug("unable to find the id corresponding to action '%s'", qPrintable(a->text())); + qDebug("unable to find the id corresponding to action '%s'", qUtf8Printable(a->text())); assert(0); return -1; } @@ -531,7 +531,7 @@ protected: { foreach(FilterIDType tt, types()) if (name == this->decorationName(tt)) return tt; - qDebug("unable to find the id corresponding to action '%s'", qPrintable(name)); + qDebug("unable to find the id corresponding to action '%s'", qUtf8Printable(name)); assert(0); return -1; } @@ -540,7 +540,7 @@ public: { foreach(QAction *tt, actions()) if (name == this->decorationName(ID(tt))) return tt; - qDebug("unable to find the id corresponding to action '%s'", qPrintable(name)); + qDebug("unable to find the id corresponding to action '%s'", qUtf8Printable(name)); return 0; } }; diff --git a/src/common/meshlabdocumentbundler.cpp b/src/common/meshlabdocumentbundler.cpp index d73458675..4e45133d5 100644 --- a/src/common/meshlabdocumentbundler.cpp +++ b/src/common/meshlabdocumentbundler.cpp @@ -21,7 +21,7 @@ bool MeshDocumentFromBundler(MeshDocument &md, QString filename_out,QString imag const QString path_im = QFileInfo(image_list_filename).absolutePath()+QString("/"); std::vector image_filenames; - vcg::tri::io::ImporterOUT::Open(md.mm()->cm,shots,image_filenames,qPrintable(filename_out), qPrintable(image_list_filename)); + vcg::tri::io::ImporterOUT::Open(md.mm()->cm,shots,image_filenames, qUtf8Printable(filename_out), qUtf8Printable(image_list_filename)); md.mm()->updateDataMask(MeshModel::MM_VERTCOLOR); QString curr_path = QDir::currentPath(); @@ -68,7 +68,7 @@ bool MeshDocumentFromNvm(MeshDocument &md, QString filename_nvm, QString model_f //const QString path_im = QFileInfo(image_list_filename).absolutePath()+QString("/"); std::vector image_filenames; - vcg::tri::io::ImporterNVM::Open(md.mm()->cm,shots,image_filenames,qPrintable(filename_nvm)); + vcg::tri::io::ImporterNVM::Open(md.mm()->cm,shots,image_filenames, qUtf8Printable(filename_nvm)); md.mm()->updateDataMask(MeshModel::MM_VERTCOLOR); QString curr_path = QDir::currentPath(); diff --git a/src/common/meshmodel.cpp b/src/common/meshmodel.cpp index 96f14cf4d..52dfba7c8 100644 --- a/src/common/meshmodel.cpp +++ b/src/common/meshmodel.cpp @@ -390,7 +390,7 @@ QString MeshModel::relativePathName() const QString relPath=documentDir.relativeFilePath(this->fullPathFileName); if(relPath.size()>1 && relPath[0]=='.' && relPath[1]=='.') - qDebug("Error we have a mesh that is not in the same folder of the project: %s ",qPrintable(relPath)); + qDebug("Error we have a mesh that is not in the same folder of the project: %s ", qUtf8Printable(relPath)); return relPath; } diff --git a/src/common/pluginmanager.cpp b/src/common/pluginmanager.cpp index 3ae706a82..ff9e3ce21 100644 --- a/src/common/pluginmanager.cpp +++ b/src/common/pluginmanager.cpp @@ -74,7 +74,7 @@ void PluginManager::loadPlugins(RichParameterSet& defaultGlobal) //only the file with extension pluginfilters will be listed by function entryList() pluginsDir.setNameFilters(pluginfilters); - qDebug("Current Plugins Dir is: %s ", qPrintable(pluginsDir.absolutePath())); + qDebug("Current Plugins Dir is: %s ", qUtf8Printable(pluginsDir.absolutePath())); scriptplugcode = ""; ScriptAdapterGenerator gen; scriptplugcode += gen.mergeOptParamsCodeGenerator() + "\n"; @@ -236,7 +236,7 @@ QString PluginManager::getBaseDirPath() if(baseDir.exists("plugins")) break; baseDir.cdUp(); } - qDebug("The base dir is %s",qPrintable(baseDir.absolutePath())); + qDebug("The base dir is %s", qUtf8Printable(baseDir.absolutePath())); #endif return baseDir.absolutePath(); } @@ -414,7 +414,7 @@ MLXMLPluginInfo* PluginManager::loadXMLPlugin(const QString& fileName) else { QString err = xmlErr.statusMessage(); - qDebug("Error in XMLFile: %s - line: %d, column: %d - %s", qPrintable(fileName), xmlErr.line(), xmlErr.column(), qPrintable(err)); + qDebug("Error in XMLFile: %s - line: %d, column: %d - %s", qUtf8Printable(fileName), xmlErr.line(), xmlErr.column(), qUtf8Printable(err)); } } return nullptr; diff --git a/src/common/scriptsyntax.cpp b/src/common/scriptsyntax.cpp index f421fe4eb..9b8f3646b 100644 --- a/src/common/scriptsyntax.cpp +++ b/src/common/scriptsyntax.cpp @@ -584,7 +584,7 @@ QString ExternalLib::libCode() const { QFile lib(name); if (!lib.open(QFile::ReadOnly)) - qDebug("Warning: Library %s has not been loaded.",qPrintable(name)); + qDebug("Warning: Library %s has not been loaded.", qUtf8Printable(name)); QByteArray libcode = lib.readAll(); /*QScriptValue res = env.evaluate(QString(libcode)); if (res.isError()) diff --git a/src/meshlab/customDialog.cpp b/src/meshlab/customDialog.cpp index 50bf93657..187e9c9af 100644 --- a/src/meshlab/customDialog.cpp +++ b/src/meshlab/customDialog.cpp @@ -154,7 +154,7 @@ void SettingDialog::save() tmppar->accept(v); doc.appendChild(v.parElem); QString docstring = doc.toString(); - qDebug("Writing into Settings param with name %s and content ****%s****",qPrintable(tmppar->name),qPrintable(docstring)); + qDebug("Writing into Settings param with name %s and content ****%s****", qUtf8Printable(tmppar->name), qUtf8Printable(docstring)); QSettings setting; setting.setValue(tmppar->name,QVariant(docstring)); curPar->pd->defVal->set(*tmppar->val); @@ -170,7 +170,7 @@ void SettingDialog::apply() void SettingDialog::reset() { - qDebug("resetting the value of param %s to the hardwired default",qPrintable(curPar->name)); + qDebug("resetting the value of param %s to the hardwired default", qUtf8Printable(curPar->name)); tmppar->val->set(*defPar->val); assert(frame.stdfieldwidgets.size() == 1); frame.stdfieldwidgets.at(0)->setWidgetValue(*tmppar->val); diff --git a/src/meshlab/glarea.cpp b/src/meshlab/glarea.cpp index d15454c4b..7c8d5305a 100644 --- a/src/meshlab/glarea.cpp +++ b/src/meshlab/glarea.cpp @@ -657,7 +657,7 @@ void GLArea::paintEvent(QPaintEvent* /*event*/) QString error = checkGLError::makeString("There are gl errors: "); if(!error.isEmpty()) { - Logf(GLLogStream::WARNING,qPrintable(error)); + Logf(GLLogStream::WARNING, qUtf8Printable(error)); } //check if viewers are linked MainWindow *window = qobject_cast(QApplication::activeWindow()); @@ -1139,7 +1139,7 @@ void GLArea::setCurrentEditAction(QAction *editAction) } else { - Logf(GLLogStream::SYSTEM,"Started Mode %s", qPrintable(currentEditor->text())); + Logf(GLLogStream::SYSTEM,"Started Mode %s", qUtf8Printable(currentEditor->text())); if(mm()!=NULL) mm()->meshModified() = true; else assert(!iEdit->isSingleMeshEdit()); @@ -1427,9 +1427,9 @@ void GLArea::updateDecorator(QString name, bool toggle, bool stateToSet) if(toggle || stateToSet==false){ iDecorateTemp->endDecorate(action,*md(),glas.currentGlobalParamSet,this); iDecorateTemp->setLog(NULL); - this->Logf(GLLogStream::SYSTEM,"Disabled Decorate mode %s",qPrintable(action->text())); + this->Logf(GLLogStream::SYSTEM,"Disabled Decorate mode %s", qUtf8Printable(action->text())); } else - this->Logf(GLLogStream::SYSTEM,"Trying to disable an already disabled Decorate mode %s",qPrintable(action->text())); + this->Logf(GLLogStream::SYSTEM,"Trying to disable an already disabled Decorate mode %s", qUtf8Printable(action->text())); } else{ if(toggle || stateToSet==true){ @@ -1437,11 +1437,11 @@ void GLArea::updateDecorator(QString name, bool toggle, bool stateToSet) bool ret = iDecorateTemp->startDecorate(action,*md(), glas.currentGlobalParamSet, this); if(ret) { this->iPerDocDecoratorlist.push_back(action); - this->Logf(GLLogStream::SYSTEM,"Enabled Decorate mode %s",qPrintable(action->text())); + this->Logf(GLLogStream::SYSTEM,"Enabled Decorate mode %s", qUtf8Printable(action->text())); } - else this->Logf(GLLogStream::SYSTEM,"Failed start of Decorate mode %s",qPrintable(action->text())); + else this->Logf(GLLogStream::SYSTEM,"Failed start of Decorate mode %s", qUtf8Printable(action->text())); } else - this->Logf(GLLogStream::SYSTEM,"Trying to enable an already enabled Decorate mode %s",qPrintable(action->text())); + this->Logf(GLLogStream::SYSTEM,"Trying to enable an already enabled Decorate mode %s", qUtf8Printable(action->text())); } } @@ -1454,9 +1454,9 @@ void GLArea::updateDecorator(QString name, bool toggle, bool stateToSet) if(toggle || stateToSet==false){ iDecorateTemp->endDecorate(action,currentMeshModel,glas.currentGlobalParamSet,this); iDecorateTemp->setLog(NULL); - this->Logf(0,"Disabled Decorate mode %s",qPrintable(action->text())); + this->Logf(0,"Disabled Decorate mode %s", qUtf8Printable(action->text())); } else - this->Logf(GLLogStream::SYSTEM,"Trying to disable an already disabled Decorate mode %s",qPrintable(action->text())); + this->Logf(GLLogStream::SYSTEM,"Trying to disable an already disabled Decorate mode %s", qUtf8Printable(action->text())); } else{ if(toggle || stateToSet==true){ @@ -1467,11 +1467,11 @@ void GLArea::updateDecorator(QString name, bool toggle, bool stateToSet) bool ret = iDecorateTemp->startDecorate(action,currentMeshModel, glas.currentGlobalParamSet, this); if(ret) { this->iCurPerMeshDecoratorList().push_back(action); - this->Logf(GLLogStream::SYSTEM,"Enabled Decorate mode %s",qPrintable(action->text())); + this->Logf(GLLogStream::SYSTEM,"Enabled Decorate mode %s", qUtf8Printable(action->text())); } - else this->Logf(GLLogStream::SYSTEM,"Failed Decorate mode %s",qPrintable(action->text())); + else this->Logf(GLLogStream::SYSTEM,"Failed Decorate mode %s", qUtf8Printable(action->text())); } else - this->Logf(GLLogStream::SYSTEM,"Error in Decorate mode %s: %s",qPrintable(action->text()),qPrintable(errorMessage)); + this->Logf(GLLogStream::SYSTEM,"Error in Decorate mode %s: %s", qUtf8Printable(action->text()), qUtf8Printable(errorMessage)); } } @@ -1694,14 +1694,14 @@ void GLArea::sendViewPos(QString name) void GLArea::sendSurfacePos(QString name) { - qDebug("sendSurfacePos %s",qPrintable(name)); + qDebug("sendSurfacePos %s", qUtf8Printable(name)); nameToGetPickPos = name; hasToGetPickPos=true; } void GLArea::sendPickedPos(QString name) { - qDebug("sendPickedPos %s", qPrintable(name)); + qDebug("sendPickedPos %s", qUtf8Printable(name)); nameToGetPickCoords = name; hasToGetPickCoords = true; } @@ -2205,7 +2205,7 @@ void GLArea::viewFromCurrentShot(QString kind) if(kind=="Raster" && this->md()->rm()) localShot = this->md()->rm()->shot; if(!localShot.IsValid()) { - this->Logf(GLLogStream::SYSTEM, "Unable to set Shot from current %s",qPrintable(kind)); + this->Logf(GLLogStream::SYSTEM, "Unable to set Shot from current %s", qUtf8Printable(kind)); return; } @@ -2315,7 +2315,7 @@ void GLArea::createOrthoView(QString dir) QPair shotAndScale = QPair (shot, trackball.track.sca); loadShot(shotAndScale); - this->Logf(GLLogStream::SYSTEM, "View scene from %s", qPrintable(dir)); + this->Logf(GLLogStream::SYSTEM, "View scene from %s", qUtf8Printable(dir)); } void GLArea::toggleOrtho() diff --git a/src/meshlab/layerDialog.cpp b/src/meshlab/layerDialog.cpp index c9284871e..5b0b5d06f 100644 --- a/src/meshlab/layerDialog.cpp +++ b/src/meshlab/layerDialog.cpp @@ -1078,7 +1078,7 @@ void DecoratorParamsTreeWidget::save() p->accept(v); doc.appendChild(v.parElem); QString docstring = doc.toString(); - qDebug("Writing into Settings param with name %s and content ****%s****",qPrintable(p->name),qPrintable(docstring)); + qDebug("Writing into Settings param with name %s and content ****%s****", qUtf8Printable(p->name), qUtf8Printable(docstring)); QSettings setting; setting.setValue(p->name,QVariant(docstring)); RichParameterSet& currSet = mainWin->currentGlobalPars(); diff --git a/src/meshlab/mainwindow.h b/src/meshlab/mainwindow.h index b3ac336bd..2444a89d2 100644 --- a/src/meshlab/mainwindow.h +++ b/src/meshlab/mainwindow.h @@ -565,7 +565,7 @@ protected: noEvent=false; QFileOpenEvent *fileEvent = static_cast(event); mainWindow->importMeshWithLayerManagement(fileEvent->file()); - qDebug("event fileopen %s",qPrintable(fileEvent->file())); + qDebug("event fileopen %s", qUtf8Printable(fileEvent->file())); return true; } else { // standard event processing diff --git a/src/meshlab/mainwindow_Init.cpp b/src/meshlab/mainwindow_Init.cpp index 97973cbdb..cb20741dd 100644 --- a/src/meshlab/mainwindow_Init.cpp +++ b/src/meshlab/mainwindow_Init.cpp @@ -1010,13 +1010,13 @@ void MainWindow::loadMeshLabSettings() bool ret = RichParameterAdapter::create(docElem, &rpar); if (!ret) { - // qDebug("Warning Ignored parameter '%s' = '%s'. Malformed.", qPrintable(docElem.attribute("name")),qPrintable(docElem.attribute("value"))); + // qDebug("Warning Ignored parameter '%s' = '%s'. Malformed.", qUtf8Printable(docElem.attribute("name")), qUtf8Printable(docElem.attribute("value"))); continue; } if (!defaultGlobalParams.hasParameter(rpar->name)) { // qDebug("Warning Ignored parameter %s. In the saved parameters there are ones that are not in the HardWired ones. " - // "It happens if you are running MeshLab with only a subset of the plugins. ",qPrintable(rpar->name)); + // "It happens if you are running MeshLab with only a subset of the plugins. ", qUtf8Printable(rpar->name)); } else currentGlobalParams.addParam(rpar); @@ -1026,7 +1026,7 @@ void MainWindow::loadMeshLabSettings() // 2) eventually fill missing values with the hardwired defaults for (int ii = 0; ii < defaultGlobalParams.paramList.size(); ++ii) { - // qDebug("Searching param[%i] %s of the default into the loaded settings. ",ii,qPrintable(defaultGlobalParams.paramList.at(ii)->name)); + // qDebug("Searching param[%i] %s of the default into the loaded settings. ", ii, qUtf8Printable(defaultGlobalParams.paramList.at(ii)->name)); if (!currentGlobalParams.hasParameter(defaultGlobalParams.paramList.at(ii)->name)) { qDebug("Warning! a default param was not found in the saved settings. This should happen only on the first run..."); diff --git a/src/meshlab/mainwindow_RunTime.cpp b/src/meshlab/mainwindow_RunTime.cpp index 01b3ab6f4..2dff96119 100644 --- a/src/meshlab/mainwindow_RunTime.cpp +++ b/src/meshlab/mainwindow_RunTime.cpp @@ -1655,7 +1655,7 @@ void MainWindow::initDocumentMeshRenderState(MeshLabXMLFilterContainer* /*mfc*/) // catch (ExpressionHasNotThisTypeException&) // { // QString st = "parameter " + params[ii][MLXMLElNames::paramName] + "declared of type mesh contains a not mesh value.\n"; - // meshDoc()->Log.Logf(GLLogStream::FILTER,qPrintable(st)); + // meshDoc()->Log.Logf(GLLogStream::FILTER, qUtf8Printable(st)); // } // } // } @@ -1703,7 +1703,7 @@ void MainWindow::initDocumentRasterRenderState(MeshLabXMLFilterContainer* /*mfc* // // catch (ExpressionHasNotThisTypeException& e) // // { // // QString st = "parameter " + params[ii][MLXMLElNames::paramName] + "declared of type mesh contains a not mesh value.\n"; - // // meshDoc()->Log.Logf(GLLogStream::FILTER,qPrintable(st)); + // // meshDoc()->Log.Logf(GLLogStream::FILTER, qUtf8Printable(st)); // // } // // } // // } diff --git a/src/meshlab/plugindialog.cpp b/src/meshlab/plugindialog.cpp index fd2a102ef..7ce6e1d10 100644 --- a/src/meshlab/plugindialog.cpp +++ b/src/meshlab/plugindialog.cpp @@ -187,7 +187,7 @@ void PluginDialog::displayInfo(QTreeWidgetItem* item,int /* ncolumn*/) QString fileName=pathDirectory+"/"+parent; QDir dir(pathDirectory); QPluginLoader loader(fileName); - qDebug("Trying to load the plugin '%s'",qPrintable(fileName)); + qDebug("Trying to load the plugin '%s'", qUtf8Printable(fileName)); QObject *plugin = loader.instance(); if (plugin) { MeshIOInterface *iMeshIO = qobject_cast(plugin); diff --git a/src/meshlab/stdpardialog.cpp b/src/meshlab/stdpardialog.cpp index 5b601995e..5ea208f3d 100644 --- a/src/meshlab/stdpardialog.cpp +++ b/src/meshlab/stdpardialog.cpp @@ -327,7 +327,7 @@ Point3fWidget::~Point3fWidget() { void Point3fWidget::setValue(QString name,Point3m newVal) { - //qDebug("setValue parametername: %s ",qPrintable(name)); + //qDebug("setValue parametername: %s ", qUtf8Printable(name)); if(name==paramName) { for(int i =0;i<3;++i) diff --git a/src/meshlab/xmlgeneratorgui.cpp b/src/meshlab/xmlgeneratorgui.cpp index 2fbdaee62..1d29d84ec 100644 --- a/src/meshlab/xmlgeneratorgui.cpp +++ b/src/meshlab/xmlgeneratorgui.cpp @@ -755,7 +755,7 @@ void PluginGeneratorGUI::loadScriptCode() return; QFile file(files[0]); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) - qDebug("Warning: File %s has not been loaded.",qPrintable(files[0])); + qDebug("Warning: File %s has not been loaded.", qUtf8Printable(files[0])); finfo.setFile(files[0]); QByteArray code = file.readAll(); file.close(); @@ -770,7 +770,7 @@ void PluginGeneratorGUI::saveScriptCode() QString filename = QFileDialog::getSaveFileName(this,tr("Save Script File"),finfo.absolutePath(),tr("Script File (*.js)")); QFile file(filename); if (!file.open(QFile::WriteOnly | QIODevice::Text)) - qDebug("Warning: File %s has not been saved.",qPrintable(filename)); + qDebug("Warning: File %s has not been saved.", qUtf8Printable(filename)); finfo.setFile(filename); FilterGeneratorTab* tb = tab(tabs->currentIndex()); if (tb != NULL) diff --git a/src/meshlabplugins/decorate_background/cubemap.cpp b/src/meshlabplugins/decorate_background/cubemap.cpp index 3152a833a..3375c6fa9 100755 --- a/src/meshlabplugins/decorate_background/cubemap.cpp +++ b/src/meshlabplugins/decorate_background/cubemap.cpp @@ -192,13 +192,13 @@ bool CICubeMap::GetName(int i, QString basename, QString &filename) exts[3]="_posy"; exts[4]="_negz"; exts[5]="_posz"; -// qDebug("filename = %s basename = %s", qPrintable(filename), qPrintable(basename)); +// qDebug("filename = %s basename = %s", qUtf8Printable(filename), qUtf8Printable(basename)); filename=basename; QString ext= basename.right(4); filename=filename.left(filename.length()-4); filename.append(exts[i]); filename.append(ext); -// qDebug("filename = %s basename = %s", qPrintable(filename), qPrintable(basename)); +// qDebug("filename = %s basename = %s", qUtf8Printable(filename), qUtf8Printable(basename)); return true; } diff --git a/src/meshlabplugins/decorate_background/decorate_background.cpp b/src/meshlabplugins/decorate_background/decorate_background.cpp index a4359697a..7f72110fc 100644 --- a/src/meshlabplugins/decorate_background/decorate_background.cpp +++ b/src/meshlabplugins/decorate_background/decorate_background.cpp @@ -106,9 +106,9 @@ void DecorateBackgroundPlugin::decorateDoc(QAction *a, MeshDocument &m, RichPara { if(!cm.IsValid() || (lastname != cubemapFileName ) ) { - qDebug( "Current CubeMapPath Dir: %s ",qPrintable(cubemapFileName)); + qDebug( "Current CubeMapPath Dir: %s ",qUtf8Printable(cubemapFileName)); glewInit(); - bool ret = cm.Load(qPrintable(cubemapFileName)); + bool ret = cm.Load(qUtf8Printable(cubemapFileName)); lastname=cubemapFileName; if(! ret ) return; //QMessageBox::warning(gla,"Cubemapped background decoration","Warning unable to load cube map images: " + cubemapFileName ); diff --git a/src/meshlabplugins/decorate_base/decorate_base.cpp b/src/meshlabplugins/decorate_base/decorate_base.cpp index 1a4909aa7..0b7a46fdf 100644 --- a/src/meshlabplugins/decorate_base/decorate_base.cpp +++ b/src/meshlabplugins/decorate_base/decorate_base.cpp @@ -662,12 +662,12 @@ bool DecorateBasePlugin::startDecorate(QAction * action, MeshModel &m, RichParam QGLShaderProgram *gsp = this->contourShaderProgramMap[&m]; ret &= gsp->addShaderFromSourceFile(QGLShader::Vertex,":/decorate/contour.vert"); - // qDebug("Compiled shader. Log is %s", qPrintable(contourShaderProgram->log())); + // qDebug("Compiled shader. Log is %s", qUtf8Printable(contourShaderProgram->log())); ret &= gsp->addShaderFromSourceFile(QGLShader::Fragment,":/decorate/contour.frag"); - // qDebug("Compiled shader. Log is %s", qPrintable(contourShaderProgram->log())); + // qDebug("Compiled shader. Log is %s", qUtf8Printable(contourShaderProgram->log())); ret &= gsp->link(); QString rs = gsp->log(); - // qDebug("Linked shader. Log is %s", qPrintable(contourShaderProgram->log())); + // qDebug("Linked shader. Log is %s", qUtf8Printable(contourShaderProgram->log())); if(!ret) return false; } } break; @@ -968,7 +968,7 @@ void DecorateBasePlugin::DrawTexParam(MeshModel &m, GLArea *gla, QPainter *paint QString textureName("-- no texture --"); if (!m.cm.textures.empty()) - textureName = qPrintable(QString(m.cm.textures[0].c_str())) + QString(" "); + textureName = qUtf8Printable(QString(m.cm.textures[0].c_str())) + QString(" "); glLabel::render(painter,Point3f(0.0,-0.10,0.0),textureName,glLabel::Mode(textColor)); checkGLError::debugInfo("DrawTexParam"); diff --git a/src/meshlabplugins/decorate_shadow/decorate_shader.h b/src/meshlabplugins/decorate_shadow/decorate_shader.h index 4cd4ac866..6b836ce1f 100644 --- a/src/meshlabplugins/decorate_shadow/decorate_shader.h +++ b/src/meshlabplugins/decorate_shadow/decorate_shader.h @@ -245,7 +245,7 @@ protected: bool ret=vertexShaderFile.open(QIODevice::ReadOnly | QIODevice::Text); if(!ret) { - qDebug("Unable to open '%s'",qPrintable(path + QString(".vert"))); + qDebug("Unable to open '%s'",qUtf8Printable(path + QString(".vert"))); return false; } diff --git a/src/meshlabplugins/edit_align/alignDialog.cpp b/src/meshlabplugins/edit_align/alignDialog.cpp index 3aebc1340..d7140fc8a 100644 --- a/src/meshlabplugins/edit_align/alignDialog.cpp +++ b/src/meshlabplugins/edit_align/alignDialog.cpp @@ -167,7 +167,7 @@ MeshTreeWidgetItem::MeshTreeWidgetItem(MeshNode *meshNode) if (meshNode->m->visible) setIcon(1, QIcon(":/layer_eye_open.png")); else setIcon(1, QIcon(":/layer_eye_close.png")); - labelText.sprintf("%s", qPrintable(meshName)); + labelText.sprintf("%s", qUtf8Printable(meshName)); setText(3, labelText); n = meshNode; diff --git a/src/meshlabplugins/edit_align/edit_align.cpp b/src/meshlabplugins/edit_align/edit_align.cpp index 7edcbc160..13f066a15 100644 --- a/src/meshlabplugins/edit_align/edit_align.cpp +++ b/src/meshlabplugins/edit_align/edit_align.cpp @@ -285,7 +285,7 @@ void EditAlignPlugin::glueByPicking() currentNode()->tr() = currentNode()->tr() * res; QString buf; // for(size_t i=0;iglued==false); diff --git a/src/meshlabplugins/edit_align/meshtree.cpp b/src/meshlabplugins/edit_align/meshtree.cpp index 6c4dc1f8e..724b32f17 100644 --- a/src/meshlabplugins/edit_align/meshtree.cpp +++ b/src/meshlabplugins/edit_align/meshtree.cpp @@ -111,10 +111,10 @@ void MeshTree::ProcessArc(int fixId, int movId, vcg::Matrix44d &MovM, vcg::Align void MeshTree::Process(vcg::AlignPair::Param &ap, MeshTree::Param &mtp) { QString buf; - cb(0,qPrintable(buf.sprintf("Starting Processing of %i glued meshes out of %i meshes\n",gluedNum(),nodeMap.size()))); + cb(0,qUtf8Printable(buf.sprintf("Starting Processing of %i glued meshes out of %i meshes\n",gluedNum(),nodeMap.size()))); /******* Occupancy Grid Computation *************/ - cb(0,qPrintable(buf.sprintf("Computing Overlaps %i glued meshes...\n",gluedNum() ))); + cb(0,qUtf8Printable(buf.sprintf("Computing Overlaps %i glued meshes...\n",gluedNum() ))); OG.Init(nodeMap.size(), vcg::Box3d::Construct(gluedBBox()), mtp.OGSize); for(auto ni=nodeMap.begin();ni!=nodeMap.end();++ni) { MeshNode *mn=ni->second; @@ -162,7 +162,7 @@ void MeshTree::Process(vcg::AlignPair::Param &ap, MeshTree::Param &mtp) //if there are no arcs at all complain and return if (totalArcNum == 0) { - cb(0, qPrintable(buf.sprintf("\n Failure. There are no overlapping meshes?\n No candidate alignment arcs. Nothing Done.\n"))); + cb(0, qUtf8Printable(buf.sprintf("\n Failure. There are no overlapping meshes?\n No candidate alignment arcs. Nothing Done.\n"))); return; } @@ -171,8 +171,8 @@ void MeshTree::Process(vcg::AlignPair::Param &ap, MeshTree::Param &mtp) if (totalArcNum > 32) num_max_thread = omp_get_max_threads(); #endif - cb(0,qPrintable(buf.sprintf("Arc with good overlap %6i (on %6lu)\n",totalArcNum,OG.SVA.size()))); - cb(0,qPrintable(buf.sprintf(" %6i preserved %i Recalc \n",preservedArcNum,recalcArcNum))); + cb(0,qUtf8Printable(buf.sprintf("Arc with good overlap %6i (on %6lu)\n",totalArcNum,OG.SVA.size()))); + cb(0,qUtf8Printable(buf.sprintf(" %6i preserved %i Recalc \n",preservedArcNum,recalcArcNum))); bool hasValidAlign = false; @@ -190,19 +190,19 @@ void MeshTree::Process(vcg::AlignPair::Param &ap, MeshTree::Param &mtp) hasValidAlign = true; std::pair dd=curResult->ComputeAvgErr(); #pragma omp critical - cb(0,qPrintable(buf.sprintf("(%3i/%3i) %2i -> %2i Aligned AvgErr dd=%f -> dd=%f \n",int(i+1),totalArcNum,OG.SVA[i].s,OG.SVA[i].t,dd.first,dd.second))); + cb(0,qUtf8Printable(buf.sprintf("(%3i/%3i) %2i -> %2i Aligned AvgErr dd=%f -> dd=%f \n",int(i+1),totalArcNum,OG.SVA[i].s,OG.SVA[i].t,dd.first,dd.second))); } else { #pragma omp critical - cb(0,qPrintable(buf.sprintf( "(%3i/%3i) %2i -> %2i Failed Alignment of one arc %s\n",int(i+1),totalArcNum,OG.SVA[i].s,OG.SVA[i].t,vcg::AlignPair::ErrorMsg(curResult->status)))); + cb(0,qUtf8Printable(buf.sprintf( "(%3i/%3i) %2i -> %2i Failed Alignment of one arc %s\n",int(i+1),totalArcNum,OG.SVA[i].s,OG.SVA[i].t,vcg::AlignPair::ErrorMsg(curResult->status)))); } } } //if there are no valid arcs complain and return if(!hasValidAlign) { - cb(0,qPrintable(buf.sprintf("\n Failure. No succesful arc among candidate Alignment arcs. Nothing Done.\n"))); + cb(0,qUtf8Printable(buf.sprintf("\n Failure. No succesful arc among candidate Alignment arcs. Nothing Done.\n"))); return; } @@ -210,7 +210,7 @@ void MeshTree::Process(vcg::AlignPair::Param &ap, MeshTree::Param &mtp) for(QList::iterator li=resultList.begin();li!=resultList.end();++li) if ((*li).IsValid()) H.Add(li->err); - cb(0,qPrintable(buf.sprintf("Completed Mesh-Mesh Alignment: Avg Err %5.3f Median %5.3f 90\% %5.3f\n",H.Avg(),H.Percentile(0.5f),H.Percentile(0.9f)))); + cb(0,qUtf8Printable(buf.sprintf("Completed Mesh-Mesh Alignment: Avg Err %5.3f Median %5.3f 90\% %5.3f\n",H.Avg(),H.Percentile(0.5f),H.Percentile(0.9f)))); ProcessGlobal(ap); } @@ -219,7 +219,7 @@ void MeshTree::ProcessGlobal(vcg::AlignPair::Param &ap) { QString buf; /************** Preparing Matrices for global alignment *************/ -// cb(0,qPrintable(buf.sprintf("Starting Global Alignment\n"))); +// cb(0,qUtf8Printable(buf.sprintf("Starting Global Alignment\n"))); // vcg::Matrix44d Zero44; Zero44.SetZero(); // std::vector PaddedTrVec(nodeMap.size(),Zero44); @@ -239,7 +239,7 @@ void MeshTree::ProcessGlobal(vcg::AlignPair::Param &ap) GluedIdVec.push_back(mn->Id()); GluedTrVec.push_back(vcg::Matrix44d::Construct(mn->tr())); // PaddedTrVec[mn->Id()]=GluedTrVec.back(); - names[mn->Id()]=qPrintable(mn->m->label()); + names[mn->Id()]=qUtf8Printable(mn->m->label()); } } @@ -263,7 +263,7 @@ void MeshTree::ProcessGlobal(vcg::AlignPair::Param &ap) for(int ii=0;iicm.Tr.Import(GluedTrVecOut[ii]); - cb(0,qPrintable(buf.sprintf("Completed Global Alignment (error bound %6.4f)\n",StartGlobErr))); + cb(0,qUtf8Printable(buf.sprintf("Completed Global Alignment (error bound %6.4f)\n",StartGlobErr))); } diff --git a/src/meshlabplugins/edit_manipulators/edit_manipulators.cpp b/src/meshlabplugins/edit_manipulators/edit_manipulators.cpp index 6114078b3..0ea3c84b0 100644 --- a/src/meshlabplugins/edit_manipulators/edit_manipulators.cpp +++ b/src/meshlabplugins/edit_manipulators/edit_manipulators.cpp @@ -1095,7 +1095,7 @@ void EditManipulatorsPlugin::Decorate(MeshModel &model, GLArea *gla, QPainter* / HelpString3 = "
press RETURN to apply, BACKSPACE to cancel"; } - this->RealTimeLog("Manipulator","",qPrintable(""+StatusString1+""+StatusString2+HelpString1+HelpString2+HelpString3)); + this->RealTimeLog("Manipulator","",qUtf8Printable(""+StatusString1+""+StatusString2+HelpString1+HelpString2+HelpString3)); // render original mesh BBox DrawMeshBox(model); diff --git a/src/meshlabplugins/edit_mutualcorrs/alignset.cpp b/src/meshlabplugins/edit_mutualcorrs/alignset.cpp index 700eaa09c..e7bbdcaf2 100644 --- a/src/meshlabplugins/edit_mutualcorrs/alignset.cpp +++ b/src/meshlabplugins/edit_mutualcorrs/alignset.cpp @@ -327,13 +327,13 @@ GLuint AlignSet::createShaderFromFiles(QString name) { const char *vs_src = ShaderUtils::importShaders(vert.toLocal8Bit().data()); if(!vs_src) { - cerr << "Could not load shader: " << qPrintable(vert) << endl; + cerr << "Could not load shader: " << qUtf8Printable(vert) << endl; return 0; } const char *fs_src = ShaderUtils::importShaders(frag.toLocal8Bit().data()); if(!fs_src) { - cerr << "Could not load shader: " << qPrintable(frag) << endl; + cerr << "Could not load shader: " << qUtf8Printable(frag) << endl; return 0; } diff --git a/src/meshlabplugins/filter_ao/filter_ao.cpp b/src/meshlabplugins/filter_ao/filter_ao.cpp index 7f819ba10..85b58be66 100644 --- a/src/meshlabplugins/filter_ao/filter_ao.cpp +++ b/src/meshlabplugins/filter_ao/filter_ao.cpp @@ -927,7 +927,7 @@ void AmbientOcclusionPlugin::dumpFloatTexture(QString filename, float *texdata, cdata[i] = (unsigned char)(texdata[i]*255.0); FILE *f; - f=fopen(qPrintable(filename) ,"wb+"); + f=fopen(qUtf8Printable(filename) ,"wb+"); fwrite(cdata,sizeof(unsigned char),elems,f); fclose(f); diff --git a/src/meshlabplugins/filter_bnpts/filter_bnpts.cpp b/src/meshlabplugins/filter_bnpts/filter_bnpts.cpp index e33c0e9b8..8825d5d1b 100644 --- a/src/meshlabplugins/filter_bnpts/filter_bnpts.cpp +++ b/src/meshlabplugins/filter_bnpts/filter_bnpts.cpp @@ -99,9 +99,9 @@ bool FilterBnptsPlugin::applyFilter(QAction *filter, MeshDocument &md, RichParam FILE* outfile=NULL; if(appendexisting) - outfile = fopen(qPrintable(filename), "wba"); + outfile = fopen(qUtf8Printable(filename), "wba"); else - outfile = fopen(qPrintable(filename), "wb"); + outfile = fopen(qUtf8Printable(filename), "wb"); if(outfile==NULL) return false; diff --git a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp index 8fe4e4b02..a557e5aea 100644 --- a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp +++ b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp @@ -272,7 +272,7 @@ bool FilterIsoParametrization::applyFilter(QAction *filter, MeshDocument& md, Ri { AbstractMesh *abs_mesh = new AbstractMesh(); ParamMesh *para_mesh = new ParamMesh(); - bool Done=isoPHandle().LoadBaseDomain(qPrintable(AbsLoadName),mesh,para_mesh,abs_mesh,true); + bool Done=isoPHandle().LoadBaseDomain(qUtf8Printable(AbsLoadName),mesh,para_mesh,abs_mesh,true); if (!Done) { this->errorMessage="Abstract domain doesnt fit well with the parametrized mesh"; @@ -285,7 +285,7 @@ bool FilterIsoParametrization::applyFilter(QAction *filter, MeshDocument& md, Ri QString AbsSaveName = par.getString("AbsSaveName"); if(!AbsSaveName.isEmpty()) { - isoPHandle().SaveBaseDomain(qPrintable(AbsSaveName)); + isoPHandle().SaveBaseDomain(qUtf8Printable(AbsSaveName)); } return true; } diff --git a/src/meshlabplugins/filter_layer/filter_layer.cpp b/src/meshlabplugins/filter_layer/filter_layer.cpp index ce9b60bc5..46105aaae 100644 --- a/src/meshlabplugins/filter_layer/filter_layer.cpp +++ b/src/meshlabplugins/filter_layer/filter_layer.cpp @@ -585,7 +585,7 @@ bool FilterLayerPlugin::applyFilter(QAction *filter, MeshDocument &md, RichParam if ((fi.suffix().toLower() == "out")) { unsigned int num_cams, num_points; - FILE *fp = fopen(qPrintable(fileName), "r"); + FILE *fp = fopen(qUtf8Printable(fileName), "r"); if (!fp) return false; ////Read header diff --git a/src/meshlabplugins/filter_mutualglobal/alignset.cpp b/src/meshlabplugins/filter_mutualglobal/alignset.cpp index 99673fd48..d46d8483b 100644 --- a/src/meshlabplugins/filter_mutualglobal/alignset.cpp +++ b/src/meshlabplugins/filter_mutualglobal/alignset.cpp @@ -1257,13 +1257,13 @@ GLuint AlignSet::createShaderFromFiles(QString name) { const char *vs_src = ShaderUtils::importShaders(vert.toLocal8Bit().data()); if(!vs_src) { - cerr << "Could not load shader: " << qPrintable(vert) << endl; + cerr << "Could not load shader: " << qUtf8Printable(vert) << endl; return 0; } const char *fs_src = ShaderUtils::importShaders(frag.toLocal8Bit().data()); if(!fs_src) { - cerr << "Could not load shader: " << qPrintable(frag) << endl; + cerr << "Could not load shader: " << qUtf8Printable(frag) << endl; return 0; } diff --git a/src/meshlabplugins/filter_mutualinfoxml/alignset.cpp b/src/meshlabplugins/filter_mutualinfoxml/alignset.cpp index 2bbf5b44c..b4af2df1c 100644 --- a/src/meshlabplugins/filter_mutualinfoxml/alignset.cpp +++ b/src/meshlabplugins/filter_mutualinfoxml/alignset.cpp @@ -302,13 +302,13 @@ GLuint AlignSet::createShaderFromFiles(QString name) { const char *vs_src = ShaderUtils::importShaders(vert.toLocal8Bit().data()); if(!vs_src) { - cerr << "Could not load shader: " << qPrintable(vert) << endl; + cerr << "Could not load shader: " << qUtf8Printable(vert) << endl; return 0; } const char *fs_src = ShaderUtils::importShaders(frag.toLocal8Bit().data()); if(!fs_src) { - cerr << "Could not load shader: " << qPrintable(frag) << endl; + cerr << "Could not load shader: " << qUtf8Printable(frag) << endl; return 0; } diff --git a/src/meshlabplugins/filter_plymc/filter_plymc.cpp b/src/meshlabplugins/filter_plymc/filter_plymc.cpp index 85317b99b..17d30dec1 100644 --- a/src/meshlabplugins/filter_plymc/filter_plymc.cpp +++ b/src/meshlabplugins/filter_plymc/filter_plymc.cpp @@ -166,17 +166,17 @@ bool PlyMCPlugin::applyFilter(QAction *filter, MeshDocument &md, RichParameterSe tri::Smooth::FaceNormalLaplacianVF(sm); //QString mshTmpPath=QDir::tempPath()+QString("/")+QString(mm->shortName())+QString(".vmi"); QString mshTmpPath=QString("__TMP")+QString(mm->shortName())+QString(".vmi"); - qDebug("Saving tmp file %s",qPrintable(mshTmpPath)); - int retVal = tri::io::ExporterVMI::Save(sm,qPrintable(mshTmpPath) ); + qDebug("Saving tmp file %s",qUtf8Printable(mshTmpPath)); + int retVal = tri::io::ExporterVMI::Save(sm,qUtf8Printable(mshTmpPath) ); if(retVal!=0) { - qDebug("Failed to write vmi temp file %s",qPrintable(mshTmpPath)); + qDebug("Failed to write vmi temp file %s",qUtf8Printable(mshTmpPath)); errorMessage = "Failed to write vmi temp file " + mshTmpPath; - Log("ERROR - Failed to write vmi temp file %s", qPrintable(mshTmpPath)); + Log("ERROR - Failed to write vmi temp file %s", qUtf8Printable(mshTmpPath)); return false; } - pmc.MP.AddSingleMesh(qPrintable(mshTmpPath)); - Log("Preprocessing mesh %s",qPrintable(mm->shortName())); + pmc.MP.AddSingleMesh(qUtf8Printable(mshTmpPath)); + Log("Preprocessing mesh %s",qUtf8Printable(mm->shortName())); } } diff --git a/src/meshlabplugins/filter_qhull/filter_qhull.cpp b/src/meshlabplugins/filter_qhull/filter_qhull.cpp index 7697d19a9..07db4ce35 100644 --- a/src/meshlabplugins/filter_qhull/filter_qhull.cpp +++ b/src/meshlabplugins/filter_qhull/filter_qhull.cpp @@ -417,7 +417,7 @@ bool QhullPlugin::applyFilter(QAction *filter, MeshDocument &md, RichParameterSe break; } - MeshModel &pm =*md.addNewMesh("",qPrintable(name)); + MeshModel &pm =*md.addNewMesh("",qUtf8Printable(name)); if (!alphashape && !pm.hasDataMask(MeshModel::MM_FACEQUALITY)) { diff --git a/src/meshlabplugins/filter_sampling/filter_sampling.cpp b/src/meshlabplugins/filter_sampling/filter_sampling.cpp index 7e91983b8..02b5cfd3f 100644 --- a/src/meshlabplugins/filter_sampling/filter_sampling.cpp +++ b/src/meshlabplugins/filter_sampling/filter_sampling.cpp @@ -1079,7 +1079,7 @@ switch(ID(action)) tri::UpdatePosition::Matrix(mm1->cm, Inverse(mm1->cm.Tr), true); Log("Hausdorff Distance computed"); - Log(" Sampled %i pts (rng: 0) on %s searched closest on %s",hs.n_total_samples,qPrintable(mm0->label()),qPrintable(mm1->label())); + Log(" Sampled %i pts (rng: 0) on %s searched closest on %s",hs.n_total_samples,qUtf8Printable(mm0->label()),qUtf8Printable(mm1->label())); Log(" min : %f max %f mean : %f RMS : %f",hs.getMinDist(),hs.getMaxDist(),hs.getMeanDist(),hs.getRMSDist()); float d = mm0->cm.bbox.Diag(); Log("Values w.r.t. BBox Diag (%f)",d); @@ -1136,7 +1136,7 @@ switch(ID(action)) tri::UpdatePosition::Matrix(mm1->cm, Inverse(mm1->cm.Tr), true); Log("Distance from Reference Mesh computed"); - Log(" Sampled %i vertices on %s searched closest on %s", mm0->cm.vn, qPrintable(mm0->label()), qPrintable(mm1->label())); + Log(" Sampled %i vertices on %s searched closest on %s", mm0->cm.vn, qUtf8Printable(mm0->label()), qUtf8Printable(mm1->label())); Log(" min : %f max %f mean : %f RMS : %f", ds.getMaxDist(), ds.getMaxDist(), ds.getMeanDist(), ds.getRMSDist()); } break; diff --git a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp index db9c490ae..d41a85e20 100644 --- a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp +++ b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp @@ -74,7 +74,7 @@ bool FilterSketchFabPlugin::applyFilter( const QString& filterName, MeshDocument this->fcb=cb; QString APIToken = env.evalString("sketchFabKeyCode"); this->fcb(1,"Compressing Mesh"); - qDebug("APIToken = '%s' ",qPrintable(APIToken)); + qDebug("APIToken = '%s' ",qUtf8Printable(APIToken)); Matrix44m rot; rot.SetRotateDeg(-90,Point3m(1,0,0)); Matrix44m rotI; rot.SetRotateDeg(90,Point3m(1,0,0)); @@ -95,14 +95,14 @@ bool FilterSketchFabPlugin::applyFilter( const QString& filterName, MeshDocument int mask=0; if(md.mm()->hasDataMask(MeshModel::MM_VERTCOLOR)) mask+=tri::io::Mask::IOM_VERTCOLOR; tri::UpdatePosition::Matrix(md.mm()->cm,rot); - vcg::tri::io::ExporterPLY::Save(md.mm()->cm,qPrintable(tmpObjFileName),mask,true); + vcg::tri::io::ExporterPLY::Save(md.mm()->cm,qUtf8Printable(tmpObjFileName),mask,true); tri::UpdatePosition::Matrix(md.mm()->cm,rotI); - qDebug("Saved %20s",qPrintable(tmpObjFileName)); - qDebug("Compressed %20s",qPrintable(tmpZipFileName)); - saveMeshZip(qPrintable(tmpObjFileName),"xxxx.ply",qPrintable(tmpZipFileName)); + qDebug("Saved %20s",qUtf8Printable(tmpObjFileName)); + qDebug("Compressed %20s",qUtf8Printable(tmpZipFileName)); + saveMeshZip(qUtf8Printable(tmpObjFileName),"xxxx.ply",qUtf8Printable(tmpZipFileName)); this->zipFileName = tmpZipFileName; - qDebug("Model Title %s %s %s\n",qPrintable(this->name),qPrintable(this->description),qPrintable(this->tags)); + qDebug("Model Title %s %s %s\n",qUtf8Printable(this->name),qUtf8Printable(this->description),qUtf8Printable(this->tags)); qDebug("Starting Upload"); this->fcb(10,"Starting Upload"); bool ret = this->upload(); @@ -112,7 +112,7 @@ bool FilterSketchFabPlugin::applyFilter( const QString& filterName, MeshDocument } this->Log("Upload Completed; you can access the uploaded model at the following URL:\n"); - this->Log("%s\n",qPrintable(this->sketchfabModelUrl),qPrintable(this->sketchfabModelUrl)); + this->Log("%s\n",qUtf8Printable(this->sketchfabModelUrl),qUtf8Printable(this->sketchfabModelUrl)); return true; } return false; diff --git a/src/meshlabplugins/io_3ds/meshio.cpp b/src/meshlabplugins/io_3ds/meshio.cpp index e5e374b48..04785e506 100644 --- a/src/meshlabplugins/io_3ds/meshio.cpp +++ b/src/meshlabplugins/io_3ds/meshio.cpp @@ -115,7 +115,7 @@ bool ExtraMeshIOPlugin::open(const QString &formatName, const QString &fileName, { bool normalsUpdated = false; - MeshModel &mm = *m.parent->addNewMesh(qPrintable(fileName), QString(p->name), false); + MeshModel &mm = *m.parent->addNewMesh(qUtf8Printable(fileName), QString(p->name), false); if (cb != NULL) (*cb)(i, (QString("Loading Mesh ")+QString(p->name)).toStdString().c_str()); vcg::tri::io::Importer3DS::LoadMask(file, p, info); diff --git a/src/meshlabplugins/io_base/baseio.cpp b/src/meshlabplugins/io_base/baseio.cpp index 178d71928..498758ec5 100644 --- a/src/meshlabplugins/io_base/baseio.cpp +++ b/src/meshlabplugins/io_base/baseio.cpp @@ -265,7 +265,7 @@ bool BaseMeshIOPlugin::open(const QString &formatName, const QString &fileName, } } if (someTextureNotFound) - Log("Missing texture files: %s", qPrintable(missingTextureFilesMsg)); + Log("Missing texture files: %s", qUtf8Printable(missingTextureFilesMsg)); if (cb != NULL) (*cb)(99, "Done"); diff --git a/src/meshlabplugins/io_collada/io_collada.cpp b/src/meshlabplugins/io_collada/io_collada.cpp index 129e2c5ee..8478f84d2 100644 --- a/src/meshlabplugins/io_collada/io_collada.cpp +++ b/src/meshlabplugins/io_collada/io_collada.cpp @@ -172,7 +172,7 @@ void ColladaIOPlugin::initPreOpenParameter(const QString &/*format*/, const QStr { QString idVal = geomList.at(i).toElement().attribute("id"); idList.push_back(idVal); - qDebug("Node %i geom id = '%s'",i,qPrintable(idVal)); + qDebug("Node %i geom id = '%s'",i,qUtf8Printable(idVal)); } parlst.addParam(new RichEnum("geomnode",0, idList, tr("geometry nodes"), tr("dsasdfads"))); qDebug("Time elapsed: %d ms", t.elapsed()); diff --git a/src/meshlabplugins/io_ctm/io_ctm.cpp b/src/meshlabplugins/io_ctm/io_ctm.cpp index eb39d92f1..634d6af41 100644 --- a/src/meshlabplugins/io_ctm/io_ctm.cpp +++ b/src/meshlabplugins/io_ctm/io_ctm.cpp @@ -40,7 +40,7 @@ using namespace vcg; bool IOMPlugin::open(const QString & /*formatName*/, const QString &fileName, MeshModel &m, int& mask,const RichParameterSet & /*par*/, CallBackPos *cb, QWidget * /*parent*/) { QString errorMsgFormat = "Error encountered while loading file:\n\"%1\"\n\nError details: %2"; - int result = tri::io::ImporterCTM::Open(m.cm, qPrintable(fileName), mask, cb); + int result = tri::io::ImporterCTM::Open(m.cm, qUtf8Printable(fileName), mask, cb); if (result != 0) // all the importers return 0 on success { errorMessage = errorMsgFormat.arg(fileName, tri::io::ImporterCTM::ErrorMsg(result)); @@ -53,11 +53,11 @@ bool IOMPlugin::save(const QString & /*formatName*/, const QString &fileName, Me { bool lossLessFlag = par.findParameter("LossLess")->val->getBool(); float relativePrecisionParam = par.findParameter("relativePrecisionParam")->val->getFloat(); - int result = vcg::tri::io::ExporterCTM::Save(m.cm,qPrintable(fileName),mask,lossLessFlag,relativePrecisionParam); + int result = vcg::tri::io::ExporterCTM::Save(m.cm,qUtf8Printable(fileName),mask,lossLessFlag,relativePrecisionParam); if(result!=0) { QString errorMsgFormat = "Error encountered while exportering file %1:\n%2"; - QMessageBox::warning(parent, tr("Saving Error"), errorMsgFormat.arg(qPrintable(fileName), vcg::tri::io::ExporterCTM::ErrorMsg(result))); + QMessageBox::warning(parent, tr("Saving Error"), errorMsgFormat.arg(qUtf8Printable(fileName), vcg::tri::io::ExporterCTM::ErrorMsg(result))); return false; } return true; diff --git a/src/meshlabplugins/io_pdb/io_pdb.cpp b/src/meshlabplugins/io_pdb/io_pdb.cpp index 27487efac..6ae87d83f 100644 --- a/src/meshlabplugins/io_pdb/io_pdb.cpp +++ b/src/meshlabplugins/io_pdb/io_pdb.cpp @@ -88,7 +88,7 @@ bool PDBIOPlugin::open(const QString &formatName, const QString &fileName, MeshM mask |= vcg::tri::io::Mask::IOM_VERTCOLOR; m.Enable(mask); - return parsePDB(qPrintable(fileName), m.cm, parlst, cb); + return parsePDB(qUtf8Printable(fileName), m.cm, parlst, cb); /* diff --git a/src/meshlabplugins/io_tri/io_tri.cpp b/src/meshlabplugins/io_tri/io_tri.cpp index 94eb8d14b..3440ce90c 100755 --- a/src/meshlabplugins/io_tri/io_tri.cpp +++ b/src/meshlabplugins/io_tri/io_tri.cpp @@ -53,7 +53,7 @@ bool TriIOPlugin::open(const QString &formatName, const QString &fileName, MeshM { mask |= vcg::tri::io::Mask::IOM_WEDGTEXCOORD; m.Enable(mask); - return parseTRI(qPrintable(fileName), m.cm); + return parseTRI(qUtf8Printable(fileName), m.cm); } if(formatName.toUpper() == tr("ASC")) { @@ -61,7 +61,7 @@ bool TriIOPlugin::open(const QString &formatName, const QString &fileName, MeshM m.Enable(mask); bool triangulate = parlst.getBool("triangulate"); int rowToSkip = parlst.getInt("rowToSkip"); - int result = tri::io::ImporterASC::Open(m.cm, qPrintable(fileName),cb,triangulate,rowToSkip); + int result = tri::io::ImporterASC::Open(m.cm, qUtf8Printable(fileName),cb,triangulate,rowToSkip); if (result != 0) // all the importers return 0 on success { errorMessage = QString("Failed to open:")+fileName; @@ -247,12 +247,12 @@ bool parseTRI(const std::string &filename, CMeshO &m) { texturePNG.load(texPNG); if(!texturePNG.isNull()) { - qDebug("Image Loaded %s has %i keys",qPrintable(texPNG),texturePNG.textKeys().size()); + qDebug("Image Loaded %s has %i keys",qUtf8Printable(texPNG),texturePNG.textKeys().size()); QString infoPNG=texturePNG.text("uv"); if(!infoPNG.isNull()) { - m.textures.push_back(qPrintable(texPNG)); - qDebug("Loading texture %s",qPrintable(texPNG)); + m.textures.push_back(qUtf8Printable(texPNG)); + qDebug("Loading texture %s",qUtf8Printable(texPNG)); QStringList numList = infoPNG.split(" ", QString::SkipEmptyParts); qDebug("Found %i numbers for %i faces",numList.size(),numFaces); for (int i = 0; i < numFaces ; ++i) @@ -291,8 +291,8 @@ bool parseTRI(const std::string &filename, CMeshO &m) { if(texCode==QString("TC00")) floatFlag=false; - m.textures.push_back(qPrintable(texJPG)); - qDebug("Loading texture %s",qPrintable(texJPG)); + m.textures.push_back(qUtf8Printable(texJPG)); + qDebug("Loading texture %s",qUtf8Printable(texJPG)); for (int i = 0; i < numFaces ; ++i) { diff --git a/src/meshlabplugins/io_u3d/io_u3d.cpp b/src/meshlabplugins/io_u3d/io_u3d.cpp index f4719d8a8..68ffb1df5 100644 --- a/src/meshlabplugins/io_u3d/io_u3d.cpp +++ b/src/meshlabplugins/io_u3d/io_u3d.cpp @@ -58,7 +58,7 @@ QString U3DIOPlugin::computePluginsPath() #elif defined(Q_OS_LINUX) pluginsDir.cd("U3D_LINUX"); #endif - qDebug("U3D plugins dir %s", qPrintable(pluginsDir.absolutePath())); + qDebug("U3D plugins dir %s", qUtf8Printable(pluginsDir.absolutePath())); return pluginsDir.absolutePath(); } @@ -124,7 +124,7 @@ bool U3DIOPlugin::save(const QString &formatName, const QString &fileName, MeshM return false; } - int result = tri::io::ExporterU3D::Save(m.cm,filename.c_str(),qPrintable(converterCommandLine),_param,mask); + int result = tri::io::ExporterU3D::Save(m.cm,filename.c_str(),qUtf8Printable(converterCommandLine),_param,mask); vcg::tri::io::ExporterIDTF::removeConvertedTGATextures(lst); if(result!=0) { diff --git a/src/meshlabplugins/render_gdp/meshrender.cpp b/src/meshlabplugins/render_gdp/meshrender.cpp index 5841ce669..2d9f7565f 100644 --- a/src/meshlabplugins/render_gdp/meshrender.cpp +++ b/src/meshlabplugins/render_gdp/meshrender.cpp @@ -57,7 +57,7 @@ void MeshShaderRenderPlugin::initActionList() { "Unable to find the shaders directory.\n" "No shaders will be loaded."); } - qDebug("Shader directory found '%s', and it contains %i gdp files", qPrintable(shadersDir.path()), shadersDir.entryList(QStringList("*.gdp")).size()); + qDebug("Shader directory found '%s', and it contains %i gdp files", qUtf8Printable(shadersDir.path()), shadersDir.entryList(QStringList("*.gdp")).size()); QDomDocument doc; @@ -218,14 +218,14 @@ void MeshShaderRenderPlugin::initActionList() { qa->setCheckable(false); actionList << qa; } - else qDebug("Failed root.nodeName() == GLSLang) (for %s)", qPrintable(fileName)); + else qDebug("Failed root.nodeName() == GLSLang) (for %s)", qUtf8Printable(fileName)); } else { - qDebug("Failed doc.setContent(%s)", qPrintable(fileName)); + qDebug("Failed doc.setContent(%s)", qUtf8Printable(fileName)); file.close(); } } - else qDebug("Failed file.open(%s)", qPrintable(shadersDir.absoluteFilePath(fileName))); + else qDebug("Failed file.open(%s)", qUtf8Printable(shadersDir.absoluteFilePath(fileName))); } } } diff --git a/src/meshlabserver/mainserver.cpp b/src/meshlabserver/mainserver.cpp index 1b1b675b7..efeac0556 100644 --- a/src/meshlabserver/mainserver.cpp +++ b/src/meshlabserver/mainserver.cpp @@ -88,7 +88,7 @@ public: if(!fp) return; foreach(MeshFilterInterface *iFilter, PM.meshFilterPlugins()) foreach(QAction *filterAction, iFilter->actions()) - fprintf(fp, "*%s
%s
\n",qPrintable(filterAction->text()), qPrintable(iFilter->filterInfo(filterAction))); + fprintf(fp, "*%s
%s
\n", qUtf8Printable(filterAction->text()), qUtf8Printable(iFilter->filterInfo(filterAction))); } void dumpPluginInfoDoxygen(FILE *fp) @@ -106,7 +106,7 @@ public: fprintf(fp, "\n\\section f%i %s \n\n" "%s\n" - ,i++,qPrintable(filterAction->text()),qPrintable(iFilter->filterInfo(filterAction))); + ,i++, qUtf8Printable(filterAction->text()), qUtf8Printable(iFilter->filterInfo(filterAction))); fprintf(fp, "

Parameters

\n"); // fprintf(fp, "\\paragraph fp%i Parameters\n",i); @@ -117,7 +117,7 @@ public: foreach(RichParameter* pp, FPM[filterAction->text()].paramList) { fprintf(fp," \\c %s %s %s -- \n", - qPrintable(pp->val->typeName()),qPrintable(pp->pd->fieldDesc),qPrintable(pp->pd->tooltip)); + qUtf8Printable(pp->val->typeName()), qUtf8Printable(pp->pd->fieldDesc), qUtf8Printable(pp->pd->tooltip)); } fprintf(fp,"\n"); } @@ -145,7 +145,7 @@ public: QDir::setCurrent(fi.absolutePath()); QString extension = fi.suffix(); - qDebug("Opening a file with extention %s",qPrintable(extension)); + qDebug("Opening a file with extention %s", qUtf8Printable(extension)); // retrieving corresponding IO plugin MeshIOInterface* pCurrentIOPlugin = PM.allKnowInputFormats[extension.toLower()]; if (pCurrentIOPlugin == 0) @@ -161,7 +161,7 @@ public: if (!pCurrentIOPlugin->open(extension, fileName, mm ,mask,prePar)) { - fprintf(fp,"MeshLabServer: Failed loading of %s from dir %s\n",qPrintable(fileName),qPrintable(QDir::currentPath())); + fprintf(fp,"MeshLabServer: Failed loading of %s from dir %s\n", qUtf8Printable(fileName), qUtf8Printable(QDir::currentPath())); QDir::setCurrent(curDir.absolutePath()); return false; } @@ -317,7 +317,7 @@ public: } if (!scriptPtr.open(scriptfile)) { - printf("File %s was not found.\n",qPrintable(scriptfile)); + printf("File %s was not found.\n", qUtf8Printable(scriptfile)); return false; } fprintf(fp,"Starting Script of %i actions",scriptPtr.filtparlist.size()); @@ -327,13 +327,13 @@ public: bool ret = false; //RichParameterSet &par = (*ii).second; QString fname = (*ii)->filterName(); - fprintf(fp,"filter: %s\n",qPrintable(fname)); + fprintf(fp,"filter: %s\n", qUtf8Printable(fname)); if (!(*ii)->isXMLFilter()) { QAction *action = PM.actionFilterMap[ fname]; if (action == NULL) { - fprintf(fp,"filter %s not found",qPrintable(fname)); + fprintf(fp,"filter %s not found", qUtf8Printable(fname)); return false; } @@ -355,7 +355,7 @@ public: //The parameters in the script file are more than the required parameters of the filter. The script file is not correct. if (required.paramList.size() < parameterSet.paramList.size()) { - fprintf(fp,"The parameters in the script file are more than the filter %s requires.\n",qPrintable(fname)); + fprintf(fp,"The parameters in the script file are more than the filter %s requires.\n", qUtf8Printable(fname)); return false; } @@ -562,10 +562,10 @@ public: QStringList logOutput; log.print(logOutput); foreach(QString logEntry, logOutput) - fprintf(fp,"%s\n",qPrintable(logEntry)); + fprintf(fp,"%s\n",qUtf8Printable(logEntry)); if(!ret) { - fprintf(fp,"Problem with filter: %s\n",qPrintable(fname)); + fprintf(fp,"Problem with filter: %s\n",qUtf8Printable(fname)); return false; } } @@ -606,7 +606,7 @@ namespace commandline void usage() { - printf("MeshLabServer version: %s\n", qPrintable(MeshLabApplication::appVer())); + printf("MeshLabServer version: %s\n", qUtf8Printable(MeshLabApplication::appVer())); QFile docum(":/meshlabserver.txt"); if (!docum.open(QIODevice::ReadOnly)) { @@ -614,7 +614,7 @@ namespace commandline exit(-1); } QString help(docum.readAll()); - printf("\nUsage:\n%s",qPrintable(help)); + printf("\nUsage:\n%s",qUtf8Printable(help)); docum.close(); } @@ -764,19 +764,19 @@ int main(int argc, char *argv[]) QString inputproject = finfo.absoluteFilePath(); if (finfo.completeSuffix().toLower() != "mlp") { - fprintf(logfp,"Project %s is not a valid \'mlp\' file format. MeshLabServer application will exit.\n",qPrintable(inputproject)); + fprintf(logfp,"Project %s is not a valid \'mlp\' file format. MeshLabServer application will exit.\n",qUtf8Printable(inputproject)); //system("pause"); exit(-1); } bool opened = server.openProject(meshDocument,inputproject); if (!opened) { - fprintf(logfp,"MeshLab Project %s has not been correctly opened. MeshLabServer application will exit.\n",qPrintable(inputproject)); + fprintf(logfp,"MeshLab Project %s has not been correctly opened. MeshLabServer application will exit.\n",qUtf8Printable(inputproject)); //system("pause"); exit(-1); } else - fprintf(logfp,"MeshLab Project %s has been loaded.\n",qPrintable(inputproject)); + fprintf(logfp,"MeshLab Project %s has been loaded.\n",qUtf8Printable(inputproject)); ++i; } else @@ -798,7 +798,7 @@ int main(int argc, char *argv[]) pr.filename = finfo.absoluteFilePath(); if (finfo.completeSuffix().toLower() != "mlp") { - fprintf(logfp,"Project %s is not a valid \'mlp\' file format. Output file will be renamed as %s.mlp .\n",qPrintable(pr.filename),qPrintable(pr.filename + ".mlp")); + fprintf(logfp,"Project %s is not a valid \'mlp\' file format. Output file will be renamed as %s.mlp .\n",qUtf8Printable(pr.filename),qUtf8Printable(pr.filename + ".mlp")); pr.filename += ".mlp"; } ++i; @@ -823,18 +823,18 @@ int main(int argc, char *argv[]) MeshModel* mmod = meshDocument.addNewMesh(info.absoluteFilePath(),""); if (mmod == NULL) { - fprintf(logfp,"It was not possible to add new mesh %s to MeshLabServer. The program will exit\n",qPrintable(info.absoluteFilePath())); + fprintf(logfp,"It was not possible to add new mesh %s to MeshLabServer. The program will exit\n",qUtf8Printable(info.absoluteFilePath())); //system("pause"); exit(-1); } bool opened = server.importMesh(*mmod, info.absoluteFilePath(),logfp); if (!opened) { - fprintf(logfp,"It was not possible to import mesh %s into MeshLabServer. The program will exit\n ",qPrintable(info.absoluteFilePath())); + fprintf(logfp,"It was not possible to import mesh %s into MeshLabServer. The program will exit\n ",qUtf8Printable(info.absoluteFilePath())); //system("pause"); exit(-1); } - fprintf(logfp,"Mesh %s loaded has %i vn %i fn\n", qPrintable(info.absoluteFilePath()), mmod->cm.vn, mmod->cm.fn); + fprintf(logfp,"Mesh %s loaded has %i vn %i fn\n", qUtf8Printable(info.absoluteFilePath()), mmod->cm.vn, mmod->cm.fn); i++; } i++; @@ -853,7 +853,7 @@ int main(int argc, char *argv[]) /*WARNING! in order to maintain backward SYNTAX compatibility (not the SEMANTIC one!) by default the outputmesh saved is the one contained in the current layer*/ outfl.layerposition = OutFileMesh::currentlayerconst; - fprintf(logfp,"output mesh %s\n", qPrintable(outfl.filename)); + fprintf(logfp,"output mesh %s\n", qUtf8Printable(outfl.filename)); i++; } @@ -970,7 +970,7 @@ int main(int argc, char *argv[]) } default: { - printf("Something bad happened parsing the document. String %s\n",qPrintable(argv[i])); + printf("Something bad happened parsing the document. String %s\n",qUtf8Printable(argv[i])); //system("pause"); exit(-1); } @@ -979,11 +979,11 @@ int main(int argc, char *argv[]) for(int ii = 0; ii < scriptfiles.size();++ii) { - fprintf(logfp,"Apply FilterScript: '%s'\n",qPrintable(scriptfiles[ii])); + fprintf(logfp,"Apply FilterScript: '%s'\n",qUtf8Printable(scriptfiles[ii])); bool returnValue = server.script(meshDocument, scriptfiles[ii],logfp); if(!returnValue) { - fprintf(logfp,"Failed to apply script file %s\n",qPrintable(scriptfiles[ii])); + fprintf(logfp,"Failed to apply script file %s\n",qUtf8Printable(scriptfiles[ii])); //system("pause"); exit(-1); } @@ -1000,10 +1000,10 @@ int main(int argc, char *argv[]) } bool saved = server.saveProject(meshDocument,outprojectfiles[ii].filename,outfilemiddlename); if (saved) - fprintf(logfp,"Output project has been saved in %s.\n",qPrintable(outprojectfiles[ii].filename)); + fprintf(logfp,"Output project has been saved in %s.\n",qUtf8Printable(outprojectfiles[ii].filename)); else { - fprintf(logfp,"Project %s has not been correctly saved in. MeshLabServer Application will exit.\n",qPrintable(outprojectfiles[ii].filename)); + fprintf(logfp,"Project %s has not been correctly saved in. MeshLabServer Application will exit.\n",qUtf8Printable(outprojectfiles[ii].filename)); //system("pause"); exit(-1); } @@ -1031,15 +1031,15 @@ int main(int argc, char *argv[]) if (meshmod != NULL) exported = server.exportMesh(meshDocument.meshList[layertobesaved], outmeshlist[ii].mask, outmeshlist[ii].filename, logfp); if (exported) - fprintf(logfp, "Mesh %s saved as %s (%i vn %i fn)\n", qPrintable(meshmod->fullName()), qPrintable(outmeshlist[ii].filename), meshmod->cm.vn, meshmod->cm.fn); + fprintf(logfp, "Mesh %s saved as %s (%i vn %i fn)\n", qUtf8Printable(meshmod->fullName()), qUtf8Printable(outmeshlist[ii].filename), meshmod->cm.vn, meshmod->cm.fn); else - fprintf(logfp, "Output mesh %s has NOT been saved\n", qPrintable(outmeshlist[ii].filename)); + fprintf(logfp, "Output mesh %s has NOT been saved\n", qUtf8Printable(outmeshlist[ii].filename)); } else - fprintf(logfp, "Output mesh %s has NOT been saved. A not existent layer has been requested to be saved\n", qPrintable(outmeshlist[ii].filename)); + fprintf(logfp, "Output mesh %s has NOT been saved. A not existent layer has been requested to be saved\n", qUtf8Printable(outmeshlist[ii].filename)); } else - fprintf(logfp, "Invalid layer number %i. Last layer in the current document is the number %i. Output mesh %s will not be saved\n", outmeshlist[ii].layerposition, meshDocument.meshList.size() - 1, qPrintable(outmeshlist[ii].filename)); + fprintf(logfp, "Invalid layer number %i. Last layer in the current document is the number %i. Output mesh %s will not be saved\n", outmeshlist[ii].layerposition, meshDocument.meshList.size() - 1, qUtf8Printable(outmeshlist[ii].filename)); }