┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views/dolphinview.h
diff options
context:
space:
mode:
authorRamil Nurmanov <[email protected]>2026-06-05 00:06:12 +0400
committerRamil Nurmanov <[email protected]>2026-06-11 14:30:18 +0400
commit989c0f4f0319f7d8e573c8a88fe8011bd3315466 (patch)
tree2cecdf3bed6375269e4d9b6948ebc4c34918988d /src/views/dolphinview.h
parent6eed05fd769b01c37530b8b62cdcd65933ea8d14 (diff)
Allow grouping by a separate criterion
Add an explicit group role to Dolphin views so items can be grouped independently from the active sort role. Previously, Dolphin's grouped view always used the current sort role as the grouping criterion. This meant that grouping and sorting were tied together, for example grouping by type also required sorting by type. This change adds a separate Group By menu. It replaces the previous Show in Groups toggle and allows the user to disable grouping, keep the old Same as Sort behavior, or explicitly group by a selected criterion. When an explicit group role is set, the model keeps groups stable and uses the normal sort role as a secondary key inside each group. The roles updater also receives the active group role, so roles used only for grouping are still updated correctly. BUG: 416134 CCBUG: 510670 CCBUG: 513235 CCBUG: 46393
Diffstat (limited to 'src/views/dolphinview.h')
-rw-r--r--src/views/dolphinview.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/views/dolphinview.h b/src/views/dolphinview.h
index 35276f9ac..b0ab6ab6a 100644
--- a/src/views/dolphinview.h
+++ b/src/views/dolphinview.h
@@ -218,6 +218,10 @@ public:
void setSortRole(const QByteArray &role);
QByteArray sortRole() const;
+ void setGroupRole(const QByteArray &role);
+ QByteArray groupRole() const;
+ QByteArray rawGroupRole() const;
+
/**
* Updates the view properties of the current URL to the
* sort order given by \a order.
@@ -578,6 +582,12 @@ Q_SIGNALS:
/** Is emitted if the sorting by name, size or date has been changed. */
void sortRoleChanged(const QByteArray &role);
+ /**
+ * Is emitted when the explicit group role changes. Passes the raw role —
+ * an empty byte array means grouping follows the sort role (see rawGroupRole()).
+ */
+ void groupRoleChanged(const QByteArray &role);
+
/** Is emitted if the sort order (ascending or descending) has been changed. */
void sortOrderChanged(Qt::SortOrder order);