From: Renaud Barate Date: Thu, 10 Jul 2014 09:57:17 +0000 (+0200) Subject: Support of non-ASCII filenames (to some extent) X-Git-Tag: V7_5_0a1~26 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1ca8b39624a40ef86ebe33b1a32158126fa51e95;hp=5ef3cacad74364071f6acf450184d184df071566;p=modules%2Fyacs.git Support of non-ASCII filenames (to some extent) Non-ASCII filenames can be used to load and save schemas. Function SaveAs still strips the accents. Windows compatibility is not tested yet. --- diff --git a/src/genericgui/GenericGui.cxx b/src/genericgui/GenericGui.cxx index 9dd62d4d6..31d51b782 100644 --- a/src/genericgui/GenericGui.cxx +++ b/src/genericgui/GenericGui.cxx @@ -1291,7 +1291,7 @@ void GenericGui::loadSchema(const std::string& filename,bool edit, bool arrangeL { DEBTRACE(logger->getStr()); } - QString fn=QString::fromStdString(filename); + QString fn=QString::fromUtf8(filename.c_str()); if(edit) createContext(proc, fn, "", true); else @@ -1331,11 +1331,11 @@ void GenericGui::onImportSchema() if (!fi.exists() && fi.suffix() != "xml") fn += ".xml"; - DEBTRACE("file loaded : " <load(fn.toLatin1()); + proc = _loader->load(fn.toUtf8().constData()); } catch (...) { } @@ -1529,12 +1529,12 @@ void GenericGui::onExportSchema() } if (fn.isEmpty()) return; - DEBTRACE("GenericGui::onExportSchema: " << fn.toStdString()); + DEBTRACE("GenericGui::onExportSchema: " << fn.toUtf8().constData()); //to be sure that all pending changes are effective _parent->setFocus(); QtGuiContext::getQtCurrent()->setFileName(fn); VisitorSaveGuiSchema aWriter(proc); - aWriter.openFileSchema( fn.toStdString() ); + aWriter.openFileSchema( fn.toUtf8().constData() ); aWriter.visitProc(); aWriter.closeFileSchema(); QtGuiContext::getQtCurrent()->setNotSaved(false); @@ -1555,10 +1555,10 @@ void GenericGui::onExportSchemaAs() QString fn = getSaveFileName(fo); if (fn.isEmpty()) return; - DEBTRACE("GenericGui::onExportSchemaAs: " << fn.toStdString()); + DEBTRACE("GenericGui::onExportSchemaAs: " << fn.toUtf8().constData()); QtGuiContext::getQtCurrent()->setFileName(fn); VisitorSaveGuiSchema aWriter(proc); - aWriter.openFileSchema(fn.toStdString()); + aWriter.openFileSchema(fn.toUtf8().constData()); aWriter.visitProc(); aWriter.closeFileSchema(); _isSaved = true;