Results 1 to 5 of 5

Thread: MIME and .desktop files in KDE

  1. #1
    Join Date
    Mar 2006
    Posts
    172
    Thanks
    30
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Red face MIME and .desktop files in KDE

    Well I am slighlty (understatement ) confused between the use of mime types and .desktop files ...let me tell you w.r.t. KDE what i know.

    1. As per the standard, .desktop files are used to know which program is to be used to launch a particular file.

    2. We detect the MIME type of a file and then try to figure out which program to use to open a particular type of file - (Does KDE do this? How....is there a central database to refer? Like in GNOME there is an association-registry, a complete list of programs to use to open a particular type of file. A new application can "register" itself along with its associated files in this DB. How can one achieve the same in KDE?)

    Well, now the thing is this....if both of the above serve a similar purpose what is it that KDE does?

    -How does KDE know which program to associate with a particular type of file (MIME)? Then why the need of .desktop files?

    -we can check the file associations and the corresponding applications to use, in Yast>KDE Components>File Associations. Can I add my application's settings to this as well as retrieve the associations from my application? (from some file that is)

    also could you please tell me when and why should one use the following commands:

    desktop-file-install
    update-desktop-database
    update-mime-database

    -does KDE use these commands for the above mentioned scenario?

    ...well there are more doubts but will clarify them based on your answers

    Thanks

    Nupul.

    PS: please don't hastily reply saying look at the KDE sources...I have already done that, but sources help you understand the implementation, not the concept. I wish to understand the working and not it's underlying implementation.
    Last edited by nupul; 13th April 2006 at 07:32.

  2. #2
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: MIME and .desktop files in KDE

    A .desktop file is a general format used by both KDE and GNOME for various purposes. They're used in the menu, various icons on the desktop, etc. In the case of the trashcan, it says what what the item's URL is (trash:/), text encoding, icon to use, icon to use when empty, and the name of item is in a few dozen languges. Executable .desktop items will have an executable command and MIME type.

    Take a look at the KDE development pages for more information on this stuff. http://developer.kde.org/

  3. #3
    Join Date
    Mar 2006
    Posts
    172
    Thanks
    30
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Exclamation Re: MIME and .desktop files in KDE

    Quote Originally Posted by Brandybuck
    A .desktop file is a general format used by both KDE and GNOME for various purposes. They're used in the menu, various icons on the desktop, etc. In the case of the trashcan, it says what what the item's URL is (trash:/), text encoding, icon to use, icon to use when empty, and the name of item is in a few dozen languges. Executable
    Correct...I know and understand this bit well enough.

    .desktop items will have an executable command and MIME type.
    you have used a different term here .desktop items and above you say a .desktop file. What is the difference in their context?

    Yes, I am aware that the files have a MIME type...what i am not able to figure out is how does KDE come to know which program to launch for a particular MIME type? i.e who is responsible for setting the value of the "Exec" value in the .desktop file?

    Take a look at the KDE development pages for more information on this stuff. http://developer.kde.org/
    Thanks...you just reimbursed where i was sitting all day long (along with here too )

    Nupul

  4. #4
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: MIME and .desktop files in KDE

    Quote Originally Posted by nupul
    Yes, I am aware that the files have a MIME type...what i am not able to figure out is how does KDE come to know which program to launch for a particular MIME type?
    That I don't know. I always thought it was the files in the mimelnk directory, but now that I look at them, they don't specify which executable to use.

    Quote Originally Posted by nupul
    i.e who is responsible for setting the value of the "Exec" value in the .desktop file?
    If you're talking about the .desktop file that gets installed with a KDE application, then it's the developer. If you create a small sample application with kapptemplate, for example, it will include a template .desktop file for you to use. That should be enough for most applications. Beyond that I can't help you.

  5. #5
    Join Date
    Mar 2006
    Posts
    172
    Thanks
    30
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Wink Re: MIME and .desktop files in KDE

    Quote Originally Posted by Brandybuck
    If you're talking about the .desktop file that gets installed with a KDE application, then it's the developer. If you create a small sample application with kapptemplate, for example, it will include a template .desktop file for you to use. That should be enough for most applications.
    Well this is the exact answer I was looking for...thanks for endorsing it

    Beyond that I can't help you.
    You can...keep replying (to my posts ) whenever you know the answer

    If you wish, I can furnish you with the complete (almost ) answer if you wish...

    Thanks

    Nupul

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.