Minor fixes to various models
This commit is contained in:
committed by
Tobias Fella
parent
45cee495a5
commit
96d24f5c3a
@@ -75,7 +75,7 @@ QVariant MediaMessageFilterModel::data(const QModelIndex &index, int role) const
|
||||
|
||||
QHash<int, QByteArray> MediaMessageFilterModel::roleNames() const
|
||||
{
|
||||
auto roles = sourceModel()->roleNames();
|
||||
auto roles = sourceModel() ? sourceModel()->roleNames() : QHash<int, QByteArray>();
|
||||
roles[SourceRole] = "source";
|
||||
roles[TempSourceRole] = "tempSource";
|
||||
roles[TypeRole] = "type";
|
||||
|
||||
@@ -23,7 +23,10 @@ void SearchModel::setSearchText(const QString &searchText)
|
||||
|
||||
void SearchModel::search()
|
||||
{
|
||||
Q_ASSERT(m_room);
|
||||
if (!m_room) {
|
||||
qWarning() << "SearchModel: No room";
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_job) {
|
||||
m_job->abandon();
|
||||
|
||||
Reference in New Issue
Block a user