From fa227f474cad435c0df7d8a5fa74ad0cdc657283 Mon Sep 17 00:00:00 2001 From: Marco Callieri Date: Mon, 19 Feb 2018 18:32:05 +0100 Subject: [PATCH] fix for double-click loading models/projects using accened/non standard chars Qstring needs to know the char space to properly convert the chars. apparently, for command line arguments char* we have to use Qstring::fromLocal8Bit --- src/meshlab/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/meshlab/main.cpp b/src/meshlab/main.cpp index 0928fa5ef..1bcad16ca 100644 --- a/src/meshlab/main.cpp +++ b/src/meshlab/main.cpp @@ -61,10 +61,10 @@ int main(int argc, char *argv[]) "for a longer documentation\n" ); - if(QString(argv[1]).endsWith("mlp",Qt::CaseInsensitive) || QString(argv[1]).endsWith("mlb", Qt::CaseInsensitive) || QString(argv[1]).endsWith("aln",Qt::CaseInsensitive) || QString(argv[1]).endsWith("out",Qt::CaseInsensitive) || QString(argv[1]).endsWith("nvm",Qt::CaseInsensitive)) - window.openProject(argv[1]); + if(QString::fromLocal8Bit(argv[1]).endsWith("mlp",Qt::CaseInsensitive) || QString::fromLocal8Bit(argv[1]).endsWith("mlb", Qt::CaseInsensitive) || QString::fromLocal8Bit(argv[1]).endsWith("aln",Qt::CaseInsensitive) || QString::fromLocal8Bit(argv[1]).endsWith("out",Qt::CaseInsensitive) || QString::fromLocal8Bit(argv[1]).endsWith("nvm",Qt::CaseInsensitive)) + window.openProject(QString::fromLocal8Bit(argv[1])); else - window.importMeshWithLayerManagement(argv[1]); + window.importMeshWithLayerManagement(QString::fromLocal8Bit(argv[1])); } //else if(filterObj->noEvent) window.open(); return app.exec();