diff --git a/tsg_util/tsg_preferences.m b/tsg_util/tsg_preferences.m index e391ddb86cd7183de4d968abdedc22ad518ec5ac..32e0a94fb84ec92348d7c50e87a9da091c72b348 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