From 8772e25a91b57631782fff6c4ceac2c932d7aa6d Mon Sep 17 00:00:00 2001
From: Jacques Grelet <jacques.grelet@ird.fr>
Date: Thu, 13 Mar 2008 21:56:36 +0000
Subject: [PATCH] reorganisation du code

---
 tsg_util/tsg_preferences.m | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/tsg_util/tsg_preferences.m b/tsg_util/tsg_preferences.m
index e391ddb..32e0a94 100644
--- a/tsg_util/tsg_preferences.m
+++ b/tsg_util/tsg_preferences.m
@@ -85,10 +85,6 @@ switch fid
       % if file exist, load in workspace
       % --------------------------------
       load( config_file, 'root', 'tsg' );
-      
-      % transforme filename saved in tsg.qc.hash to tsg_nc object
-      % ---------------------------------------------------------
-      tsg.qc.hash = tsg_nc(tsg.qc.hash);
 
     catch
 
@@ -103,6 +99,20 @@ switch fid
 
     end
 
+    % If there no field version or wrong version, initialize
+    % -------------------------------------------------------
+    if ~isfield( root, 'version') || ~strcmp(root.version, VERSION)
+
+      % call new config private function
+      % --------------------------------
+      new_config;
+
+    end
+    
+    % transforme filename saved in tsg.qc.hash to tsg_nc object
+    % ---------------------------------------------------------
+    tsg.qc.hash = tsg_nc(tsg.qc.hash);
+      
     % display waitbar
     % ---------------
     waitbar( 1/2, wb, 'loading structure tsg' );
@@ -128,17 +138,7 @@ switch fid
         'delete it.'], config_file);
       quitProgram(hTsgGUI, DEFAULT_PATH_FILE);
 
-    end
-
-    % If there no field version or wrong version, initialize
-    % -------------------------------------------------------
-    if ~isfield( root, 'version') || ~strcmp(root.version, VERSION)
-
-      % call new config private function
-      % --------------------------------
-      new_config;
-
-    end
+    end  
 
 end
 
-- 
GitLab