In the dolphin information panel, the condensed date format was not being applied to metadata file properties (i.e EXIF), only to those related to file itself (modified/accessed/..)
BEFORE:
AFTER:
BUG: 406832
elvisangelaccio | |
bruns | |
meven | |
ngraham |
Dolphin |
In the dolphin information panel, the condensed date format was not being applied to metadata file properties (i.e EXIF), only to those related to file itself (modified/accessed/..)
BEFORE:
BUG: 406832
No Linters Available |
No Unit Test Coverage |
Buildable 15831 | |
Build 15849: arc lint + arc unit |
src/widgetfactory.cpp | ||
---|---|---|
170 | It seems to me extending toString function to support DateTime and Date QVariant type and use formatDateTime there, would allow to make the code leaner, instead of extending here if/else cascade here. |
I agree with you both, but I found some problems on that path.
The main issue is that KFileMatada returns a function pointer which relies on a static funtion, with the date format harcoded to LongFormat. I tried to inject the user chosen m_dateFormat but it required adding a new member variable in it, breaking some of its internal logic, and overloading the static function to accept the dateFormat parameter. And in the end, the dates provided by KFM (which go through the second branch) and the ones on the last branch would follow a different path.
Anyway, I've tried to simplify the code reducing the if-chain, and moving the particular datetime formatting away. It works ok for the "file" properties which have a type of QVariant::DateTime. But for the KFM propertys, altough pi.type() is QVariant::DateTime, the value itself is QVariant::String, so it doesn't behave well with the type selector in toString(), and I need to keep the condition.
src/widgetfactory.cpp | ||
---|---|---|
81 | Could you make formatDateTime and toString private member function to avoid passing around dateFormat but instead use m_dateFormat directly ? |
On the other hand, @bruns asked you not to add a member function before.
It is already nice.
Please wait for @elvisangelaccio review before merging, I am not the maintainer.