Aggregated common Octave argument list

This commit is contained in:
Magne Sjaastad
2014-07-22 12:11:48 +02:00
parent 329ec921e8
commit 31274dbb00
4 changed files with 33 additions and 39 deletions

View File

@@ -106,13 +106,7 @@ void RimCommandExecuteScript::redo()
QString octavePath = app->octavePath();
if (!octavePath.isEmpty())
{
// http://www.gnu.org/software/octave/doc/interpreter/Command-Line-Options.html#Command-Line-Options
QStringList arguments;
arguments.append("--path");
arguments << QApplication::applicationDirPath();
arguments.append("-q");
QStringList arguments = app->octaveArguments();
arguments.append("--eval");
arguments << this->scriptText();

View File

@@ -538,29 +538,14 @@ void RimUiTreeView::slotExecuteScript()
QString octavePath = app->octavePath();
if (!octavePath.isEmpty())
{
// http://www.gnu.org/software/octave/doc/interpreter/Command-Line-Options.html#Command-Line-Options
// -p path
// Add path to the head of the search path for function files. The value of path specified on the command line
// will override any value of OCTAVE_PATH found in the environment, but not any commands in the system or
// user startup files that set the internal load path through one of the path functions.
// -q
// Don't print the usual greeting and version message at startup.
// TODO: Must rename RimCalcScript::absolutePath to absoluteFileName, as the code below is confusing
// absolutePath() is a function in QFileInfo
QFileInfo fi(calcScript->absolutePath());
QString octaveFunctionSearchPath = fi.absolutePath();
QStringList arguments;
QStringList arguments = app->octaveArguments();
arguments.append("--path");
arguments << octaveFunctionSearchPath;
arguments.append("--path");
arguments << QApplication::applicationDirPath();
arguments.append("-q");
arguments << calcScript->absolutePath();
RiaApplication::instance()->launchProcess(octavePath, arguments);
@@ -593,29 +578,14 @@ void RimUiTreeView::slotExecuteScriptForSelectedCases()
QString octavePath = app->octavePath();
if (!octavePath.isEmpty())
{
// http://www.gnu.org/software/octave/doc/interpreter/Command-Line-Options.html#Command-Line-Options
// -p path
// Add path to the head of the search path for function files. The value of path specified on the command line
// will override any value of OCTAVE_PATH found in the environment, but not any commands in the system or
// user startup files that set the internal load path through one of the path functions.
// -q
// Don't print the usual greeting and version message at startup.
// TODO: Must rename RimCalcScript::absolutePath to absoluteFileName, as the code below is confusing
// absolutePath() is a function in QFileInfo
QFileInfo fi(calcScript->absolutePath());
QString octaveFunctionSearchPath = fi.absolutePath();
QStringList arguments;
QStringList arguments = app->octaveArguments();
arguments.append("--path");
arguments << octaveFunctionSearchPath;
arguments.append("--path");
arguments << QApplication::applicationDirPath();
arguments.append("-q");
arguments << calcScript->absolutePath();
// Get case ID from selected cases in selection model