Issue 841: INI keys can not be read in WorkFlow

Reported by Mathias Bavay, May 28, 2020

When creating an ini file from scratch (for example for MeteoIO) and 
running it directly (after saving it to a file), the workflow output 
path can not be read (${key:OUTPUT::METEOPATH} can never
be read, it is actually empty). This comes from the fact that 
MainWindow.getINI() does not contain the same keys as in the 
INIParser just after saving... If reading an existing file, the 
problem does not happen.

A dirty fix has been implemented in commit 
30f07dd0aceb30b60efddd0952a95cb45926aa70 but a cleaner solution 
should be implemented (preventing MainWindow's INIParser from 
containing a different content than the INIParser that writes the 
ini file).

Comment 1 by Michael Reisecker, May 28, 2020

Sorry for the bug. Before diving into a prolonged frustrating 
session please don't hesitate to ask if I happen to know what's up - 
happy to help.

In any case, is this really such dirt of a fix? It fits the logic 
and if I hadn't forgotten it I would have done the same...

If I remember correctly the only reason the second INI parser is 
even there is in order not to display "unsaved changes" 
warnings when, in fact, there were no changes. I thought that in our 
case this might be incredibly confusing for the users, but I admit 
it is a bit boilerplate heavy for such a small feature, especially 
since that thing where default INIshell values are not default 
MeteoIO values.

Still it is by design that there is one fixed state saved at the 
time of reading (with this call you will always receive the INI 
contents as they are on the file system), so to me it makes sense to 
update this after writing to the fs.

Other way would be to save the initially read values in the main 
Parser, but I'm not certain this is conceptually much cleaner... it 
wasn't before, but with recent developments (e. g. ticket 832) it 
may be.


Comment 2 by Mathias Bavay, May 29, 2020

Don't worry, I did not want to bug you for something that looked 
like it would be fixed quickly. And when it was not, I did not want 
to give because I always had the feeling I was closing in! :-) 
Anyway, it is good to hear that you believe this is the right way of 
addressing this issue. Then I'll happily close the bug. Thanks!
Status: Verified

Created: 1 year 4 months ago by Mathias Bavay

Updated: 1 year 4 months ago

Status: Verified

Followed by: 1 person