Review Request 121672: Properly convert .desktop files that have an associated servicetype

David Faure faure at kde.org
Sun Dec 28 15:58:14 UTC 2014



> On Dec. 28, 2014, 12:19 p.m., David Faure wrote:
> > Ouch.
> > 
> > This information *is* available, in the servicetype definition file. Why not try and read it from there?
> 
> Alex Richardson wrote:
>     Well, it only works once these files are installed. This is probably not be the case when running kcoreaddons_desktop_to_json(). I agree it could be done when creating a KPluginMetaData instance from a .desktop file, but that would be very slow since we would need to parse all the service types. Otherwise we need to do some caching again...

I see.

A random thought: passing the path to the servicetype desktop file to kcoreaddons_desktop_to_json()?
(could be either using ${CMAKE_CURRENT_SOURCE_DIR} if it's from the same repo, or an installed path using ${CMAKE_INSTALL_FULL_KSERVICETYPES5DIR})

(the latter wouldn't work when installing an app into a different prefix than the thing that installs the servicetype file, so maybe a proper lookup is needed, using QStandardPaths::locate in the C++ tool)


- David


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


On Dec. 26, 2014, 5:21 p.m., Alex Richardson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/121672/
> -----------------------------------------------------------
> 
> (Updated Dec. 26, 2014, 5:21 p.m.)
> 
> 
> Review request for KDE Frameworks.
> 
> 
> Repository: kcoreaddons
> 
> 
> Description
> -------
> 
> This ensures that properties that are defined to be of type QStringList
> or int or bool are properly converted to the right JSON type.
> 
> Not sure if this code should also be part of KF5CoreAddons.so, since it
> does increase the library size quite a bit. It would however be very
> useful for kcoreaddons_desktop_to_json(), so that the initial conversion
> to JSON does not have to be done by hand.
> 
> I probably don't have all the service types that exist installed on my
> system so I might be missing some properties. I included the script to
> generate the list of these properties, so that missing properties can
> be added by anyone who has the required servicetypes/*.desktop files
> installed.
> 
> 
> Diffs
> -----
> 
>   src/lib/plugin/read-servicetypes.py PRE-CREATION 
>   autotests/desktoptojsontest.cpp 64373d5be930426dd8a1f8e455e33c411a4795fd 
>   src/lib/plugin/desktopfileparser.cpp b1b5440b48e4fd412932a7d7e794d641b1406699 
> 
> Diff: https://git.reviewboard.kde.org/r/121672/diff/
> 
> 
> Testing
> -------
> 
> Unit test works
> 
> 
> Thanks,
> 
> Alex Richardson
> 
>

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


More information about the Kde-frameworks-devel mailing list