[Kst] ASCII config patch

George Staikos staikos at kde.org
Mon Jan 31 04:44:45 CET 2005


On Monday 24 January 2005 13:20, Brisset, Nicolas wrote:
> I have a first working version of the ASCII datasource with quite a few
> config options. I have produced a patch between the original 1.1.0-dr1
> version and my working version, where I tried to include all the
> modifications that happened since 1.1.0-dr1. However, the changes are
> quite invasive and I do expect some difficulties in re-merging. Good
> luck :-)
> I tried to comment the code a lot so that you can understand what I
> wanted to do. If you have questions feel free to ask me. Do not hesitate
> to clean up bad things you may find (remember I have very little
> programming experience !).

  I reviewed the patch and tried to apply it, but it's against some old code 
and I can't easily merge it.  Only about half of it is applicable anymore.  
Some other comments:

1) This code needs to be changed to use the configured delimiters I think.  
(It was a bug in the old code too.)
      } else if (tmpbuf[ch] == '#' || tmpbuf[ch] == '!' ||
          tmpbuf[ch] == '/' || tmpbuf[ch] == ';' ||
          tmpbuf[ch] == 'c') {
2) Why did you remove the calls to update the number of frames scalar?
3) In general, there are lots of little optimizations to be done in your 
changes before they go into CVS.
4) This code:
+      // Check that this looks like data
+      if (QRegExp("^[\\s]*(([Nn][Aa][Nn]|(\\-\\+)?[Ii][Nn][Ff]|
[0-9\\+\\-\\.eE]+)[\\s]*)+").exactMatch(s)) {
         // a number - this may be an ascii file - assume that it is
-        return QFile::exists(s.stripWhiteSpace()) ? 49 : 75;
+        return 75; // What is the purpose of the test below ??? Looks wrong 
to me (NB) !
+       // return QFile::exists(s.stripWhiteSpace()) ? 49 : 75;

   This is a poorly documented hack that attempts to determine if an ascii 
file is actually an "indirect" file, and if it looks like one, lowers the 
probability of match.

   Any chance you can merge in the changes from HEAD?  Otherwise, please tell 
me exactly which revision of ascii.cpp you are using so I can merge it when I 
have time.

Thanks.

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


More information about the Kst mailing list