Hi,

Solved it by adding the following line to protocol file: -

listing=Name,Type,Size,Date,Access,Owner,Group,Link

Regards,

---------- Forwarded message ----------
From: Yogesh Marwaha <yogeshm....@gmail.com>
Date: 24 August 2011 12:30
Subject: Need help in writing a simple kio slave
To: kde-devel@kde.org


Hi,

I need your help in writing a simple kio slave to display contents of
a xml file (xml file follows a structure like a filesystem though
there will only be folders).

API documentation has not proved much useful. The easiest
example/source of kio slave implementation I could find was
'applications' slave.

From there I am getting the impression that get() is the first method
called when the url is opened in e.g. konqueror. Here is how I do it:
-

void SKioSlave::get(const KUrl& url){
   error( KIO::ERR_IS_DIRECTORY, url.prettyUrl() ); // We only have
folders in the tree
}

I'm not sure in which cases and when stat() and listDir() are called.
Here is my implementation of them (created just to get hold of
things).

void SKioSlave::stat(const KUrl& url){
   KIO::UDSEntry entry;

   if(url.path().size() == 0){ //base folder
       createFolderEntry(entry, "Sparkle", "");
       statEntry(entry);
       finished();
       return;
   }

   statEntry(entry);//Must be either Catalogue or invalid folder,
ignore for now
   finished();
}

void SKioSlave::listDir(const KUrl& url){
   KIO::UDSEntry entry;
   if(url.path().size() != 0){// Category or invalid folder, mark them empty
       listEntry(entry, true);
       totalSize(0);
       finished();
       return;
   }

   //Base folder, we have only one sub folder i.e. Catalogue

   createFolderEntry(entry, "Catalogue", "");
   listEntry(entry, false);

   listEntry(entry, true);
   totalSize(1);

   finished();
}

The problem is that when I open sparkle: in konqueror, it is forever
in loading state and it shows nothing. If I right click -> Properties
-> Calculate then correct number of subfolders (1) is shown, also name
of base folder (Sparkle) is shown.

What could be the problem here? What happens after I signal error in
the get() function?

Please help.

Regards,

Yogesh Marwaha



-- 
Yogesh M
http://sparklemedia.sourceforge.net/
http://mazedaar.wordpress.com/
http://snakeeyes.wordpress.com/

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

Reply via email to