D23475: [baloo-widgets] Apply condensed date to file metadata properties

Ismael Asensio noreply at phabricator.kde.org
Thu Aug 29 19:58:40 BST 2019


iasensio added a comment.


  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.

REPOSITORY
  R824 Baloo Widgets

REVISION DETAIL
  https://phabricator.kde.org/D23475

To: iasensio, #dolphin, elvisangelaccio, bruns
Cc: meven, ngraham, bruns, #baloo, vmarinescu, fprice, MrPepe, fbampaloukas, alexde, Codezela, feverfew, domson, ashaposhnikov, astippich, spoorun, navarromorales, firef, andrebarros, emmanuelp, mikesomov, abrahams
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20190829/20ad592e/attachment.htm>


More information about the kfm-devel mailing list