<br><br><div class="gmail_quote">On Sun, Feb 6, 2011 at 5:20 AM, Peter Kümmel <span dir="ltr"><<a href="mailto:syntheticpp@gmx.net">syntheticpp@gmx.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">Shouldn't we pass those values as parameters instead of making them global?</div>
In principle they could be handled like the QXmlStreamReader:<br>
<br>
<br>
Index: src/libkst/datasourcefactory.h<br>
===================================================================<br>
--- src/libkst/datasourcefactory.h (revision 1219092)<br>
+++ src/libkst/datasourcefactory.h (working copy)<br>
@@ -31,8 +31,21 @@<br>
// This takes ownership<br>
static void registerFactory(const QString& node, DataSourceFactory *factory);<br>
static void registerFactory(const QStringList& nodes, DataSourceFactory *factory);<br>
- KSTCORE_EXPORT static DataSourcePtr parse(ObjectStore *store, QXmlStreamReader& stream);<br>
- virtual DataSourcePtr generateDataSource(ObjectStore *store, QXmlStreamReader& stream) = 0;<br>
+<br>
+ struct ReadInfo<br>
+ {<br>
<br>
+ QString filename;<br>
+ QXmlStreamReader xml;<br>
+<br>
+ int startingFrame;<br>
+ int numberOfFrames;<br>
+ int skipFrame;<br>
+ int *lastFrameRead;<br>
+ };<br>
+<br>
+ KSTCORE_EXPORT static DataSourcePtr parse(ObjectStore *store, ReadInfo&);<br>
+<br>
+ virtual DataSourcePtr generateDataSource(ObjectStore *store, ReadInfo&) = 0;<br>
};<br>
<br>
We could also add a function to ReadInfo which implements the logic for getting<br>
the filename when we have file names in 'xml' and 'filename' set.<br>
<br>
It would be much cleaner and simpler to extend.<br>
<font color="#888888"><br></font></blockquote><div> </div></div>Yes, that makes sense. (I was just being lazy, which is bad in the long run...)<br clear="all"><br>-- <br><span style="font-family:arial, sans-serif;font-size:13px;border-collapse:collapse;color:rgb(136, 136, 136)">C. Barth Netterfield<br>
University of Toronto<br>416-845-0946</span><div><span style="font-family:arial, sans-serif;font-size:13px;border-collapse:collapse;color:rgb(136, 136, 136)"><br></span></div><br>