- KFileItemDelegate::InformationList usedInfos;
-
- const int decodedInfo = decodedAdditionalInfo();
-
- AdditionalInfoAccessor& infoAccessor = AdditionalInfoAccessor::instance();
- const KFileItemDelegate::InformationList infos = infoAccessor.keys();
+ // The shown additional information is stored for each view-mode separately as
+ // string with the view-mode as prefix. Example:
+ //
+ // AdditionalInfo=Details_Size,Details_Date,Details_Owner,Icon_Size
+ //
+ // To get the representation as QList<DolphinView::AdditionalInfo>, the current
+ // view-mode must be checked and the values of this mode added to the list.
+ //
+ // For the details-view a special case must be respected: Per default the size
+ // and date should be shown without creating a .directory file. Only if
+ // the user explictly has modified the properties of the details view (marked
+ // by "CustomizedDetails"), also a details-view with no additional information
+ // is accepted.
+
+ QList<DolphinView::AdditionalInfo> usedInfo;
+
+ // infoHash allows to get the mapped DolphinView::AdditionalInfo value
+ // for a stored string-value in a fast way
+ static QHash<QString, DolphinView::AdditionalInfo> infoHash;
+ if (infoHash.isEmpty()) {
+ AdditionalInfoAccessor& infoAccessor = AdditionalInfoAccessor::instance();
+ const QList<DolphinView::AdditionalInfo> keys = infoAccessor.keys();
+ foreach (DolphinView::AdditionalInfo key, keys) {
+ infoHash.insert(infoAccessor.value(key), key);
+ }
+ }