Skip to content
Snippets Groups Projects
Commit f4c50634 authored by rswindell's avatar rswindell
Browse files

Forgot to commit this earlier (with tickitcfg.js rev 1.9):

save() methods return true (on success) or an error string. No throw()'s.
parent 71ba1785
Branches
Tags
No related merge requests found
...@@ -224,7 +224,7 @@ TickITCfg.prototype.save = function() ...@@ -224,7 +224,7 @@ TickITCfg.prototype.save = function()
} }
if (!tcfg.open(tcfg.exists ? 'r+':'w+')) if (!tcfg.open(tcfg.exists ? 'r+':'w+'))
throw("Unable to open '"+tcfg.name+"'"); return "Unable to open '"+tcfg.name+"'";
writesect(null, this.gcfg); writesect(null, this.gcfg);
sects = tcfg.iniGetSections().map(function(v){return v.toLowerCase();}); sects = tcfg.iniGetSections().map(function(v){return v.toLowerCase();});
...@@ -237,6 +237,7 @@ TickITCfg.prototype.save = function() ...@@ -237,6 +237,7 @@ TickITCfg.prototype.save = function()
for (i=0; i<sects.length; i++) for (i=0; i<sects.length; i++)
tcfg.iniRemoveSection(sects[i]); tcfg.iniRemoveSection(sects[i]);
tcfg.close(); tcfg.close();
return true;
}; };
/* /*
...@@ -329,7 +330,7 @@ FREQITCfg.prototype.save = function() ...@@ -329,7 +330,7 @@ FREQITCfg.prototype.save = function()
} }
if (!fcfg.open(fcfg.exists ? 'r+':'w+')) if (!fcfg.open(fcfg.exists ? 'r+':'w+'))
throw("Unable to open '"+fcfg.name+"'"); return "Unable to open '"+fcfg.name+"'";
if (this.dirs.length > 0) if (this.dirs.length > 0)
fcfg.iniSetValue(null, 'Dirs', this.dirs.join(',')); fcfg.iniSetValue(null, 'Dirs', this.dirs.join(','));
...@@ -350,6 +351,7 @@ FREQITCfg.prototype.save = function() ...@@ -350,6 +351,7 @@ FREQITCfg.prototype.save = function()
for (i=0; i<sects.length; i++) for (i=0; i<sects.length; i++)
fcfg.iniRemoveSection(sects[i]); fcfg.iniRemoveSection(sects[i]);
fcfg.close(); fcfg.close();
return true;
}; };
function BinkITCfg() function BinkITCfg()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment