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

Barth Netterfield netterfield at astro.utoronto.ca
Wed Feb 2 18:18:37 CET 2011


right...

[...]Model::addDataSourceFileItem(...)


(which I recently moved from primitiveModel into stringmodel and
scalarmodel) adds strings to the view primitive dialog rather than to the
store.  After a recent change, it is no longer called if the datasource has
no output strings/scalars.

I think that addDataSourceFileItem should just be deleted and the scalars be
added to datasource.cpp.

Do you agree?

Also, vectors with no output scalars still appear in the the view scalars
list, and I think they shouldn't.

I will let you work on both.


On Wed, Feb 2, 2011 at 6:35 AM, Peter Kümmel <syntheticpp at gmx.net> wrote:

> SVN commit 1218459 by kuemmel:
>
> add scalars and strings to objectstore to make them usable by other dialogs
>
>  M  +29 -0     datasourcepluginmanager.cpp
>
>
> --- branches/work/kst/portto4/kst/src/libkst/datasourcepluginmanager.cpp
> #1218458:1218459
> @@ -266,6 +266,35 @@
>   for (QList<PluginSortContainer>::Iterator i = bestPlugins.begin(); i !=
> bestPlugins.end(); ++i) {
>     DataSourcePtr plugin = (*i).plugin->create(store, &settingsObject,
> filename, QString(), e);
>     if (plugin) {
> +
> +      // add strings
> +      const QStringList strings = plugin->string().list();
> +      if (!strings.isEmpty()) {
> +        foreach(const QString& key, strings) {
> +          QString value;
> +          DataString::ReadInfo readInfo(&value);
> +          plugin->string().read(key, readInfo);
> +          StringPtr s = store->createObject<String>();
> +          s->setProvider(plugin);
> +          s->setSlaveName(key);
> +          s->setValue(value);
> +        }
> +      }
> +
> +      // add scalars
> +      const QStringList scalars = plugin->scalar().list();
> +      if (!scalars.isEmpty()) {
> +        foreach(const QString& key, scalars) {
> +          double value;
> +          DataScalar::ReadInfo readInfo(&value);
> +          plugin->scalar().read(key, readInfo);
> +          ScalarPtr s = store->createObject<Scalar>();
> +          s->setProvider(plugin);
> +          s->setSlaveName(key);
> +          s->setValue(value);
> +        }
> +      }
> +
>       return plugin;
>     }
>   }
> _______________________________________________
> Kst mailing list
> Kst at kde.org
> https://mail.kde.org/mailman/listinfo/kst
>



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


More information about the Kst mailing list