From: Anthony Geay Date: Tue, 23 Feb 2021 20:21:12 +0000 (+0100) Subject: Make the resource file automatic X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ade8a125466e327fa6f197ed5f1375ed335855de;p=modules%2Fgui.git Make the resource file automatic --- diff --git a/src/Session/salome2810.cxx b/src/Session/salome2810.cxx index 3b36fa31d..4e7207707 100644 --- a/src/Session/salome2810.cxx +++ b/src/Session/salome2810.cxx @@ -56,6 +56,23 @@ int main(int argc, char *argv[]) pe.insert(APPCONFIG,appconfig_val); //tells shutup to salome.salome_init invoked at shaper engine ignition pe.insert("SALOME_EMB_SERVANT","1"); + //resource file retrieve + QString resfile; + { + QProcess proc; + proc.setProcessEnvironment(pe); + proc.setProgram("python3"); + proc.setArguments({"-c","from launchConfigureParser import userFile ; import sys ; sys.stdout.write(userFile(\"SalomeApp\",\"salome\"))"}); + proc.start(); + proc.waitForFinished(-1); + if(proc.exitStatus() != QProcess::NormalExit) + { + std::cerr << "Fail to retrieve resource file from launchConfigureParser python module !" << std::endl; + return 1; + } + QByteArray val(proc.readAllStandardOutput()); + resfile = QString::fromUtf8(val); + } // QProcess proc; proc.setProcessEnvironment(pe); @@ -71,7 +88,7 @@ int main(int argc, char *argv[]) args << catalogs.join("::"); args << ")"; args << "--with" << "SALOMEDS" << "(" << ")" << "--with" << "Container" << "(" << "FactoryServer" << ")" << "--with" << "SalomeAppEngine" << "(" << ")" << "CPP"; - args << "--resources=/home/H87074/.config/salome/SalomeApprc.9.5.BR" << "--modules" << "(SHAPER:GEOM:SMESH)"; + args << QString("--resources=%1").arg(resfile) << "--modules" << "(SHAPER:GEOM:SMESH)"; proc.setArguments(args); proc.setProcessChannelMode( QProcess::ForwardedErrorChannel ); proc.start();