view m-toolbox/classes/@LTPDAprefs/upgradeFromPlist.m @ 52:daf4eab1a51e
database-connection-manager tip
Fix. Default password should be [] not an empty string
author
Daniele Nicolodi <nicolodi@science.unitn.it>
date
Wed, 07 Dec 2011 17:29:47 +0100 (2011-12-07)
parents
f0afece42f48
children
line source
+ − % UPGRADEFROMPLIST upgrades the old preference strucure to the new structure.
+ − %
+ − % Call: prefs = LTPDAprefs.upgradeFromPlist(prefs, pl)
+ − %
+ − % Parameters:
+ − % prefs - preferences object with the new structure
+ − % pl - a PLIST with the old preferences object. The old
+ − % preferences object must have the key 'LTPDAPREFERENCES'
+ − %
+ − % Version:
+ − % $Id: upgradeFromPlist.m,v 1.1 2010/11/30 17:37:13 ingo Exp $
+ − %
+ −
+ − function prefs = upgradeFromPlist(prefs, pl)
+ −
+ − oldprefs = pl.find('LTPDAPREFERENCES');
+ −
+ − disp('*** upgrading preferences ...');
+ −
+ − % update display settings
+ − prefs.getDisplayPrefs.setDisplayVerboseLevel(java.lang.Integer(oldprefs.display.verboseLevel));
+ − prefs.getDisplayPrefs.setDisplayWrapStrings(java.lang.Integer(oldprefs.display.wrapstrings));
+ − prefs.getDisplayPrefs.setDisplayWrapLegendStrings(java.lang.Integer(oldprefs.display.wraplegendstring));
+ −
+ − % update models
+ − for kk=1:numel(oldprefs.models.paths)
+ − path = oldprefs.models.paths{kk};
+ − prefs.getModelsPrefs.addSearchPath(path);
+ − end
+ −
+ − % update time prefs
+ − prefs.getTimePrefs.setTimeTimezone(oldprefs.time.timezone);
+ − prefs.getTimePrefs.setTimestringFormat(oldprefs.time.format);
+ −
+ − % update repository prefs
+ − for kk=1:numel(oldprefs.repository.servers)
+ − server = oldprefs.repository.servers{kk};
+ − prefs.getRepoPrefs.addHostname(server);
+ − end
+ − prefs.getRepoPrefs.setExpiry(java.lang.Integer(oldprefs.repository.loginExpiry));
+ −
+ − % update external prefs
+ − prefs.getExternalPrefs.setDotBinaryPath(oldprefs.external.dotbin);
+ − prefs.getExternalPrefs.setDotOutputFormat(oldprefs.external.dotformat);
+ −
+ − % update misc prefs
+ − prefs.getMiscPrefs.setDefaultWindow(oldprefs.misc.default_window.type);
+ − for kk=1:numel(oldprefs.misc.units)
+ − unit = oldprefs.misc.units{kk};
+ − prefs.getMiscPrefs.addUnit(unit);
+ − end
+ −
+ − oldprefs = [];
+ −
+ − end