Fix a crash that may happen during initial loading in certain circumstances
This commit is contained in:
parent
a0b76f7d74
commit
ce151b3cff
@ -31,11 +31,14 @@
|
|||||||
#ifndef THINGS_H
|
#ifndef THINGS_H
|
||||||
#define THINGS_H
|
#define THINGS_H
|
||||||
|
|
||||||
#include <QAbstractListModel>
|
|
||||||
|
|
||||||
#include "types/thing.h"
|
#include "types/thing.h"
|
||||||
#include "types/thingclass.h"
|
#include "types/thingclass.h"
|
||||||
|
|
||||||
|
#include <QAbstractListModel>
|
||||||
|
#include <QLoggingCategory>
|
||||||
|
|
||||||
|
Q_DECLARE_LOGGING_CATEGORY(dcThingManager)
|
||||||
|
|
||||||
class Things : public QAbstractListModel
|
class Things : public QAbstractListModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|||||||
@ -583,6 +583,10 @@ bool ThingsProxy::lessThan(const QModelIndex &left, const QModelIndex &right) co
|
|||||||
bool ThingsProxy::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
|
bool ThingsProxy::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
|
||||||
{
|
{
|
||||||
Thing *thing = getInternal(source_row);
|
Thing *thing = getInternal(source_row);
|
||||||
|
if (!thing) {
|
||||||
|
qCWarning(dcThingManager()) << "filterAcceptsRow called for a source row we can't find in the source model!";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (!m_filterTagId.isEmpty()) {
|
if (!m_filterTagId.isEmpty()) {
|
||||||
Tag *tag = m_engine->tagsManager()->tags()->findThingTag(thing->id().toString(), m_filterTagId);
|
Tag *tag = m_engine->tagsManager()->tags()->findThingTag(thing->id().toString(), m_filterTagId);
|
||||||
if (!tag) {
|
if (!tag) {
|
||||||
|
|||||||
Reference in New Issue
Block a user