mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix crash at startup
Not sure this is the right fix, but at least it doesn't crash any more. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
0d1da0563b
commit
434e7a6a71
1 changed files with 13 additions and 8 deletions
|
@ -2176,11 +2176,15 @@ bool TagFilterSortModel::filterAcceptsRow(int source_row, const QModelIndex &sou
|
||||||
struct tag_entry *head = d->tag_list;
|
struct tag_entry *head = d->tag_list;
|
||||||
|
|
||||||
if (!head) { // last tag means "Show empty tags";
|
if (!head) { // last tag means "Show empty tags";
|
||||||
|
if (TagFilterModel::instance()->rowCount() > 0)
|
||||||
return TagFilterModel::instance()->checkState[TagFilterModel::instance()->rowCount() - 1];
|
return TagFilterModel::instance()->checkState[TagFilterModel::instance()->rowCount() - 1];
|
||||||
|
else
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// have at least one tag.
|
// have at least one tag.
|
||||||
QStringList tagList = TagFilterModel::instance()->stringList();
|
QStringList tagList = TagFilterModel::instance()->stringList();
|
||||||
|
if (!tagList.isEmpty()) {
|
||||||
tagList.removeLast(); // remove the "Show Empty Tags";
|
tagList.removeLast(); // remove the "Show Empty Tags";
|
||||||
while (head) {
|
while (head) {
|
||||||
QString tagName(head->tag->name);
|
QString tagName(head->tag->name);
|
||||||
|
@ -2189,5 +2193,6 @@ bool TagFilterSortModel::filterAcceptsRow(int source_row, const QModelIndex &sou
|
||||||
return true;
|
return true;
|
||||||
head = head->next;
|
head = head->next;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue