Hi all,

I'm trying to implement a simple kioslave, but I don't understand well the
lifecycle and therefore how the slave should behave.

If I get it right, the get() method is called each time a specific URL must
be retrieved (e.g., a local file), while listDir and stat each time a folder
content must be shown. Now, what I'd like to make into my slave is that when
the root URL is called, a list of virtual folder is shown. Therefore I
placed my simple implementation of listDir and stat as follows:


void RoleFS::listDir( const KUrl& url ){

  KIO::UDSEntry dirEntry;

  dirEntry.insert( KIO::UDSEntry::UDS_NAME, "TEST" );

  dirEntry.insert( KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR );

  

  // emit a signal to list this entry

  listEntry( dirEntry, true );

  totalSize(1);

  finished();


}



void RoleFS::stat(const KUrl& url)

{

    KIO::UDSEntry dirEntry;

    dirEntry.insert( KIO::UDSEntry::UDS_NAME, "TEST" );

    dirEntry.insert( KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR );

    statEntry( dirEntry );

    finished();

}



However I don't undestand how to force konqueror to list dirs when the root
URL is placed into the address bar (e.g., rolefs:///), since the get method
is the only one called. I've had a look at the audiocd slave implementation,
that is similar to mine, but I don't understand how to instrument the get()
method to force a directory listing instead of a single data retrieval. Can
anybody point me to the solution?


Thanks,

Luca

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

Reply via email to