Add a conversion function from a
PropertyMap to a VariantMap using the property name.
Will be used by baloo-widgets.
Depends on D19097
Details
Diff Detail
- Repository
- R286 KFileMetaData
- Branch
- named_map_conversion
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 8442 Build 8460: arc lint + arc unit
It already does at two different places, because it fuses different information into a single QMap later on (xattr, file size etc...)
https://phabricator.kde.org/source/baloo-widgets/browse/master/src/extractor.cpp$65
https://phabricator.kde.org/source/baloo-widgets/browse/master/src/filefetchjob.cpp$62
I would like to consolidate the two different implementations of the conversion functions. I think it is also useful for debugging purposes, e.g. dumping a property map to cmd line.
This can be done by using a KFM::PropertyMap directly, and adding property types for the UserMetaData (tags, comment, rating). Note, the strings returned by PropertyInfo::name() are not shared ...
I would like to consolidate the two different implementations of the conversion functions. I think it is also useful for debugging purposes, e.g. dumping a property map to cmd line.
The latter can be achieved by making KFM::Property known to QDebug.
It is not only xattr, also everything from kfileitems{group,size,owner...}. Adding these as property with no users in KFileMetaData does not seem clean.
Also, you would have to construct the properties from the name. Why not use the names directly then? Changing everything to a PropertyMap requires a rewrite of large parts, and I certainly will not rewrite baloo-widgets right now.
This is just for a small cleanup.
It is also not clean to expose an interface in KFileMetaData which is only used by baloo-widgets, and internal to baloo-widgets. If you want to consolidate the implementations, combine the two implementations inside baloo-widgets.