faq
flatforty
contribute
subscribe
configure
search
rdf
main
parent
thread
|
Re: Kioslave hell
by Andras Mantia on Sunday 29/Oct/2006, @05:53
|
There is only one specific things with media:/ and co. they are local even if they don't look so. The only case when an application has to do something special is when it is a KDE application, uses KURL, but doesn't support remote operation. Why? Because if its a KDE application and uses only KURL inside it simply shouldn't care if the KURL points to a remote or local file. If it's a KDE application, but works only with local paths and uses QStrings to store paths, it should specify that it cannot open remote URL's (uses filename %f in the .desktop file). In case of non-KDE applications, the situation is the same.
So what is in the case of using KURLs and not supporting remote files? I think this was the case of Kaffeine, Amarok and K3B as all of them pass the paths to third party non-KDE applications who don't no anything about KIOslaves. Well, just check the sources for K3B for the "hack":
if( !url.isLocalFile() ) {
return KIO::NetAccess::mostLocalURL( url, 0 );
}
The hack you are looking for is "mostLocalURL". The function is there since KDE 3.5.0, released quite some time ago.
I simply don't buy the argument that this idea is broken and needs hack in the applications. In case somebody shows me real examples (none-working apps or extra hacks because of this) I can discuss more.
Another example is from amarok:
// Note: remove for kde 4 - we don't need to be hacking around KFileDialog,
// it has been fixed for kde 3.5.3
else if( protocol == "media" || url.url().startsWith( "system:/media/" ) )
{
...
}
So if there was a bug, it was fixed in 3.5.3. Bugs can exists, this is why they should be reported so they can be fixed either in libraries or applications. |
|
|
The Fine Print: The following comments
are owned by whomever posted them.
( Reply )
|
Re: Kioslave hell
by Koos on Sunday 29/Oct/2006, @09:23
|
For KMPlayer, the mostLocalURL isn't such a nice solution. All KParts targeted for KHTML should not use local loops. The problem is that JS setTimeout() or other redirect ways, may fire inside such a local loop, causing a page reload. This will most certainly crash konqueror.
|
[
Reply To This | View ]
|
Re: Kioslave hell
by Andras Mantia on Sunday 29/Oct/2006, @09:59
|
I admit I never heard that you have to be so careful with KParts loaded inside KHTML, but in this case the problem is rather the hack used in NetAccess, than media:/ or mostLocalURL. This simply means you can never use KIO::NetAccess, right? I find this a particular case, wrong interaction between two applications, and in this case I admit a hack (or non-standard solution) is needed, like manually find out if it's a media:/ or whatever URL and translate yourself to the real path.
|
[
Reply To This | View ]
|
Re: Kioslave hell
by Gato on Sunday 29/Oct/2006, @16:33
|
> but in this case the problem is rather the hack used in NetAccess,
> than media:/ or mostLocalURL
From a pragmatic point of view it doesn't really matter whose fault it is. An unnecessary feature that triggers bugs in other features is still a mistake, no matter who has written the bugs.
|
[
Reply To This | View ]
|
|
Re: Kioslave hell
by Leo S on Sunday 29/Oct/2006, @13:39
|
Look, I'm interested in use cases, cause that's where I run into these problems. As you mention, Kaffeine seems to be fixed, at least in Kubuntu 6.10 I can open a video file from media:/usbstick and it will work (it translates it to /media/usbstick, no idea what it would do on other distros that have no /media)
Here's a big one problem though. I plug in my flash drive, and want to get there in a konsole window. Now I could press F4 and it would work (on Kubuntu), but what if I have an already open konsole window? Intuitively I would type something like cd media:/usbstick. That obviously doesnt work. This would make no sense to users. Yes I know I can use some kde inbetween thing to do it, but I have no idea how, and if I did look it up, I would forget it immediately because it's so obtuse.
Now I want to open a file in helix player. If I open helix player and try to open a media:/ URL it won't work. Once again, this makes no sense to users. Why does a path that works in kaffeine not work in helix-player? Completely mystifying.
The point behind all this is that it causes very real problems for a very slight, if any gain. For some corner cases, the media:/ path is easier to understand, but for many more cases (anyone that doesn't use purely KDE software) it's a very big and very real problem.
In my mind, this is a poor tradeoff. Anyway, I've complained enough about this. Time to move on :) Well done Kubuntu for fixing this critical issue!
|
[
Reply To This | View ]
|
Re: Kioslave hell
by Gato on Sunday 29/Oct/2006, @16:30
|
Hm.
OK then you're right, there are correct ways of handling most parts of the problem. But why handle the problem and maintain that handling when it's far easier to not have the problem at all? Why not just use the standard filesystem?
|
[
Reply To This | View ]
|
The Fine Print: The previous
comments are owned by whomever posted them.
( Reply )
|
|