Bug 398581

Summary: Add ability for extractor to add display text
Product: [Frameworks and Libraries] frameworks-kfilemetadata Reporter: Kai Uwe Broulik <kde>
Component: generalAssignee: Pinak Ahuja <pinak.ahuja>
Status: RESOLVED FIXED    
Severity: wishlist CC: nate
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Kai Uwe Broulik 2018-09-13 15:13:00 UTC
There are plenty of properties that are enums, e.g. "Image Orientation", "Photo Flash", and others.

Currently there is no way for the UI (e.g. FileMetadataWidget) to make sense of those numbers, and they really shouldn't have to. 

This manifests in "Photo Flash: 24" (meaning Flash was on auto but didn't fire, compare to what Gwenview displays here)

There should be a displayText (like there is displayName) property on for custom types, so that not every user of KFileMetadata has to manually add custom formatting to e.g. "bitRatew", "releaseYear", and stuff like Exif information.
Comment 1 Alexander Stippich 2019-02-10 17:35:55 UTC
Git commit 4bedfd6609c6efe5dc327d305feac8985d4658e3 by Alexander Stippich.
Committed on 10/02/2019 at 17:35.
Pushed by astippich into branch 'master'.

Add string formatting function to property info

Summary:
Adds the ability to format the metadata value
for displaying purposes individually for each
property. Currently, users of KFileMetaData
must implement their own custom formatting
functions.
All custom formatting functions from
Baloo-Widgets and Dolphin are copied into
KFileMetaData. This can be extended later.

This adds a dependency on KCoreAddons to
KFileMetaData.

Test Plan: tests pass

Reviewers: broulik, bruns, mgallien, #frameworks

Reviewed By: bruns

Subscribers: ngraham, kde-frameworks-devel, #baloo

Tags: #frameworks, #baloo

Differential Revision: https://phabricator.kde.org/D17245

M  +5    -0    CMakeLists.txt
M  +29   -0    autotests/propertyinfotest.cpp
M  +1    -0    autotests/propertyinfotest.h
M  +2    -0    src/CMakeLists.txt
A  +86   -0    src/formatstrings.cpp     [License: LGPL (v2.1+)]
C  +23   -10   src/formatstrings_p.h [from: autotests/propertyinfotest.h - 053% similarity]
M  +27   -0    src/propertyinfo.cpp
M  +7    -0    src/propertyinfo.h

https://commits.kde.org/kfilemetadata/4bedfd6609c6efe5dc327d305feac8985d4658e3