Review Request 127912: Add 2 methods to gain more info about a mimetype or protocol

David Faure faure at kde.org
Sun May 22 17:21:00 UTC 2016



> On May 14, 2016, 1:59 p.m., David Faure wrote:
> > But how is the app supposed to then choose which protocol to use?
> > 
> > If it needs its own setting for the preferred kioslave, then what's the point of the query that returns a list?
> > 
> > In other words, if you know you want to prefer krarc, why not just query whether krarc is available and use it if yes?
> 
> Martin Kostolný wrote:
>     I'm sorry, it is very well possible that I don't know the required API for these queries. It is as You said: basically I need to test whether krarc:/ is available and I also need to test if given mimetype can be handled by krarc protocol. Is there a way to achieve that with current KIO API? Thanks!

To find if krarc is available, use KProtocolInfo::isKnownProtocol("krarc").

To find which archive mimetypes "krarc" can support, hmm, there was no API for it, so I just added it. KProtocolInfo::archiveMimeTypes("krarc"), requires KF 5.23 (released next month).
See http://commits.kde.org/kio/a60c6c437067c9daa2b5bbe6638ba4080342dacf


- David


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/127912/#review95467
-----------------------------------------------------------


On May 14, 2016, 11:38 a.m., Martin Kostolný wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/127912/
> -----------------------------------------------------------
> 
> (Updated May 14, 2016, 11:38 a.m.)
> 
> 
> Review request for KDE Frameworks, Krusader, David Edmundson, David Faure, and Marco Martin.
> 
> 
> Repository: kio
> 
> 
> Description
> -------
> 
> KProtocolManager has a method called protocolForArchiveMimetype. It gives one protocol for given mimetype even if there exist more then one protocol capable of handling this mimetype.
> 
> I suggest adding a method called protocolsForArchiveMimetype (note the "s") which would give us all protocols that can handle given mimetype. I also suggest to add a method for giving all archive mimetypes for given protocol.
> 
> This request is based on a potential need of some apps to prioritize one protocol over others (specifically krarc:/ from Krusader over other archive-handling protocols).
> 
> 
> Diffs
> -----
> 
>   src/core/kprotocolmanager.h 13b8c07 
>   src/core/kprotocolmanager.cpp 9a0a96f 
> 
> Diff: https://git.reviewboard.kde.org/r/127912/diff/
> 
> 
> Testing
> -------
> 
> I've tested both methods through Krusader code. Partially covered in this phabricator task: https://phabricator.kde.org/T2401
> 
> 
> Thanks,
> 
> Martin Kostolný
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20160522/5b98033e/attachment.html>


More information about the Kde-frameworks-devel mailing list