X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPVViewer%2FPVViewer_Core.cxx;h=6e9e6920380ee8e58a4a5ff1789c2ad1566498a4;hb=5204b0c67ebf51714353b53f585ff7aafe70af30;hp=8f9abaafc193d6f6ffddc06ee47182c3900d3c3e;hpb=b5c645c8183f652a28ab71088ede7cbb706a3e5c;p=modules%2Fgui.git diff --git a/src/PVViewer/PVViewer_Core.cxx b/src/PVViewer/PVViewer_Core.cxx index 8f9abaafc..6e9e69203 100644 --- a/src/PVViewer/PVViewer_Core.cxx +++ b/src/PVViewer/PVViewer_Core.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include @@ -65,7 +66,7 @@ bool PVViewer_Core::ParaviewInitApp(QMainWindow * aDesktop, LogWindow * logWindo char** argv = 0; QString aOptions = getenv("PARAVIEW_OPTIONS"); QStringList aOptList = aOptions.split(":", QString::SkipEmptyParts); - argv = new char*[aOptList.size() + 1]; + argv = new char*[aOptList.size() + 3]; QStringList args = QApplication::arguments(); argv[0] = (args.size() > 0)? strdup(args[0].toLatin1().constData()) : strdup("paravis"); argc++; @@ -74,6 +75,25 @@ bool PVViewer_Core::ParaviewInitApp(QMainWindow * aDesktop, LogWindow * logWindo argv[argc] = strdup( aStr.toLatin1().constData() ); argc++; } + argv[argc++] = strdup("--multi-servers"); + // Make salome sharing the same server configuration than external one with "salome shell paraview" + QStringList li(QStandardPaths::standardLocations(QStandardPaths::ConfigLocation)); + foreach(QString pathConfig,li) + { + QFileInfo fi(QDir(pathConfig),QString("ParaView")); + if(fi.exists() && fi.isDir()) + { + QFileInfo fi2(fi.canonicalFilePath(),"servers.pvsc"); + if(fi2.exists() && fi2.isFile()) + { + QString addEntry(QString("--servers-file=%1").arg(fi2.canonicalFilePath())); + std::string addEntry2(addEntry.toStdString()); + argv[argc++] = strdup(addEntry2.c_str()); + break; + } + } + } + // MyCoreApp = new pqPVApplicationCore (argc, argv); if (MyCoreApp->getOptions()->GetHelpSelected() || MyCoreApp->getOptions()->GetUnknownArgument() ||