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

Peter Kümmel syntheticpp at gmx.net
Wed Feb 2 19:15:27 CET 2011


On 02.02.2011 18:18, Barth Netterfield wrote:
> 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?

Yes, addDataSourceFileItem is deleted now. And the datasources already have metas,
but the plugin must support it.

>
> 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
>>
>
>
>
>
>
> _______________________________________________
> Kst mailing list
> Kst at kde.org
> https://mail.kde.org/mailman/listinfo/kst


More information about the Kst mailing list