Commit 2c6ad25a authored by Joachim Pouderoux's avatar Joachim Pouderoux Committed by Mathieu Westphal
Browse files

Enable use of accentuated file and folder names in ParaView

jpouderoux version rebased
Replace Latin1 by UTF-8 everywhere in qt.
Add support for accentuated chars on Windows.
Add XML test for the feature.
parent f4b1fecd
......@@ -64,6 +64,7 @@ void vtkPVInitializePythonModules();
#include <QDragEnterEvent>
#include <QDropEvent>
#include <QMimeData>
#include <QTextCodec>
#include <QUrl>
#ifdef PARAVIEW_ENABLE_EMBEDDED_DOCUMENTATION
......@@ -91,6 +92,12 @@ public:
//-----------------------------------------------------------------------------
ParaViewMainWindow::ParaViewMainWindow()
{
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
// force the use of UTF-8 text codec (Latin1 is default with Qt 4.8)
// this is important for support of accentuated paths.
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
#endif
// the debug leaks view should be constructed as early as possible
// so that it can monitor vtk objects created at application startup.
if (getenv("PV_DEBUG_LEAKS_VIEW"))
......
<?xml version="1.0" ?>
<pqevents>
<pqevent object="pqClientMainWindow/MainControlsToolbar/actionOpenData" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/FileOpenDialog" command="filesSelected" arguments="$PARAVIEW_DATA_ROOT/blow.vtk" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/menubar" command="activate" arguments="menu_File" />
<pqevent object="pqClientMainWindow/menubar/menu_File" command="activate" arguments="actionFileSaveData" />
<pqevent object="pqClientMainWindow/FileSaveDialog" command="remove" arguments="$PARAVIEW_TEST_ROOT/test-éàô.vtk" />
<pqevent object="pqClientMainWindow/FileSaveDialog" command="filesSelected" arguments="$PARAVIEW_TEST_ROOT/test-éàô.vtk" />
<pqevent object="pqClientMainWindow/WriterSettingsDialog/widget/OKButton" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Delete" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/MainControlsToolbar/actionOpenData" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/FileOpenDialog" command="filesSelected" arguments="$PARAVIEW_TEST_ROOT/test-éàô.vtk" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/menubar" command="activate" arguments="menu_Catalyst" />
<pqevent object="pqClientMainWindow/menubar/menuTools" command="activate" arguments="actionTesting_Window_Size" />
<pqevent object="pqClientMainWindow/axesToolbar/actionShowOrientationAxes" command="set_boolean" arguments="false" />
<pqevent object="pqClientMainWindow/variableToolbar/actionScalarBarVisibility" command="set_boolean" arguments="false" />
</pqevents>
......@@ -28,6 +28,7 @@ paraview_test_load_data(""
,REGEX:tensors_.*\\.vti
artifact.dta
"blow data.myvtk"
blow.vtk
bluntfin.vts
can.ex2
comb.q
......@@ -232,6 +233,7 @@ if (NOT PARAVIEW_ENABLE_XDMF3)
endif()
list(APPEND TESTS_WITH_BASELINES
${CMAKE_CURRENT_SOURCE_DIR}/AccentuatedFilename.xml
${CMAKE_CURRENT_SOURCE_DIR}/Annotations.xml
${CMAKE_CURRENT_SOURCE_DIR}/CopyPasteProperties.xml
${CMAKE_CURRENT_SOURCE_DIR}/CTHAMRBaseline.xml
......
......@@ -74,7 +74,7 @@ void SourceToolbarActions::onAction(QAction* a)
{
stack->beginUndoSet(QString("Create %1").arg(source_type));
}
builder->createSource("sources", source_type.toLatin1().data(), s);
builder->createSource("sources", source_type.toLocal8Bit().data(), s);
if (stack)
{
stack->endUndoSet();
......
......@@ -49,6 +49,7 @@
#include <vector>
#endif
#include <algorithm>
#include <set>
#include <string>
#include <time.h>
......@@ -195,6 +196,42 @@ static bool getUncSharesOnServer(const std::string& server, std::vector<std::str
#endif
// Transform utf8 string to local code page string
static std::string utf8ToLocal(const std::string& path)
{
#if defined(_WIN32)
int wlen = static_cast<int>(path.length()) * 2 + 1;
WCHAR* wpath = new WCHAR[wlen];
char* lpath = new char[wlen];
MultiByteToWideChar(CP_UTF8, 0, path.c_str(), -1, wpath, wlen);
WideCharToMultiByte(CP_ACP, 0, wpath, -1, lpath, wlen, NULL, NULL);
std::string localPath(lpath);
delete wpath;
delete lpath;
return localPath;
#else
return path;
#endif
}
// Transform local code page string to UTF8 string
static std::string localToUtf8(const std::string& path)
{
#if defined(_WIN32)
int wlen = static_cast<int>(path.length()) * 2 + 1;
WCHAR* wpath = new WCHAR[wlen];
char* lpath = new char[wlen];
int err = MultiByteToWideChar(CP_ACP, 0, path.c_str(), -1, wpath, wlen);
err = WideCharToMultiByte(CP_UTF8, 0, wpath, -1, lpath, wlen, NULL, NULL);
std::string utfPath(lpath);
delete wpath;
delete lpath;
return utfPath;
#else
return path;
#endif
}
static int vtkPVFileInformationGetType(const char* path)
{
int type = vtkPVFileInformation::INVALID;
......@@ -413,35 +450,42 @@ void vtkPVFileInformation::CopyFromObject(vtkObject* object)
this->FastFileTypeDetection = helper->GetFastFileTypeDetection();
std::string working_directory = vtksys::SystemTools::GetCurrentWorkingDirectory().c_str();
std::string lworking_directory = utf8ToLocal(working_directory);
if (helper->GetWorkingDirectory() && helper->GetWorkingDirectory()[0])
{
working_directory = helper->GetWorkingDirectory();
}
std::string path = MakeAbsolutePath(helper->GetPath(), working_directory);
std::string path = helper->GetPath();
std::string lpath = utf8ToLocal(path);
this->SetName(path.c_str());
if (!vtksys::SystemTools::FileIsFullPath(path))
{
lpath = MakeAbsolutePath(lpath, lworking_directory);
}
this->SetName(helper->GetPath());
bool isLink = false;
#if defined(_WIN32)
std::string::size_type idx;
for (idx = path.find('/', 0); idx != std::string::npos; idx = path.find('/', idx))
for (idx = lpath.find('/', 0); idx != std::string::npos; idx = lpath.find('/', idx))
{
path.replace(idx, 1, 1, '\\');
lpath.replace(idx, 1, 1, '\\');
}
int len = static_cast<int>(path.size());
if (len > 4 && path.compare(len - 4, 4, ".lnk") == 0)
int len = static_cast<int>(lpath.size());
if (len > 4 && lpath.compare(len - 4, 4, ".lnk") == 0)
{
WIN32_FIND_DATA data;
path = vtkPVFileInformationResolveLink(path, data);
lpath = vtkPVFileInformationResolveLink(lpath, data);
isLink = true;
}
#endif
this->SetFullPath(path.c_str());
this->SetFullPath(localToUtf8(lpath).c_str());
this->Type = vtkPVFileInformationGetType(this->FullPath);
this->Type = vtkPVFileInformationGetType(lpath.c_str());//this->FullPath);
if (isLink && this->Type == SINGLE_FILE)
{
this->Type = SINGLE_FILE_LINK;
......@@ -640,7 +684,9 @@ void vtkPVFileInformation::GetWindowsDirectoryListing()
#if defined(_WIN32)
vtkPVFileInformationSet info_set;
if (IsNetworkPath(this->FullPath))
std::string lfullPath = utf8ToLocal(this->FullPath);
if (IsNetworkPath(lfullPath))
{
std::vector<std::string> shares;
int type;
......@@ -649,10 +695,10 @@ void vtkPVFileInformation::GetWindowsDirectoryListing()
for (unsigned int i = 0; i < shares.size(); i++)
{
vtkPVFileInformation* info = vtkPVFileInformation::New();
info->SetName(shares[i].c_str());
info->SetName(localToUtf8(shares[i]).c_str());
std::string fullpath =
vtksys::SystemTools::CollapseFullPath(shares[i].c_str(), this->FullPath);
info->SetFullPath(fullpath.c_str());
vtksys::SystemTools::CollapseFullPath(shares[i].c_str(), lfullPath);
info->SetFullPath(localToUtf8(fullpath).c_str());
info->Type = type;
info->FastFileTypeDetection = this->FastFileTypeDetection;
info_set.insert(info);
......@@ -668,7 +714,7 @@ void vtkPVFileInformation::GetWindowsDirectoryListing()
return;
}
if (IsUncPath(this->FullPath))
if (IsUncPath(lfullPath))
{
bool didListing = false;
std::vector<vtksys::String> parts =
......@@ -683,9 +729,9 @@ void vtkPVFileInformation::GetWindowsDirectoryListing()
for (unsigned int i = 0; i < shares.size(); i++)
{
vtkPVFileInformation* info = vtkPVFileInformation::New();
info->SetName(shares[i].c_str());
info->SetName(localToUtf8(shares[i]).c_str());
std::string fullpath = "\\\\" + parts[0] + "\\" + shares[i];
info->SetFullPath(fullpath.c_str());
info->SetFullPath(localToUtf8(fullpath).c_str());
info->Type = NETWORK_SHARE;
info->FastFileTypeDetection = this->FastFileTypeDetection;
info_set.insert(info);
......@@ -711,7 +757,7 @@ void vtkPVFileInformation::GetWindowsDirectoryListing()
}
// Search for all files in the given directory.
std::string prefix = this->FullPath;
std::string prefix = lfullPath;
vtkPVFileInformationAddTerminatingSlash(prefix);
std::string pattern = prefix;
pattern += "*";
......@@ -758,15 +804,15 @@ void vtkPVFileInformation::GetWindowsDirectoryListing()
if (isdir || isfile)
{
vtkPVFileInformation* infoD = vtkPVFileInformation::New();
infoD->SetName(filename.c_str());
infoD->SetFullPath(fullpath.c_str());
infoD->SetName(localToUtf8(filename).c_str());
infoD->SetFullPath(localToUtf8(fullpath).c_str());
infoD->Type = type;
infoD->FastFileTypeDetection = this->FastFileTypeDetection;
infoD->SetHiddenFlag(); // needs full path set first
// Recover status info
struct _stat64 status;
int res = _stat64(infoD->FullPath, &status);
int res = _stat64(fullpath.c_str(), &status);
if (res != -1)
{
if (isfile)
......@@ -936,8 +982,8 @@ void vtkPVFileInformation::SetHiddenFlag()
this->Hidden = false;
return;
}
LPCSTR fp = this->FullPath;
DWORD flags = GetFileAttributes(fp);
//LPCSTR fp = this->FullPath;
DWORD flags = GetFileAttributes(utf8ToLocal(this->FullPath).c_str());
this->Hidden = (flags & FILE_ATTRIBUTE_HIDDEN) ? true : false;
#else
if (!this->Name)
......
......@@ -233,7 +233,7 @@ void pqDisplayArrayWidget::updateComponents()
if (display != NULL && repr != NULL)
{
comp = pqSMAdaptor::getElementProperty(
repr->GetProperty(this->Internal->PropertyArrayComponent.toLatin1().data()))
repr->GetProperty(this->Internal->PropertyArrayComponent.toLocal8Bit().data()))
.toInt();
vtkPVArrayInformation* ai = this->getArrayInformation();
int numComponents = ai ? ai->GetNumberOfComponents() : 1;
......@@ -257,7 +257,7 @@ vtkPVArrayInformation* pqDisplayArrayWidget::getArrayInformation()
{
vtkPVDataInformation* dataInfo = display->getInputDataInformation();
vtkPVArrayInformation* ai =
dataInfo->GetArrayInformation(arrayName.toLatin1().data(), vtkDataObject::POINT);
dataInfo->GetArrayInformation(arrayName.toLocal8Bit().data(), vtkDataObject::POINT);
return ai;
}
return NULL;
......@@ -311,27 +311,27 @@ void pqDisplayArrayWidget::setRepresentation(pqPipelineRepresentation* display)
vtkSMProxy* repr = this->Internal->Representation->getProxy();
// if the domain has been modified, we need to reload the combo boxes
if (repr->GetProperty(this->Internal->PropertyArrayName.toLatin1()) != NULL)
if (repr->GetProperty(this->Internal->PropertyArrayName.toLocal8Bit()) != NULL)
{
this->Internal->VTKConnect->Connect(
repr->GetProperty(this->Internal->PropertyArrayName.toLatin1()),
repr->GetProperty(this->Internal->PropertyArrayName.toLocal8Bit()),
vtkCommand::DomainModifiedEvent, this, SLOT(needReloadGUI()), NULL, 0.0,
Qt::QueuedConnection);
this->Internal->VTKConnect->Connect(
repr->GetProperty(this->Internal->PropertyArrayName.toLatin1()), vtkCommand::ModifiedEvent,
this, SLOT(updateGUI()), NULL, 0.0, Qt::QueuedConnection);
repr->GetProperty(this->Internal->PropertyArrayName.toLocal8Bit()),
vtkCommand::ModifiedEvent, this, SLOT(updateGUI()), NULL, 0.0, Qt::QueuedConnection);
}
if (repr->GetProperty(this->Internal->PropertyArrayComponent.toLatin1()) != NULL)
if (repr->GetProperty(this->Internal->PropertyArrayComponent.toLocal8Bit()) != NULL)
{
this->Internal->VTKConnect->Connect(
repr->GetProperty(this->Internal->PropertyArrayComponent.toLatin1()),
repr->GetProperty(this->Internal->PropertyArrayComponent.toLocal8Bit()),
vtkCommand::DomainModifiedEvent, this, SLOT(needReloadGUI()), NULL, 0.0,
Qt::QueuedConnection);
this->Internal->VTKConnect->Connect(
repr->GetProperty(this->Internal->PropertyArrayComponent.toLatin1()),
repr->GetProperty(this->Internal->PropertyArrayComponent.toLocal8Bit()),
vtkCommand::ModifiedEvent, this, SLOT(updateGUI()), NULL, 0.0, Qt::QueuedConnection);
}
......@@ -442,7 +442,7 @@ const QString pqDisplayArrayWidget::getArrayName() const
}
QList<QVariant> list = pqSMAdaptor::getMultipleElementProperty(
repr->GetProperty(this->Internal->PropertyArrayName.toLatin1().data()));
repr->GetProperty(this->Internal->PropertyArrayName.toLocal8Bit().data()));
if (list.size() < 4)
{
......
......@@ -355,7 +355,7 @@ void pqPointSpriteControls::updateRadiusArray()
svp->SetElement(1, "0"); // port
svp->SetElement(2, "0"); // connection
svp->SetElement(3, "0" /* vtkDataObject::FIELD_ASSOCIATION_POINTS */); // type
svp->SetElement(4, array.toLatin1().data()); // name
svp->SetElement(4, array.toLocal8Bit().data()); // name
reprProxy->UpdateVTKObjects();
pqSMAdaptor::setElementProperty(
......@@ -404,7 +404,7 @@ void pqPointSpriteControls::updateOpacityArray()
svp->SetElement(1, "0"); // port
svp->SetElement(2, "0"); // connection
svp->SetElement(3, "0" /* vtkDataObject::FIELD_ASSOCIATION_POINTS */); // type
svp->SetElement(4, array.toLatin1().data()); // name
svp->SetElement(4, array.toLocal8Bit().data()); // name
pqSMAdaptor::setElementProperty(reprProxy->GetProperty("OpacityVectorComponent"),
this->Internals->OpacityBy->currentComponent());
......
......@@ -380,7 +380,7 @@ void pqSLACManager::checkActionEnabled()
//-----------------------------------------------------------------------------
void pqSLACManager::showField(QString name)
{
this->showField(name.toLatin1().data());
this->showField(name.toLocal8Bit().data());
}
void pqSLACManager::showField(const char* name)
......@@ -462,7 +462,7 @@ void pqSLACManager::showField(const char* name)
if (!rangeData)
{
QString magName = QString("%1_M").arg(name);
rangeData = ranges->GetColumnByName(magName.toLatin1().data());
rangeData = ranges->GetColumnByName(magName.toLocal8Bit().data());
}
this->CurrentFieldRangeKnown = true;
......@@ -556,12 +556,13 @@ void pqSLACManager::updatePlotField()
double color[3] = { 0.0, 0.0, 0.0 };
vtkSMPropertyHelper(reprProxy, "SeriesColor")
.SetStatus(seriesName.toLatin1().data(), color, 3);
.SetStatus(seriesName.toLocal8Bit().data(), color, 3);
vtkSMPropertyHelper(reprProxy, "SeriesLineThickness")
.SetStatus(seriesName.toLatin1().data(), 1);
.SetStatus(seriesName.toLocal8Bit().data(), 1);
vtkSMPropertyHelper(reprProxy, "SeriesLineStyle").SetStatus(seriesName.toLatin1().data(), 1);
vtkSMPropertyHelper(reprProxy, "SeriesLineStyle")
.SetStatus(seriesName.toLocal8Bit().data(), 1);
}
else
{
......
......@@ -106,7 +106,7 @@ vtkPVXMLElement* vtkVRPropertyStyle::saveConfiguration() const
// element->AddAttribute(
// "proxy", this->Proxy? this->Proxy->GetGlobalIDAsString() : "0");
// element->AddAttribute(
// "property", this->PropertyName.toLatin1().data());
// "property", this->PropertyName.toLocal8Bit().data());
// }
return child;
}
......@@ -121,7 +121,7 @@ void vtkVRPropertyStyle::setSMProperty(vtkSMProxy* proxy, const QString& propert
//-----------------------------------------------------------------------public
vtkSMProperty* vtkVRPropertyStyle::getSMProperty() const
{
return this->Proxy ? this->Proxy->GetProperty(this->PropertyName.toLatin1().data()) : NULL;
return this->Proxy ? this->Proxy->GetProperty(this->PropertyName.toLocal8Bit().data()) : NULL;
}
//-----------------------------------------------------------------------public
......
......@@ -108,7 +108,7 @@ void vtkVRVectorPropertyStyle::setValue(double x, double y, double z)
if (smproxy && smprop)
{
double values[3] = { x, y, z };
vtkSMPropertyHelper(smproxy, this->getSMPropertyName().toLatin1().data()).Set(values, 3);
vtkSMPropertyHelper(smproxy, this->getSMPropertyName().toLocal8Bit().data()).Set(values, 3);
smproxy->UpdateVTKObjects();
}
}
......
......@@ -135,7 +135,7 @@ void pqBlotShell::executePythonCommand(const QString& command)
{
emit this->executing(true);
// this->printMessage(command);
this->Interpretor->RunSimpleString(command.toLatin1().data());
this->Interpretor->RunSimpleString(command.toLocal8Bit().data());
emit this->executing(false);
}
......
......@@ -73,7 +73,7 @@ void pqCTHArraySelectionDecorator::updateSelection()
foreach (const QString& pname, this->PropertyNames)
{
vtkSMProperty* prop = proxy->GetProperty(pname.toLatin1().data());
vtkSMProperty* prop = proxy->GetProperty(pname.toLocal8Bit().data());
if (prop && prop != curProperty)
{
vtkSMUncheckedPropertyHelper(prop).SetNumberOfElements(0);
......
......@@ -113,7 +113,7 @@ void pqChangePipelineInputReaction::changeInput()
}
vtkSMInputProperty* ip = vtkSMInputProperty::SafeDownCast(
filter->getProxy()->GetProperty(inputPortName.toLatin1().data()));
filter->getProxy()->GetProperty(inputPortName.toLocal8Bit().data()));
ip->SetProxies(static_cast<unsigned int>(inputPtrs.size()), &inputPtrs[0], &inputPorts[0]);
}
filter->getProxy()->UpdateVTKObjects();
......
......@@ -104,7 +104,7 @@ void pqColorPaletteSelectorWidget::setCurrentIndex(int index)
QString name = this->ComboBox->itemData(index).toString();
vtkSMSessionProxyManager* pxm = smproxy->GetSessionProxyManager();
vtkSMProxy* paletteProxy = pxm->GetPrototypeProxy("palettes", name.toLatin1().data());
vtkSMProxy* paletteProxy = pxm->GetPrototypeProxy("palettes", name.toLocal8Bit().data());
Q_ASSERT(paletteProxy);
smproxy->Copy(paletteProxy);
......
......@@ -240,7 +240,7 @@ void pqCommandLineOptionsBehavior::playTests()
// Play the test script if specified.
pqTestUtility* testUtility = pqApplicationCore::instance()->testUtility();
options->SetCurrentImageThreshold(options->GetTestImageThreshold(cc));
cout << "Playing: " << options->GetTestScript(cc).toLatin1().data() << endl;
cout << "Playing: " << options->GetTestScript(cc).toLocal8Bit().data() << endl;
success = testUtility->playTests(options->GetTestScript(cc));
if (success && !options->GetTestBaseline(cc).isEmpty())
......
......@@ -136,7 +136,7 @@ QString pqExportReaction::exportActiveView()
{
QString filename = file_dialog.getSelectedFiles().first();
vtkSmartPointer<vtkSMExporterProxy> proxy;
proxy.TakeReference(helper->CreateExporter(filename.toLatin1().data(), viewProxy));
proxy.TakeReference(helper->CreateExporter(filename.toLocal8Bit().data(), viewProxy));
if (!proxy)
{
qCritical("Couldn't handle export filename");
......@@ -173,7 +173,7 @@ QString pqExportReaction::exportActiveView()
SM_SCOPED_TRACE(ExportView)
.arg("view", viewProxy)
.arg("exporter", proxy)
.arg("filename", filename.toLatin1().data());
.arg("filename", filename.toLocal8Bit().data());
proxy->Write();
return filename;
}
......
......@@ -313,7 +313,7 @@ pqPipelineSource* pqFiltersMenuReaction::createFilter(
vtkSMSessionProxyManager* pxm = server->proxyManager();
vtkSMProxy* prototype =
pxm->GetPrototypeProxy(xmlgroup.toLatin1().data(), xmlname.toLatin1().data());
pxm->GetPrototypeProxy(xmlgroup.toLocal8Bit().data(), xmlname.toLocal8Bit().data());
if (!prototype)
{
qCritical() << "Unknown proxy type: " << xmlname;
......@@ -351,7 +351,7 @@ pqPipelineSource* pqFiltersMenuReaction::createFilter(
// future to be smarter.
if (pqPipelineFilter::getRequiredInputPorts(prototype).size() > 1)
{
vtkSMProxy* filterProxy = pxm->GetPrototypeProxy("filters", xmlname.toLatin1().data());
vtkSMProxy* filterProxy = pxm->GetPrototypeProxy("filters", xmlname.toLocal8Bit().data());
vtkSMPropertyHelper helper(filterProxy, inputPortNames[0]);
helper.RemoveAllValues();
......
......@@ -179,7 +179,7 @@ pqPipelineSource* pqLoadDataReaction::loadData(
bool pqLoadDataReaction::TestFileReadability(
const QString& file, pqServer* server, vtkSMReaderFactory* vtkNotUsed(factory))
{
return vtkSMReaderFactory::TestFileReadability(file.toLatin1().data(), server->session());
return vtkSMReaderFactory::TestFileReadability(file.toLocal8Bit().data(), server->session());
}
//-----------------------------------------------------------------------------
......@@ -187,7 +187,7 @@ bool pqLoadDataReaction::DetermineFileReader(const QString& filename, pqServer*
vtkSMReaderFactory* factory, QPair<QString, QString>& readerInfo)
{
QString readerType, readerGroup;
vtkStringList* list = factory->GetReaders(filename.toLatin1().data(), server->session());
vtkStringList* list = factory->GetReaders(filename.toLocal8Bit().data(), server->session());
if (list->GetLength() > 3)
{
// If more than one readers found.
......@@ -203,7 +203,7 @@ bool pqLoadDataReaction::DetermineFileReader(const QString& filename, pqServer*
return false;
}
}
else if (factory->CanReadFile(filename.toLatin1().data(), server->session()))
else if (factory->CanReadFile(filename.toLocal8Bit().data(), server->session()))
{
// reader knows the type
readerType = factory->GetReaderName();
......
......@@ -124,7 +124,7 @@ void pqLoadPaletteReaction::actionTriggered(QAction* actn)
vtkSMProxy* paletteProxy = pxm->GetProxy("global_properties", "ColorPalette");
vtkSMProxy* palettePrototype = pxm->GetPrototypeProxy(
"palettes", actn->property("PV_XML_NAME").toString().toLatin1().data());
"palettes", actn->property("PV_XML_NAME").toString().toLocal8Bit().data());
Q_ASSERT(palettePrototype);
BEGIN_UNDO_SET("Load color palette");
......
......@@ -79,7 +79,7 @@ void pqLoadStateReaction::loadState(const QString& filename, pqServer* server)
if (filename.endsWith(".pvsm"))
{
vtkNew<vtkPVXMLParser> xmlParser;
xmlParser->SetFileName(filename.toLatin1().data());
xmlParser->SetFileName(filename.toLocal8Bit().data());
xmlParser->Parse();
vtkPVXMLElement* root = xmlParser->GetRootElement();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment