[Kst] [Bug 120827] Command line option -f fails for some asciifiles

George Staikos staikos at kde.org
Mon Jan 30 02:01:16 CET 2006

On Friday 27 January 2006 18:07, Ted Kisner wrote:
> It seems that this is a very difficult problem.  In main.cpp, we correctly
> find an ascii datasource for a text file and then create a KstRVector. 
> Then, we call the vector's isValid() function, which calls the ascii
> datasource's isValidField() function.  But the field is not valid yet,
> since we haven't specified the starting line.
> So we can't just change the starting line within readField, since we never
> try to read the data before calling isValidField...
> So, is there a way of setting the AsciiSource::_config->_dataLine variable
> *before* calling the KstRVector->isValid() function?  And we have to do
> this using the existing interfaces in KstDataSource.
> Here's a (somewhat ugly) idea:  what if the ascii datasource always returns
> true for isValidField(), and then readField just returns zero samples if
> the field really isn't valid?  This is what currently happens with a call
> to readField when you specify an invalid field.  I guess we could also
> return one sample of NaN...

  I think this is a bad idea.  For instance, a script that tries to check the 
contents of a file will fail.  I'm also not sure where else we might have a 
problem as a result of this.  I don't think this patch can go into 1.2.0.  
Also it introduces a performance penalty for fieldList().

George Staikos
KDE Developer				http://www.kde.org/
Staikos Computing Services Inc.		http://www.staikos.net/

More information about the Kst mailing list