summary refs log tree commit diff
path: root/src/timeline/TimelineModel.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2023-06-22 19:54:17 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2023-08-25 19:03:10 +0200
commit4d8b8c3b816528ece6274bac97d30905f77aabfb (patch)
tree44948aeab0dbab56b46a7205edcfb3003ccad3b8 /src/timeline/TimelineModel.cpp
parentMerge pull request #1536 from Nheko-Reborn/issue1440 (diff)
downloadnheko-4d8b8c3b816528ece6274bac97d30905f77aabfb.tar.xz
Create an EventDelegateChooser
Diffstat (limited to 'src/timeline/TimelineModel.cpp')
-rw-r--r--src/timeline/TimelineModel.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp
index b2a036c5..69ab3f5a 100644
--- a/src/timeline/TimelineModel.cpp
+++ b/src/timeline/TimelineModel.cpp
@@ -926,6 +926,26 @@ TimelineModel::multiData(const QModelIndex &index, QModelRoleDataSpan roleDataSp
     }
 }
 
+void
+TimelineModel::multiData(const QString &id,
+                         const QString &relatedTo,
+                         QModelRoleDataSpan roleDataSpan) const
+{
+    if (id.isEmpty())
+        return;
+
+    auto event = events.get(id.toStdString(), relatedTo.toStdString());
+
+    if (!event)
+        return;
+
+    for (QModelRoleData &roleData : roleDataSpan) {
+        int role = roleData.role();
+
+        roleData.setData(data(*event, role));
+    }
+}
+
 QVariant
 TimelineModel::dataById(const QString &id, int role, const QString &relatedTo)
 {