Registered Member
|
Hi all,
I'm trying to experiment with kio slaves and so I created a clone of the official hello example http://techbase.kde.org/Development/Tutorials/KIO_Slaves/Hello_World with the only differences that (1) all my files are called test (including the slave class) and that (2) the protocol I use is called myprotocol as reported by the test.protocol file below:
I can compile and install the project:
but when I try to run the example I got the following error:
What am I missing here? I've tried different protocols and naming schema to see if I can figure out what is wrong with this simple example, but the error is always the same. Is there a way to list the installed/known protocols? Because the kinfocenter does not present me a protocols tab. I attach the source code of all the files in the case they can help:
Thanks anyone. |
Administrator
|
Did you run "kbuildsycoca4" after installing it? Also, did you install it into a directory covered by "kde4-config --path lib"? (less the /lib parts)
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
The kde4-config reports the following output:
so I changed the CMakeLists.txt to the following in order to get the installation in the right directory ( I don't understand why it was getting /usr/local/lib instead of /usr/lib as reported by kde4-config):
and the project gets installed into
After that I ran kbuilsycoca4 (which reports it is running) and then invoked the slave with the same error:
I tried to strace the process to see if it is opening the test.protocol file and I was unable to see such an entry, but this could be right if kbuildsycoca4 loads the known protocols in memory as a separate thread 8right?). The only thing I can find in the strace output is:
which means that the kioslave really does not know how to interpret the protocol (I think I discovered hot water here ). Is there a way to see what the kde cache knows about protocols and handlers? Thanks, Luca |
Administrator
|
You can't simply install into ~/.kde4/lib/ that won't work.
I suggest adding a file into ~/.kde4/env/ with the following contents:
Ensure that file is executable with .sh as it's ending then logout and back in again. Now reverse the changes you made to CMakeLists.txt, and run cmake as follows:
Then make && make install as usual, run kbuildsycoca4 and you should be able to use your new KIO slave.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
No way, sgrunt!
This is the ~/.kde/env/kde-dev.sh file content:
The file is executable and in fact, after logging out and loggin in again I can see the environment variable set. Then I changed working directory to the build one and did the following steps (I'm reporting the output of each command):
I'm sure I'm missing a little thing somewhere, it cannot be so difficult after all.... |
KDE Developer
|
kioslaves are spanwed by kdeinit4/klauncher, which is run at the very beginning of the KDE session (or by the first appplication using kioslaves in non-KE environments) and lasts until the logout.
To make it use a different KDEDIRS (or others) environment variable, you have to do one of
Also,
please note the order of the prefixes specified in KDEDIRS has the same meaning as in e.g. $PATH, i.e. you must specify first what you want to ue first (so in your local prefix you can install stuff "overriding" the version in the KDE installation).
Pino Toscano
|
Registered Member
|
No way!
I've already tried to logout and login again, and I've also switched the KDEDIRS path order to place my private install as first, but kioclient still reports the same error about unknown protocol myprotocol. Is there any check tool I can run to see what is wrong with my configuration? Anyone can try my files to see if there's an error somewhere? Thanks |
Administrator
|
When I installed it on my trunk system, it operated ok, so your sources are fine.
Did you ensure that ~/.kde/env/kde-dev.sh is executable? Also, ensure that "echo $KDEDIRS" returns the correct result in a terminal after logging in and out again.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Sigh, let get is straight.
After a login I run in a terminal the following:
then I tried again to run kioclient:
Ok, time for panic here!
I guess there is some problem here with my installation of kde (or kioclient), but how can I check it and discover the problem? Thanks a lot. |
Administrator
|
On your system it seems that the test.protocol file is being installed into the wrong directory. Make sure that your CMakeLists.txt reads the following on the line in question:
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
I changed the CMakeLists.txt according to your suggestion and ran the build phase again after a whole uninstall:
and after a kdebuildsycoca4 it runs!
Thanks a lot everybody. Now I can move on on more complex concepts! |
Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft