+ // 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 current view mode.
+ const QString prefix = viewModePrefix();
+ const int prefixLength = prefix.length();
+
+ const QStringList visibleRoles = m_node->visibleRoles();
+ foreach (const QString& visibleRole, visibleRoles) {
+ if (visibleRole.startsWith(prefix)) {
+ const QByteArray role = visibleRole.right(visibleRole.length() - prefixLength).toLatin1();
+ if (role != "text") {
+ roles.append(role);
+ }
+ }
+ }