Author Topic: How putting in check of hfs  (Read 1475 times)

0 Members and 1 Guest are viewing this topic.

Offline Mars

  • Operator
  • Tireless poster
  • *****
  • Posts: 1880
    • View Profile
How putting in check of hfs
« on: March 24, 2011, 08:57:01 PM »
Quote from: Used reference text
procedure keepTplUpdated();
begin
if fileExists(tplFilename) then
  if newMtime(tplFilename, tplLast) then
    setTplText(loadFile(tplFilename))
  else
else
  if tplLast <> 0 then
    begin
    tplLast:=0; // we have no modified-time in this case, but this will stop the refresh
    setTplText(defaultTpl);
    end;
end; // keepTplUpdated

1) Execute hfs with a personalized template

2) Verify the web page by means of the browser

3) Rename the template filename without closing hfs

4) Refresh the web page of the browser, the default template is used on the place of the other one

5) close hfs with saving options

6) Relaunch hfs and refresh the web page

The shown page is of one such whiteness  :D ;D

if you restore the personalized template, everything becomes again normal

Conclusion: To resolve this loss of external template it is enough to settle by adding a line

Quote from: main.pas
......
    if h = 'tpl-file' then tplFilename:=l;
    if h = 'tpl-editor' then tplEditor:=l;
      if h = 'graph-visible' then
      if yes then showGraph()
      else hideGraph();
   // extra commands for external use
     if h = 'load-tpl-from' then setNewTplFile(l);  //WARNING TO REJETTO This line is not any more used
  except end;
  end;

if not fileExists(tplFilename) then tplfilename:='' end;


if not alreadyStarted then
 // i was already seeing all the stuff, so please don't hide it
  if (build > '') and (build < '006') then easyMode:=FALSE;



******************
other bug with his solution

 if you replace the external template by one with the same name, the modification is not taken into account in hfs because of the following line in classeslib.pas:

result:=o.tpl;
if getMtime(fn) <= o.ts then exit;  //remove the < char
o.ts:=getMtime(fn);

« Last Edit: March 24, 2011, 09:09:26 PM by Mars »

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12949
    • View Profile
Re: How putting in check of hfs
« Reply #1 on: March 25, 2011, 10:56:27 AM »
Conclusion: To resolve this loss of external template it is enough to settle by adding a line

thank you


Quote
if you replace the external template by one with the same name, the modification is not taken into account in hfs because of the following line in classeslib.pas:

ok, it's an acceptable case, i apply.