[Kst] kst2 datasource API comments

Peter Kümmel syntheticpp at gmx.net
Tue Mar 16 19:38:30 CET 2010


nicolas.brisset at free.fr wrote:
> - I find the ASCII datasource pretty complex.
> It's hard not to get lost between the AsciiSource (derived from Kst::DataSource), Ascii::Config and AsciiPlugin (derived from Kst::DataSourcePluginInterface) classes. In the .cpp you get the expected ConfigWidgetAscii, which is no more in ascii.h than Ascii::Config. And I'm not even mentioning the fact that Ascii::Config has read but no write and that it mixes working with QSettings and the XML .kst file. Or count the number of times there is the string "Comment Delimiters": 6, qnd it's only counting the management of settings! Phew! I don't remember it being so complex when I improved it a bit a few years ago. I wonder if I wouldn't just have given up if it had been as complex as today! And by the way, I think that Peter forgot to save properly the "use dot" property in the XML when he introduced it, which is probably a sign that it needs some refactoring. But that's actually more the ASCII datasource itself than the Kst::DataSource class in itself, which I guess is rathe
r good news :-)

I've cleaned up the ascii.cpp code: splitted into more files,
removed the duplicates of key and tag names, and hopefully made
it more readable.

Maybe it is also possible to simplify datasource.h

Peter


More information about the Kst mailing list