From 701ece32bb78a0de4be72144c197a52cbecbebdc Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 4 Jul 2019 15:02:44 +0200 Subject: Give 'last lectures' a section as it's expected everywhere A lot of code gets confused if there are no sections in the tree view but instead, sessions are directly attached to root. This is the easy fix for now... --- src/sessiontreemodel.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/sessiontreemodel.cpp b/src/sessiontreemodel.cpp index 6861158..4c41d80 100644 --- a/src/sessiontreemodel.cpp +++ b/src/sessiontreemodel.cpp @@ -131,14 +131,13 @@ void SessionTreeModel::addItems(const QList& sessions) { SectionType section = s->section(); if (ignoreSections_) { - parentItem = root_; - } else { - for (int i = 0; i < root_->childCount(); ++i) { - SessionTreeItem* item = root_->child(i); - if (item->sectionType() == section) { - parentItem = item; - break; - } + section = SECTION_GENERIC; + } + for (int i = 0; i < root_->childCount(); ++i) { + SessionTreeItem* item = root_->child(i); + if (item->sectionType() == section) { + parentItem = item; + break; } } -- cgit v1.2.3-55-g7522