Metadata in kioslaves

David Faure faure at kde.org
Thu Aug 9 22:53:03 BST 2007


On Saturday 21 July 2007, Jeff Mitchell wrote:
> David Faure wrote:
> > On Wednesday 18 July 2007, Jeff Mitchell wrote:
> >   
> >> So, the questions:
> >> 1) KIO::Job::queryMetaData says "(Valid when first data is received 
> >> and/or slave is finished)"  Does this imply that I cannot, at any given 
> >> point, simply call queryMetaData with a specific key?
> >>     
> > You can, but only once the slave has started to send something back to the 
> > application, not before, that's what this means.
> >
> >   
> >> KIO::SlaveBase::metaData doesn't mention any such restriction.  If there 
> >> are restrictions on when queryMetaData could be called, what exactly are 
> >> they?  Because for what I'm doing I don't see the relevance to data() or 
> >> finished().
> >>     
> > Right. Initially metadata was in TransferJob only (get and put), which is why the
> > outdated documentation refers to data(). Now that metadata is available to any
> > job, it should probably say "valid after the slave starts processing this job" or something.
> >   
> 
> So if I read this right, accessing a slave's base folder (which would do 
> a stat, causing statEntry() and finished() to be called) would be enough 
> to allow me to from that point on access metadata at will?

Major parse error on your side or on mine...
Metadata is per job. So if by "access at will" you mean multiple two-way metadata exchanges
after the job is finished, the answer is no.
Metadata is additional data sent or received *by a job*, and is usually used to set job options
(see README.metadata for a large number of examples) or get some metadata back like
HTTP headers and stuff.
If what you're looking for is per-URL metadata (like, say, extended attributes on any file or directory), 
then UDSEntry is the answer, rather than KIO::metaData.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list