diff options
author | Simon Rettberg | 2019-07-04 15:02:44 +0200 |
---|---|---|
committer | Simon Rettberg | 2019-07-04 15:02:44 +0200 |
commit | 701ece32bb78a0de4be72144c197a52cbecbebdc (patch) | |
tree | 2e1b0c1e158cebdb3be978a93b400cc16d286ce4 | |
parent | Fix infinite loop if all three lists are empty (diff) | |
download | vmchooser2-701ece32bb78a0de4be72144c197a52cbecbebdc.tar.gz vmchooser2-701ece32bb78a0de4be72144c197a52cbecbebdc.tar.xz vmchooser2-701ece32bb78a0de4be72144c197a52cbecbebdc.zip |
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...
-rw-r--r-- | src/sessiontreemodel.cpp | 15 |
1 files 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<Session*>& 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; } } |