KDE Associations

General
2009-06-30
2013-04-10
  • sysyphus jones

    sysyphus jones - 2009-06-30

    How does notecase decide which application to open a link with under KDE?

    I have okular set up as the default for PDF files yet when I click on such a link in notecase it uses evince instead.

    CHM should open with the default I've set up (kchmviewer) yet notecase doesn't seem to want to do anything when clicking on such a link.

    I've also modified /etc/mailcap to agree with these associations but notecase doesn't seem to reference this either...

    My system is ubuntu 9.04 (so was originally gnome), then KDE 4.2 was installed, in case this has any relevance.

    Hope someone has solved this problem and is willing to share ...

     
    • Miroslav Rajcic

      Miroslav Rajcic - 2009-06-30

      Default build of Notecase uses GnomeVfs library to "guess" what program it needs to open for some document file name.
      GnomeVfs uses a MIME database to register programs that handle the different types of file formats.

      My guess is that KDE uses some alternative MIME database in parallel.

      BTW, Notecase uses /etc/mailcap only when explicitely compiled without GnomeVfs support.

      What you need is to register kchmviewer as the .pdf application under Gnome, and then switch back to KDE.
      That's my guess.

      Hope that will help.

      Regards,
        Miroslav

       
      • sysyphus jones

        sysyphus jones - 2009-07-01

        Thanks for the reply.

        Oddly, I find Gnome already had okular associated with pdf and kchmviewer wtth chm.

        Opening these file-types from the gnome desktop works as expected, but notecase -- whether under gnome or kde -- seems to be unaware of the changed associations.

        Notecase is by no means the only app that behaves like this: firefox is an obvious example that seems to be picking up association information from "somewhere else".

         
        • Miroslav Rajcic

          Miroslav Rajcic - 2009-07-02

          It is likely that "somewhere else" mechanism also exist, Linux is so fragmented these days.

          You might want to copy the way Notecase registers itself to handle .ncd file format:
          1. Copy notecase.xml to /usr/share/mime/packages/
          2. Call: "/usr/bin/update-mime-database /usr/share/mime"
          3  Call: "/usr/bin/update-desktop-database"

          If you create as similar .xml file (you can find notecase.xml in the source code archive, "docs" directory) to register some other app as a handler for HTML documents, that should do the trick.
          If I remember correctl, MIME for HTML format is "text/html"

          Hopefully this will help.

           
          • sysyphus jones

            sysyphus jones - 2009-07-05

            thanks for the insights Miro

            Getting all philosophical for a moment... :)

            ... It's a bit sad isn't it, that kde and gnome don't seem to want to play nice? This sort of not-invented-here mentality is something I've often noticed with proprietary software but it's a bit disappointing  to see the open source community are not immune to it either...

            Then again perhaps they DO play nice, and there is something wrong on my system that really explains this problem...

            If I do sort it out I'll post my findings back to this thread at some point

            Regards and thanks again,

            SJ

             
            • Miroslav Rajcic

              Miroslav Rajcic - 2009-07-06

              Good luck :)

               
    • sysyphus jones

      sysyphus jones - 2009-07-24

      well "somewhere else" seems to be  /usr/share/applications/defaults.list  ...

      To fix, I modified this (as root), eg for pdf, change the line:
              application/pdf=evince.desktop
          to:
              application/pdf=okular.desktop

          for chm:
              application/x-chm=kchmviewer.desktop
          for cbz:
              application/x-cbz=qcomicbook.desktop
          etc ...

      Now in  /usr/share/applications (still as root) I added the missing .desktop files.
      I did this by making copies of evince.desktop and modifying accordingly in a text editor -- eg for pdf, I replaced all instances of "evince" with "okular" and change the MimeType line to read just:

          MimeType=application/pdf

      I know this is crude but it seems to work (!)

      Now notecase opens links with the associations I wanted! Also, similar issues with the likes of gnome-commander and thumar have been fixed and (so far) it doesn't seem to have broken anything ...

      This was with kubuntu 9.04 and gnome desktop installed subsequently, and these mods were made after setting associations in nautilus, (which worked in nautilus but not in notecase) and also updating /etc/mailcap which also seemed to have no effect in the various apps I was trying.

      Mileage , I suspect, may vary...

       
      • Miroslav Rajcic

        Miroslav Rajcic - 2009-07-24

        Thanks, this will surely be useful to other folks.

         

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks