Mercurial > repos > public > matlab_path_manager
diff +mpm/MatlabPathManager.m @ 38:16d56bf04117
Change place of storage of the state
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 05 Dec 2018 15:43:13 +0100 |
parents | 3a28f6de13c2 |
children | 3156ace843f5 |
line wrap: on
line diff
--- a/+mpm/MatlabPathManager.m Fri Nov 02 14:43:27 2018 +0100 +++ b/+mpm/MatlabPathManager.m Wed Dec 05 15:43:13 2018 +0100 @@ -1,7 +1,7 @@ classdef MatlabPathManager properties projectFileName = '.subpaths'; - stateFileName = 'state'; + prefGroup = 'matlabpathmanager'; end methods @@ -16,13 +16,9 @@ p = p{1}; end - function p = stateFilePath(obj) - p = fullfile(obj.installLocation(), obj.stateFileName); - end - % Load a given subpath into the state file and the matlab path and do savepath(), atomically function loadSubpath(obj, p) - state = mpm.PersistentState(obj.stateFilePath); + state = mpm.PersistentState(obj.prefGroup); addpath(p); state.subpaths(p) = true; @@ -33,7 +29,7 @@ % Unload a given subpath from the state file and the matlab path and do savepath(), atomically function unloadSubpath(obj, p) - state = mpm.PersistentState(obj.stateFilePath); + state = mpm.PersistentState(obj.prefGroup); rmpath(p); savepath() % before save state to make sure saved paths are always present in the state @@ -56,7 +52,7 @@ end function s = loadedSubpaths(obj) - state = mpm.PersistentState(obj.stateFilePath); + state = mpm.PersistentState(obj.prefGroup); s_unordered = state.subpaths.keys(); mpath = obj.matlabPath();