#endif
QList<KFileItemModel::RoleInfo> rolesInfo = KFileItemModel::rolesInformation();
- // Unlike sorting, grouping is optional. If creating for group_by_, include a None role.
- if (isGroupGroup)
- rolesInfo.append(KFileItemModel::roleInformation(nullptr));
+ if (isGroupGroup) {
+ rolesInfo += KFileItemModel::extraGroupingInformation();
+ }
for (const KFileItemModel::RoleInfo &info : rolesInfo) {
if (!isSortGroup && !isGroupGroup && info.role == "text") {
ascending->setText(i18nc("Group ascending", "Ascending"));
}
+ // Disable group order selector if grouping behavior does not support it
+ if (role == "none" || role == "followSort") {
+ descending->setEnabled(false);
+ ascending->setEnabled(false);
+ } else {
+ descending->setEnabled(true);
+ ascending->setEnabled(true);
+ }
+
slotGroupOrderChanged(m_currentView->groupOrder());
}