On Wed, Jun 13, 2012 at 5:56 AM, Albert Astals Cid wrote: > El Dimarts, 12 de juny de 2012, a les 10:07:28, Luca Ferrari va escriure: >> Thanks for the explaination. As far as I understand a kded module is >> required to handle per-user configuration to share with all running >> slaves, but is there any tutorial or sample I can start studying from? > > I know someone did that in the past but don't really remember which iosla= ve it > was. I believe you might want to look at the network:/ kioslave, from memory. > > Sorry, > =A0Albert Regards, Ben > >> I cannot find one and the kded documentation is not so clear to me. >> >> Thanks, >> Luca >> >> On Mon, Jun 11, 2012 at 8:10 PM, Albert Astals Cid wrote: >> > El Dilluns, 11 de juny de 2012, a les 17:59:44, Luca Ferrari va escriu= re: >> >> Hi all, >> >> I'm making my first kioslave and I've got a doubt, as already posted >> >> here http://forum.kde.org/viewtopic.php?f=3D43&t=3D102547. >> >> My protocol has the lines: >> >> >> >> [Protocol] >> >> exec=3Dkio_rolefs >> >> protocol=3Drolefs >> >> >> >> and my kdemain is as follows: >> >> >> >> extern "C" int KDE_EXPORT kdemain( int argc, char **argv ) >> >> { >> >> =A0 kDebug(RoleFSDebugArea()) << "[kdemain] starting"; >> >> =A0 KComponentData instance( "kio_rolefs" ); >> >> >> >> >> >> >> >> =A0 kDebug(RoleFSDebugArea()) << "kdemain is creating a slave..."; >> >> =A0 RoleFSKIOSlave slave( "Hello","Slave", instance, argv[2], argv[3]= ); >> >> =A0 kDebug(RoleFSDebugArea()) << "staring the dispatch loop"; >> >> =A0 slave.dispatchLoop(); >> >> =A0 kDebug(RoleFSDebugArea()) << "kdemain] ending"; >> >> =A0 return 0; >> >> } >> >> >> >> >> >> So it should do nothing very special here. However, when I open >> >> dolphin (a single window) and point it to the rolefs:/// path I see in >> >> the ~/.xsession-errors log file the following messages: >> >> >> >> unnamed app(9078)/[RoleFS debug] kdemain: [kdemain] starting >> >> kio_rolefs(9078)/[RoleFS debug] kdemain: kdemain is creating a slave.= .. >> >> kio_rolefs(9078)/[RoleFS debug] kdemain: staring the dispatch loop >> >> unnamed app(9084)/[RoleFS debug] kdemain: [kdemain] starting >> >> kio_rolefs(9084)/[RoleFS debug] kdemain: kdemain is creating a slave.= .. >> >> kio_rolefs(9084)/[RoleFS debug] kdemain: staring the dispatch loop >> >> unnamed app(9087)/[RoleFS debug] kdemain: [kdemain] starting >> >> kio_rolefs(9087)/[RoleFS debug] kdemain: kdemain is creating a slave.= .. >> >> unnamed app(9088)/[RoleFS debug] kdemain: [kdemain] starting >> >> kio_rolefs(9088)/[RoleFS debug] kdemain: kdemain is creating a slave.= .. >> >> kio_rolefs(9087)/[RoleFS debug] kdemain: staring the dispatch loop >> >> unnamed app(9089)/[RoleFS debug] kdemain: [kdemain] starting >> >> kio_rolefs(9089)/[RoleFS debug] kdemain: kdemain is creating a slave.= .. >> >> kio_rolefs(9089)/[RoleFS debug] kdemain: staring the dispatch loop >> >> kio_rolefs(9088)/[RoleFS debug] kdemain: staring the dispatch loop >> >> unnamed app(9090)/[RoleFS debug] kdemain: [kdemain] starting >> >> kio_rolefs(9090)/[RoleFS debug] kdemain: kdemain is creating a slave.= .. >> >> kio_rolefs(9090)/[RoleFS debug] kdemain: staring the dispatch loop >> >> >> >> therefore there are processes 9078, 9084, 9087, 9088, 9089 and 9090 >> >> for a total of 6 kioslaves running at the same time. The rolefs:/// >> >> root path displays 3 icons, one of which contains 4 other elements. >> >> Besides this, I'd like to know when kioslave are created and how is it >> >> possible to handle a "shared" state so that if the user opens two file >> >> manager views the slaves are accessing the same underlying values >> >> (beside haveing to re-read the configuration). >> > >> > kioslaves are by definition stateless, i.e. you can't assume anything >> > about a running instance being reused or a new one being spawned, etc.= If >> > you need to keep state I think the common solution is to have a kded t= hat >> > the slave communicates with. Also having a maxInstances of 1 might hel= p. >> > >> > You can have a look at >> > http://techbase.kde.org/Development/Tutorials/Debugging/Debugging_IOSl= aves >> > to learn how to debug your slave. >> > >> > Cheers, >> > =A0Albert >> > >> >> Thanks, >> >> Luca >> >> >> >> >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to >> >> >> unsubscribe >> >> >> << >> >>> >> >>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to >> >>> unsubscribe <<>> >> >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubsc= ribe >> >> << > >>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscri= be << >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscrib= e <<