From 656ff99b63d7ffe14b77f6f854e696f83fef7833 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Tue, 7 May 2013 15:10:55 +0000
Subject: [PATCH] pp

---
 Common/OpenFile.cpp | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/Common/OpenFile.cpp b/Common/OpenFile.cpp
index 5115b6a81d..dbad2b7f2c 100644
--- a/Common/OpenFile.cpp
+++ b/Common/OpenFile.cpp
@@ -240,14 +240,6 @@ int ParseFile(const std::string &fileName, bool close, bool warnIfMissing)
 #endif
 }
 
-static int defineSolver(const std::string &name)
-{
-  for(int i = 0; i < 5; i++){
-    if(opt_solver_name(i, GMSH_GET, "") == name) return i;
-  }
-  return 4;
-}
-
 void ParseString(const std::string &str)
 {
   if(str.empty()) return;
@@ -260,6 +252,15 @@ void ParseString(const std::string &str)
   }
 }
 
+static int defineSolver(const std::string &name)
+{
+  for(int i = 0; i < 5; i++){
+    if(opt_solver_name(i, GMSH_GET, "") == name) return i;
+  }
+  opt_solver_name(4, GMSH_SET|GMSH_GUI, name);
+  return 4;
+}
+
 int MergeFile(const std::string &fileName, bool warnIfMissing)
 {
   if(GModel::current()->getName() == ""){
@@ -431,7 +432,6 @@ int MergeFile(const std::string &fileName, bool warnIfMissing)
     status = 1;
     /* tester ceci:
     int num = defineSolver("python");
-    opt_solver_name(num, GMSH_SET, "python");
     opt_solver_executable(num, GMSH_SET, fileName);
     CTX::instance()->launchSolverAtStartup = num;
     return 1;
-- 
GitLab