[Kst] Re: branches/work/kst/portto4/kst/src

Barth Netterfield netterfield at astro.utoronto.ca
Mon Feb 7 16:12:41 CET 2011


On Sun, Feb 6, 2011 at 5:20 AM, Peter Kümmel <syntheticpp at gmx.net> wrote:

> Shouldn't we pass those values as parameters instead of making them global?
> In principle they could be handled like the QXmlStreamReader:
>
>
> Index: src/libkst/datasourcefactory.h
> ===================================================================
> --- src/libkst/datasourcefactory.h      (revision 1219092)
> +++ src/libkst/datasourcefactory.h      (working copy)
> @@ -31,8 +31,21 @@
>      // This takes ownership
>      static void registerFactory(const QString& node, DataSourceFactory
> *factory);
>      static void registerFactory(const QStringList& nodes,
> DataSourceFactory *factory);
> -    KSTCORE_EXPORT static DataSourcePtr parse(ObjectStore *store,
> QXmlStreamReader& stream);
> -    virtual DataSourcePtr generateDataSource(ObjectStore *store,
> QXmlStreamReader& stream) = 0;
> +
> +    struct ReadInfo
> +    {
>
> +      QString filename;
> +      QXmlStreamReader xml;
> +
> +      int startingFrame;
> +      int numberOfFrames;
> +      int skipFrame;
> +      int *lastFrameRead;
> +    };
> +
> +    KSTCORE_EXPORT static DataSourcePtr parse(ObjectStore *store,
> ReadInfo&);
> +
> +    virtual DataSourcePtr generateDataSource(ObjectStore *store,
> ReadInfo&) = 0;
>  };
>
> We could also add a function to ReadInfo which implements the logic for
> getting
> the filename when we have file names in 'xml' and 'filename' set.
>
> It would be much cleaner and simpler to extend.
>
>
Yes, that makes sense.  (I was just being lazy, which is bad in the long
run...)

-- 
C. Barth Netterfield
University of Toronto
416-845-0946
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kst/attachments/20110207/bcbfbac8/attachment.htm 


More information about the Kst mailing list