This forum has been archived. All content is frozen. Please use KDE Discuss instead.

how to override a kioslave?

Tags: None
(comma "," separated)
fluca1978
Registered Member
Posts
81
Karma
0
OS

how to override a kioslave?

Mon Mar 05, 2012 2:14 pm
Hi,
I've developed a simple kioslave as in the hello world tutorial, and I've succesfully installed and run. Now I changed the get method to return a different set of data than "Hello world", I uninstalled the old kioslave, compiled and installed again, run kbuildsycoca4 but each time I run the slave thru the kioclient I see the result of the previous code. It seems the binary has been cached and is not going to be replaced. How can I force the reloading of the last compiled module?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: how to override a kioslave?

Tue Mar 06, 2012 3:02 am
You may wish to try running "kdeinit4" to get this to kick in. Also, make sure no "kio_yourkioname" processes are still running on your system. (where yourkioname is the name of the protocol you are using)


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
fluca1978
Registered Member
Posts
81
Karma
0
OS

Re: how to override a kioslave?

Tue Mar 06, 2012 7:28 am
bcooksley wrote:You may wish to try running "kdeinit4" to get this to kick in. Also, make sure no "kio_yourkioname" processes are still running on your system. (where yourkioname is the name of the protocol you are using)



Uhm....no way. I do a
Code: Select all
sudo make uninstall
make clean
sudo make install
kdeinit4


and I get:

Code: Select all
$ kdeinit4
kdeinit4: Shutting down running client.
klauncher: Exiting on signal 15
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
KDE Daemon (kded) already running.
kbuildsycoca4 running...


but when I launch the slave I got the same output from the previous run, even if the data in the get method (and the main one) is changed. I've tried also to place some debug prints in the kdemain but without no luck. Nothing changes. I've checked for running process with
Code: Select all
ps -auxw | grep kio

but nothing pops up. It cannot be so complicated...I must be missing something really simple here...but what????
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: how to override a kioslave?

Tue Mar 06, 2012 8:09 am
Try running "killall klauncher" prior to running "kdeinit4".


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
fluca1978
Registered Member
Posts
81
Karma
0
OS

Re: how to override a kioslave?

Tue Mar 06, 2012 9:12 am
No way, I tried killing klauncher and running kdeinit4 again (that shows me a kill of klauncher too) but the kioslave does not change (I tried also to uninstall, reinstall):

Code: Select all
$ sudo killall klauncher
klauncher: Exiting on signal 15
klauncher: Exiting on signal 15

$ sudo make uninstall clean
-- Uninstalling "/usr/local/lib/kde4/kio_rolefs.so"
-- Uninstalling "/usr/local/share/kde4/services/rolefs.protocol"
Built target uninstall
$ sudo make install

$ kdeinit4
kdeinit4: Shutting down running client.
klauncher: Exiting on signal 15
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
KDE Daemon (kded) already running.
kbuildsycoca4 running...




I've placed a fprintf on stderr in main but I cannot see any message. The same using kdebug() macro.
Any other idea?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: how to override a kioslave?

Wed Mar 07, 2012 6:39 am
Be careful - KLauncher handles the execution of KIO slaves, so the output may be in ~/.xsession-errors instead.

As to why this is not kicking in - I am not sure unfortunately. My only guesses is that it is either finding an old version of your KIO slave installed elsewhere - or it has been loaded once and is not being reloaded...


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
fluca1978
Registered Member
Posts
81
Karma
0
OS

Re: how to override a kioslave?

Thu Mar 08, 2012 11:46 am
bcooksley wrote: My only guesses is that it is either finding an old version of your KIO slave installed elsewhere - or it has been loaded once and is not being reloaded...


Right! I don't know why, but the klauncher was searching a slave executable inot /usr/lib/kde4 while it is going to be installed into /usr/local/lib/kde4. In fact, creating a link from the former to the latter made it working and also without requiring to run kdeinit4 each time!

Now I'd like to know why my cmake is wrong and how to fix it:

Code: Select all
$ kde4-config --path lib
/home/luca/.kde/lib/:/usr/lib/


Code: Select all
project(rolefs)
FIND_PACKAGE(KDE4 REQUIRED)
INCLUDE_DIRECTORIES( ${KDE4_INCLUDES} . )
 
set(kio_rolefs_PART_SRCS rolefs.cpp)
 
kde4_add_plugin(kio_rolefs  ${kio_rolefs_PART_SRCS})
 
target_link_libraries(kio_rolefs ${KDE4_KIO_LIBS})
 
install(TARGETS kio_rolefs    DESTINATION ${PLUGIN_INSTALL_DIR})

 
########### install files ###############
 
install(FILES rolefs.protocol DESTINATION ${SERVICES_INSTALL_DIR})


I suspect $PLUGIN_INSTALL_DIR is not the same as the lib dir, but how can I check and fix it?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: how to override a kioslave?  Topic is solved

Thu Mar 08, 2012 9:21 pm
Your CMakeLists.txt is fine.

You need to run CMake as follows when configuring your KIO slave. The below command assumes you are in a sub-directory of your sources (usually named "build" - although the name does not matter).
Code: Select all
cmake .. -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix`


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft