- KFileItemDelegate::InformationList usedInfos;
-
- const int decodedInfo = decodedAdditionalInfo();
-
- AdditionalInfoAccessor& infoAccessor = AdditionalInfoAccessor::instance();
- const KFileItemDelegate::InformationList infoKeys = 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,Icons_size
+ //
+ // To get the representation as QList<QByteArray>, 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<QByteArray> roles;
+ roles.append("text");
+
+ // Iterate through all stored keys and append all roles that match to
+ // the curren view mode.
+ const QString prefix = viewModePrefix();
+ const int prefixLength = prefix.length();
+
+ QStringList visibleRoles = m_node->visibleRoles();
+ const int version = m_node->version();
+ if (visibleRoles.isEmpty() && version <= AdditionalInfoViewPropertiesVersion) {
+ // Convert the obsolete additionalInfo-property from older versions into the
+ // visibleRoles-property
+ visibleRoles = const_cast<ViewProperties*>(this)->convertAdditionalInfo();
+ } else if (version <= NameRolePropertiesVersion) {
+ visibleRoles = const_cast<ViewProperties*>(this)->convertNameRole();
+ }