Review Request 125527: Add mimeTypes() to KPluginMetaData

Alex Richardson arichardson.kde at gmail.com
Sat Nov 28 19:46:16 UTC 2015



> On Nov. 28, 2015, 7:10 p.m., Jarosław Staniek wrote:
> > Hi, I see one regression. 
> > Before this change I had "MimeType" field. And I've been using this field.
> > 
> > Now I miss miss this field and have "KPlugin/MimeTypes" field. This means plugin error if KF5 5.16.x is installed. I cannot fix my sources: if I do users of KF5 <= 5.15.x will get equivalent error.

Hmm I hadn't thought of that. Sorry for causing a regression. I assume you are using kcoreaddons_desktop_to_json() to generate the JSON file otherwise this issue shouldn't appear

I see a few ways of working around this in the sources:

- Depend on KF >= 5.16 (easiest but unlikely to be possible)
- Change MimeType= into X-MyApp-MimeType= and then read that field
- You could use JSON files directly instead of .desktop files
    - a) add the MimeType string to the root object
    - b) use the 5.16 JSON with a string list and use KPluginMetaData::readStringList(rawData()["KPlugin"], QStringLiteral("MimeTypes")); for KF <= 5.16


- Alex


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


On Oct. 6, 2015, 12:42 p.m., Alex Richardson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/125527/
> -----------------------------------------------------------
> 
> (Updated Oct. 6, 2015, 12:42 p.m.)
> 
> 
> Review request for KDE Frameworks, David Faure and Sebastian Kügler.
> 
> 
> Repository: kcoreaddons
> 
> 
> Description
> -------
> 
> When loading a .desktop file this will parse the XDG MimeType= key
> 
> Contrary to KService we don't merge these with ServiceTypes but rather
> have them as a separate property.
> 
> REVIEW: 125261
> 
> KPluginMetaData: Warn when a list entry is not a JSON list
> 
> We still convert single values to a list with one entry but now also
> output a warning.
> 
> REVIEW: 125261
> 
> 
> Diffs
> -----
> 
>   autotests/data/fakeplugin.desktop 30ff9a98d4587507620f70e3c271456877ab1812 
>   autotests/kpluginmetadatatest.cpp 3af5e1b842b0bc231a5ac001112e141f751d2ff5 
>   src/lib/plugin/desktopfileparser.h 98d47ddf0f877c4a25928026b3d5fe169cfc9e75 
>   src/lib/plugin/desktopfileparser.cpp 0b03eb154deb58840c91c12658780c0d492b593c 
>   src/lib/plugin/kpluginmetadata.h 183b0d0583259f7ed74e97858a68c5c388fd0a9a 
>   src/lib/plugin/kpluginmetadata.cpp b13d6dd52827cc03d9473600aa4d2bab8a95a1d4 
> 
> Diff: https://git.reviewboard.kde.org/r/125527/diff/
> 
> 
> Testing
> -------
> 
> This is the same as review 125261 but for some reason I kept getting a internal server error when I tried to update it.
> 
> 
> Used this for a WIP port of Okular to new Plugin loading. Could also be used by KDevelop instead of the custom X-KDevelop-SupportedMimeTypes property
> 
> Requires https://git.reviewboard.kde.org/r/125263/ to ensure that there are no regressions
> 
> 
> Thanks,
> 
> Alex Richardson
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20151128/10c4b2dd/attachment.html>


More information about the Kde-frameworks-devel mailing list