+QStringList ViewProperties::convertAdditionalInfo()
+{
+ QStringList visibleRoles;
+
+ const QStringList additionalInfo = m_node->additionalInfo();
+ if (!additionalInfo.isEmpty()) {
+ // Convert the obsolete values like Icons_Size, Details_Date, ...
+ // to Icons_size, Details_date, ... where the suffix just represents
+ // the internal role. One special-case must be handled: "LinkDestination"
+ // has been used for "destination".
+ visibleRoles.reserve(additionalInfo.count());
+ foreach (const QString& info, additionalInfo) {
+ QString visibleRole = info;
+ int index = visibleRole.indexOf('_');
+ if (index >= 0 && index + 1 < visibleRole.length()) {
+ ++index;
+ if (visibleRole[index] == QLatin1Char('L')) {
+ visibleRole.replace("LinkDestination", "destination");
+ } else {
+ visibleRole[index] = visibleRole[index].toLower();
+ }
+ }
+ visibleRoles.append(visibleRole);
+ }
+ }
+
+ m_node->setAdditionalInfo(QStringList());
+ m_node->setVisibleRoles(visibleRoles);
+ update();
+
+ return visibleRoles;
+}
+
+QStringList ViewProperties::convertNameRole()
+{
+ QStringList visibleRoles = m_node->visibleRoles();
+ for (int i = 0; i < visibleRoles.count(); ++i) {
+ if (visibleRoles[i].endsWith("_name")) {
+ const int leftLength = visibleRoles[i].length() - 5;
+ visibleRoles[i] = visibleRoles[i].left(leftLength) + "_text";
+ }
+ }
+
+ m_node->setVisibleRoles(visibleRoles);
+ update();
+
+ return visibleRoles;
+}
+
+