X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPVViewer%2FPVViewer_Core.cxx;h=6e9e6920380ee8e58a4a5ff1789c2ad1566498a4;hb=5204b0c67ebf51714353b53f585ff7aafe70af30;hp=993d6b2491b6bde69bd47655a74e2e79cfe0e5c9;hpb=3c92c56013c414ce3b637835d145f2126eb9bcf7;p=modules%2Fgui.git diff --git a/src/PVViewer/PVViewer_Core.cxx b/src/PVViewer/PVViewer_Core.cxx index 993d6b249..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() + 2]; + argv = new char*[aOptList.size() + 3]; QStringList args = QApplication::arguments(); argv[0] = (args.size() > 0)? strdup(args[0].toLatin1().constData()) : strdup("paravis"); argc++; @@ -75,6 +76,24 @@ bool PVViewer_Core::ParaviewInitApp(QMainWindow * aDesktop, LogWindow * logWindo 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() ||