On 22 December 2010 16:51, Jaroslaw Staniek <stan...@kde.org> wrote: > On 22 December 2010 16:05, Cyrille Berger Skott <cber...@cberger.net> wrote: >> Hi, >> >> For sake of clarity, since I haven't seen your commit (might just be lack of >> time ;P), I don't have an objection to this :) > > OK, I'll have to contribute then :)
OK, I am at point where something should be cleared up. We are using KMimeTypeTrader::query() to find app for given mimetype. What we need extra is a way to mark app service files like words.desktop as "calligra" apps, so they are selected instead of other apps, e.g. openoffice.org, that user probably set as default or that have higher priority. Marking the calligra apps avoids hardcoding this rule in the code. SOLUTION 1. One idea is to create a subtype of "Application" service type: [Desktop Entry] Type=ServiceType X-KDE-ServiceType=Calligra/Application X-KDE-Derived=Application Comment=Calligra Application For example, for an .odt file we have, trader->query(mimetype->name(), "Application") returns on my system: query for mimeType "application/vnd.oasis.opendocument.text" , "Application" : returning 22 offers - "OpenOffice.org Writer" - "Okular" - "OpenDocument format" - "AbiWord" - "Okular" - "Ark" - "ZIP archive plugin" - "ark_servicemenu" - "Archive Mounter" - "Ark Extract Here" - "encryptfile" - "preview" - "Kleopatra Sign/Encrypt Files" - "KHTML" - "Konqueror" - "WebKit" - "Embedded Advanced Text Editor" - "KWrite" - "Kate" - "Subversion" - "Emacs" - "Text Files" Then, I would expect that if we could simple execute: trader->query(mimetype->name(), "Calligra/Application"); this output: - "Words" This is clean way similar to how various servicetypes derive from KParts. But I see we cannot derive from the Application type. So I am requesting for comments, and CC'ing to dfaure ;) SOLUTION 2. We want to find preferred/default calligra app for any mimetype we support. So perhaps we need extra .desktop file, e.g. with: X-KDE-ServiceTypes=Calligra/Application MimeType=... (only default mimetypes here, unlike in the app.desktop files where all supported mimetypes are listed) This way, selection of calligra app per mimetype wont be random but well defined. E.g. we want to have .txt file opened in Words. Perhaps there's more simple solution? RFC. -- regards / pozdrawiam, Jaroslaw Staniek http://www.linkedin.com/in/jstaniek Kexi & Calligra (kexi-project.org, identi.ca/kexi, calligra-suite.org) KDE Software Development Platform on MS Windows (windows.kde.org) _______________________________________________ calligra-devel mailing list calligra-devel@kde.org https://mail.kde.org/mailman/listinfo/calligra-devel