Review Request 121737: KPluginInfo: Fix properties not being copied from KService::Ptr

Alex Richardson arichardson.kde at gmail.com
Mon Dec 29 19:20:07 UTC 2014



> On Dez. 29, 2014, 5:56 nachm., David Faure wrote:
> > propertyNames() includes the common stuff like Name, Comment, etc.
> > 
> > So maybe this removes the need for the code that follows? Or at least a good part of it?
> 
> Alex Richardson wrote:
>     Yeah we probably don't want those properties, do you think letting KPluginInfo access the QVariantMap in KServicePrivate is a better idea?
>     
>     I.e. `json = QJsonObject::fromVariantMap(service->d->m_mapProps)`
>     
>     That would be more efficient and skip all those standard .desktop properties.
> 
> David Faure wrote:
>     Ah, hmm, not exactly what I meant :-)
>     
>     Are you sure you don't want stuff like "Keywords"? What if someone wants to find KCMs that have certain keywords, shouldn't that be in the json file?
>     
>     Or "MimeTypes", for the same reason?
>     Or "Icon", to display per-plugin icons without loading them? (e.g. in the plugin selector)
>     
>     I'm surprised by the idea of having only Name, Comment, ServiceType, and custom properties, but not some of the other standard stuff above.
>     
>     But maybe I'm missing some context.

Ah yes, I didn't look properly, there are a lot more properties in KServicePrivate that are not stored in the map.
These should definitively also be converted. Maybe the easiest solution is to just pass the .desktop file to the KPluginMetaData constructor which then rereads all the properties.
Less efficient, but the constructor is deprecated anyway.


- Alex


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


On Dez. 29, 2014, 5:51 nachm., Alex Richardson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/121737/
> -----------------------------------------------------------
> 
> (Updated Dez. 29, 2014, 5:51 nachm.)
> 
> 
> Review request for KDE Frameworks and David Faure.
> 
> 
> Repository: kservice
> 
> 
> Description
> -------
> 
> This should fix property() returning empty QVariants even if it
> existed in the .desktop file
> 
> 
> Diffs
> -----
> 
>   src/services/kplugininfo.cpp aa5d26386eb17a7e552b29c8fa66667961d68b16 
> 
> Diff: https://git.reviewboard.kde.org/r/121737/diff/
> 
> 
> Testing
> -------
> 
> KDED now correctly reads X-Kded-* in https://git.reviewboard.kde.org/r/121315/ instead of reading the default value.
> 
> 
> Thanks,
> 
> Alex Richardson
> 
>

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


More information about the Kde-frameworks-devel mailing list