[KDE Dot News]
 faq
 flatforty
 contribute
 subscribe
 configure
 search
 rdf

 main
 parent
 thread


Re: Kioslave hell
by Ian Monroe on Friday 27/Oct/2006, @17:29
Um, no. They shouldn't.
  Related Links
 ·   Articles on KDE in Linux Distributions
 ·   Also by Ian Monroe
 ·   Contact author

Thread Threshold:

The Fine Print: The following comments are owned by whomever posted them.
( Reply )

Re: Kioslave hell
by Leo S on Friday 27/Oct/2006, @20:32
Well, then how do you propose they "fix" it? Kubuntu has done it by replacing media:/ with /media. Is there a better way?
[ Reply To This | View ]
  • Re: Kioslave hell
    by Andras Mantia on Saturday 28/Oct/2006, @00:45
    The ways to fix them is:
    - report as bugs OR
    - grab the source, find the problem and fix it, and send a patch.

    Treating media://, system:// or home:// as local directories is not that big deal, most KDE applications should be easily fixable. Non-KDE applications are a different issue though and not easily solvable. Just think about fish:// protocol, as it is not known by OpenOffice.org, you cannot simply edit the file on the remote place (I think the KIO system it will download to a temporary directory though, but I didn't check it).
    [ Reply To This | View ]
    • Re: Kioslave hell
      by Morty on Saturday 28/Oct/2006, @06:23
      You are missing the point, or points actually. Fixing the problems those IO-slaves create is not the problem, the problem is that they create those kinds of bugs in the first place for no gain whatsoever. They where supposed to bring some kind of usability improvment, which clearly they don't.

      Nobody can argue that media://cdrom or system:/media/cdrom gives any kind of increased usability, compared to /media/cdrom or /mnt/cdrom. It's even worse with home:// since it points to /home rather than the users home, so instead of ~/myfile you have to use home://username/myfile.

      The only things those IOslaves give are a possibility for subtle bugs, and breaking compability with legacy applications. They should be removed from svn as fast as possible, and never talked about again other than as examples of horrible usability mistakes.

      The other IOslaves, like fish:// as you mentioned, does not have any of this problems. They are quite different in the way they provide extra functionality, not redefining already existing ones. Since OpenOffice is not able to edit remote files anyway, fish:// does not change anything or introduce a bug. While home://username/myfile.odt does, since its actually ~/myfile.odt a simple local file witch should be editable.
      [ Reply To This | View ]
      • Re: Kioslave hell
        by anonymous coward on Saturday 28/Oct/2006, @06:36
        Full ACK

        I'm a huge fan of KDE's ioslaves except for media:/ which is driving me insane. Autodetection of removable devices is great and necessary, but the path which is given to applications should be /media. Everything else is simply broken.
        [ Reply To This | View ]
      • Re: Kioslave hell
        by AJ on Saturday 28/Oct/2006, @13:10
        > Nobody can argue that media://cdrom or system:/media/cdrom gives any kind of increased usability, compared to /media/cdrom or /mnt/cdrom.

        It's way too Linux-specific. I'm used to /vol/local/dvdX for local and /vol/pool/dvdrX for drives at the server. media://dvd is much more simplier and just works, no matter which station you log on. Ok, maybe non-KDE apps have probs with this, but they can't handle fish:// as well.

        > It's even worse with home:// since it points to /home

        Yep, as that's what it is supposed to do. For your own home theres ~. But after you typed /users/bkoffice/8/bentruth a dozend times you'll start loving home://bentruth.

        And no, I'm not running KDE as root, just Kate via sudo.
        [ Reply To This | View ]
        • Re: Kioslave hell
          by Gato on Saturday 28/Oct/2006, @16:57
          > It's way too Linux-specific.

          As someone else already reminded, being the same on all platforms is not always good. Java has swing which looks the same on all platforms. Some developers love this, but the rest of the people either don't know about other platforms, or they're at no advantage anyway. They only notice that it doesn't look as it should on their platform. This is why SWT was introduced, and this why I don't know of any successful Swing app.

          So really, what's the point that I could (mis-)use the same non-standard URL on other operating systems? My problem is that it's non-standard on my system.

          BTW, I'm a FreeBSD user, not a Linux user, and I too have /media and /home.

          > I'm used to /vol/local/dvdX for local and /vol/pool/dvdrX
          > for drives at the server.

          You represent a very small minority that uses many machines with many different operating systems with servers that do removable media on a regular basis (most servers really don't). This is unlikely KDE's main target, and thus it's not a reason to invent imaginary filesystems.

          > media://dvd is much more simplier and just works,
          > no matter which station you log on.

          That's easy, just create a "/dvd" symlink on all machines. You can even automate the process provided you can detect the OS from a shell script.

          > Ok, maybe non-KDE apps have probs with this,
          > but they can't handle fish:// as well.

          Not just non-KDE, but KDE apps too, unless someone patches them to make them work. And maintains the patch, instead of doing cool stuff, and writes some more patches for the new monsters - you don't assume media:/, home:/ and system:/ will be the last of them, do you? Just wait for doc:/info that will point to /usr/share/info and system:/doc/info etc etc. (Don't worry, just kidding)

          As for fish:/, fish is different because it introduces new functionality. Without the fish KIOslave there would be no fish at all ;-). But /media would be there anyway, so no need to replace it with something that doesn't work.

          > But after you typed /users/bkoffice/8/bentruth a dozend times
          > you'll start loving home://bentruth

          Again, symlinks are your friends:

          ln -s /users/bkoffice/8 /home

          Besides, the file dialog has autocompletion so it's not that bad anyway. And inventing proprietary URLs just for the sake of shorthand is silly.
          [ Reply To This | View ]
          • Re: Kioslave hell
            by Debian User on Sunday 29/Oct/2006, @09:26
            I am totally baffled at why you assume that every KDE system on earth should have /media or that the user will even be allowed to create it.

            What KDE is and was for a long time already, or so I believe, is a desktop for a wide array of systems. One of its strengths being that the KDE framework solves the problems for the applications just fine.

            My understanding is that media:// should work fine for every KDE application and that's OK. Where it does not, it's probably worth to note, that these apps have attempted to improve over the framework, so there is a need, point proven.

            Stop telling KDE it should not provide its own ways of doing things. We actually like innovation around here.

            Yours,
            Kay
            [ Reply To This | View ]
            • Re: Kioslave hell
              by Leo S on Sunday 29/Oct/2006, @13:20
              >> I am totally baffled at why you assume that every KDE system on earth should have /media or that the user will even be allowed to create it.

              The user doesn't create it. That's up to the distribution/system.
              [ Reply To This | View ]
            • Re: Kioslave hell
              by Gato on Sunday 29/Oct/2006, @16:37
              > I am totally baffled at why you assume that every KDE
              > system on earth should have /media

              I don't assume that at all, I only assume that the fact that I have non-standard KDE URL (media:/) that just happens to be the same on other operating systems (that I don't use) is of no use to me.

              (And I'm not just egoistically thinking about me, when I say "no use to me" it's just a way of speaking.)
              [ Reply To This | View ]
            • Re: Kioslave hell
              by Gato on Sunday 29/Oct/2006, @16:41
              > Stop telling KDE it should not provide its own ways of doing things.
              > We actually like innovation around here.

              By all means I'm not trying to tell KDE not to do. I'm not the one to do that, and besides I too like innovation. I'd like a KDE way of doing things, such as making hardware access 'just work', transparently to the user.

              But media:/ and system:/ and home:/ are not new ways of doing things, they are just new ways of calling things. Same old things, new names, new misunderstandings, new breakage. Worst of all, new filesystems to learn. Real innovation would be getting rid of all filesystems in the user interface, not adding new ones on top of old ones.
              [ Reply To This | View ]
          • Re: Kioslave hell
            by AJ on Sunday 29/Oct/2006, @10:03
            > That's easy, just create a "/dvd" symlink on all machines. You can even automate the process provided you can detect the OS from a shell script.

            Detecting the OS is not the issue - always the same. But "all machines" is wrong. There are only a few servers, 20 at the moment, but more than 300 Workstations. X session runs on the server, but drives are workstation-local. Good luck with symlinks... ;-) (kdm runs locally, reowns the drive to the user logged in and ncs a script on the server which automounts, kinda nasty but works)

            > Not just non-KDE, but KDE apps too, unless someone patches them to make them work.

            If they use the kio api, all kioslave should work or it's a bug to be squashed. I've never had probs with media:/ fish:// sftp:// or camera:/ (at home). system:/ or settings:/ are rarely used, ok, but they still work. audiocd:/ does, too.

            > Again, symlinks are your friends:
            > ln -s /users/bkoffice/8 /home

            Bad luck. You'd have to link /users to /home (not everyone is in backoffice), but it wouldn't help. Not everyone has their homes in /users, but in /u (I'm there) or the Linux-like /home (for some local only logins).

            > And inventing proprietary URLs just for the sake of shorthand is silly.

            They are not proprietary, they're well documented and free to use (or ignored).
            [ Reply To This | View ]
            • Re: Kioslave hell
              by Gato on Sunday 29/Oct/2006, @16:50
              > They are not proprietary, they're well documented and
              > free to use (or ignored).

              There are at least two ways of speaking about proprietary. In one way you're right. But there's the other way: a method of software interaction can be called proprietary when it's free and open, but it's not an agreed upon standard and it requires special efforts from the part of other people in order to work.

              This means that even if you give other people the tools to unbreak the compatibility that you have just broken, your URL language is still proprietary until it becomes an agreed upon standard.
              [ Reply To This | View ]
        • Re: Kioslave hell
          by AC on Sunday 29/Oct/2006, @01:24
          You write...:
          Yep, as that's what it is supposed to do. For your own home theres ~. But after you typed /users/bkoffice/8/bentruth a dozend times you'll start loving home://bentruth.

          If you'll allow using ~ for your own home, then how is home://bentruth any better than ~bentruth?
          [ Reply To This | View ]
    • Re: Kioslave hell
      by Gato on Saturday 28/Oct/2006, @11:20
      > The ways to fix them is: report as bugs

      Sorry but people only report bug when they are worth fixing. Fixing the bugs introduced by the imaginary filesystems is just absurd. It would only mean piling hacks on top of hacks on top of hacks. And all you'd get is fixing other hacks (the proprietary URLs themselves). Just to get back functionality that has always been there to begin with.

      The real way is not to cure the symptoms, it's to cure the disease. To eliminate the cause.
      [ Reply To This | View ]
      • Re: Kioslave hell
        by Andras Mantia on Saturday 28/Oct/2006, @12:49
        There is no need for hacks over hacks, only right way of using the KDE API and creating the correct desktop files. But whatever, I tested media:/, system:/ and home:/ URLs with KDE and non-KDE applications mentioned here. Well, amarok, kaffeine, konsole, xine and openoffice has no problems. For those who doesn't understand the URL is translated to the real path. Eg. open a file in oowriter from home:/user and when you try to save it, you will see in the file dialog: "/home/user" as the current directory. I'd say they work unless you give a non-working example. And I'd say this proves that if they don't work, it's nothing else, but a bug.
        Just for the record: self-compiled KDE 3.5.5 on SUSE 10.1.
        Oh, and I like the media:/ slave (i don't use the others) as it is much easier to use and remember than some path that can be different on every distribution.
        [ Reply To This | View ]
        • Re: Kioslave hell
          by Gato on Saturday 28/Oct/2006, @17:07
          The reason why some apps don't have problems any longer is that they've been hacked to either translate URLs or copy files to temporary locations etc. And these hacks need to be maintained, and new hacks will need to be written in order to accomodate new needs.

          All of this just for the sake of having the same URL on all distros. And the distros already use the same URL, '/media'! Unless they're not FHS compliant (very old Linux? IRIX?).

          And even if they did use different locations for mount-points (which they don't), what would be more important:

          a. having URLs that can be understood by all apps on _your_ system, or
          b. having URLs born incomprehensible (albeit partially resurrected by haunted application developers ;-) ) that look the same on all distros? Who cares about all distros?
          [ Reply To This | View ]
          • Re: Kioslave hell
            by Andras Mantia on Sunday 29/Oct/2006, @00:29
            Have you ever used the KDE API to write applications? If you stick to KURL everywhere you will have hard time to break media:/ or system:/ or whatever. It just works. And if you don't use KURL e.g because you have to pass the files to a non-KDE application (like xine) just use "Exec=appname %f" in you appname.desktop file instead of "Exec=appname %U" and KDE will download the file to a temporary location before passing to the application.
            Really, there is no need for hacks unless in very few cases and even than it should be a minor issue to make it work. And for me both a and b is important and I would fix a rather than just throw away something because some apps have issues at this moment. But what apps, please tell me and I will test here as well...
            [ Reply To This | View ]
            • Re: Kioslave hell
              by Morty on Sunday 29/Oct/2006, @02:04
              The problem is that KURL does not really help you in most of the bugs caused by this, the remote IO-slaves have never been a problem. The problem are the unnecessary local ones like media:/. They have created bugs for every application that have the need for treating local files different then remote files. Lots of applications like Kaffeine, k3b, codeine etc have special handling of cases when these URLs are used to to make them be seen as local files. And none of these applications had this before being notified by a bug report. So it simply does not just work.

              And it's not about throwing something away because some apps have issues, it's about throwing something away that does not give any benefit over the systems existing solution. And in addition it introduces unnecessary problems and create issues for applications. IO-slaves are great, but they are not the solution to everything.
              [ Reply To This | View ]
              • 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.
                [ Reply To This | View ]
                • 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 )

  "Time for a make-it-cool branch?" -- Simon Hausmann
KDE®, "K Desktop Environment", "KDE Dot News", "got the dot?" and the KDE Logo® are trademarks or registered trademarks of KDE e.V. in the European Union, the United States and other countries. All other trademarks and copyrights on this page are owned by their respective owners. Comments are owned by the poster. The rest: Copyright © 2000-2008 KDE e.V. for The KDE Project. For further information or comments on this site, please contact the Webmaster.
[ home | post article | flat forty | subscribe | search | rdf ]