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

Peter Kümmel syntheticpp at gmx.net
Thu Jan 20 16:43:33 CET 2011


On 20.01.2011 09:54, Brisset, Nicolas wrote:
>> I've removed the directory from the name and added it as value. Is
> this
>> OK?
> The idea is very good, however I think the implementation should be
> different. Here, that string is visible only in the view dialog. I think
> it should be created at kst level, so that one can e.g. use it in a text
> label.
> Now that I'm thinking of it, here is how I would do things:
> - each datasource should have a short name as identifier, which would be
> the filename + (S[nb of the datasource]), just like for other objects.
> Consistence is good! Maybe the store already provides that?

DS is already a NamedObject, in principle it could have a short name,
but it is not used. and changing

QString DataSource::fileName() const {
   // Look to see if it was a URL and save the URL instead
   const QMap<QString,QString> urlMap = DataSourcePluginManager::urlMap();
   for (QMap<QString,QString>::ConstIterator i = urlMap.begin(); i != urlMap.end(); ++i) {
     if (i.value() == _filename) {
       return i.key();
     }
   }
   return _filename;
}

breaks a code where the complete path is needed. So one has to go through the
code and must replace fileName() with something else.

> - each datasource should provide some string metadata which is not read
> from the file but added by the datasource class itself for all file
> types: File Name, Directory, Full Path, and possibly other file
> attributes.

Currently is the metacode ony in the concrete plugin code, so we
would have to change the API, or change all plugins.

> That way, we would have a short string to use in the tree view to
> reference the datasource and the Directory property would be a
> per-datasource string and appear naturally just where you have put it
> now. It would be the cleanest solution, I think.
>
>> Yes, the dialog is filled only when opened.
> But if it has an update() function, we could call it from the create
> scalar/string dialogs. And if it doesn't, we could create it :-)
> I think we have access to pointers to those dialogs when they exist...

Adding an updatebutton an replacing the model with a new one should do
the job. Will test it tomorrow.

Peter


>
> Nicolas
>
>
>
> Eurocopter Deutschland GmbH
> Sitz der Gesellschaft/Registered Office: Donauwoerth
> Registergericht/Registration Court: Amtsgericht Augsburg HRB 16508
> Vorsitzender des Aufsichtsrates/Chairman of the Supervisory Board: Dr. Lutz Bertling
> Geschaeftsfuehrung/Board of Management:
> Dr. Wolfgang Schoder, Vorsitzender/CEO; Friedrich-Wilhelm Hormel; Ralf Barnscheidt
>
> CONFIDENTIALITY NOTICE
>
> This communication and the information it contains is intended for the addressee(s) named above and for no other persons or organizations. It is confidential and may be legally privileged and protected by law. The unauthorized use, copying or disclosure of this communication or any part of it is prohibited and may be unlawful.
> If you have received this communication in error, kindly notify us by return e-mail and discard and/or delete the communication. Thank you very much.
> It is possible for e-mails to be intercepted or affected by viruses. Whilst we maintain virus checks on our e-mails, we accept no liability for viruses or other material which might be introduced with this message.
>
> _______________________________________________
> Kst mailing list
> Kst at kde.org
> https://mail.kde.org/mailman/listinfo/kst
>


More information about the Kst mailing list