sqlitetablemodel: Don't insert new rows when there is no new data

When not getting any data from query we'd tell Qt that we're about to
insert data anyway and cause confusion this way. At least this might
cause some trouble on some systems.

This issue tries to deal with issue #565.
This commit is contained in:
Martin Kleusberg
2016-04-23 20:55:08 +02:00
parent c8f020331a
commit 730a272454

View File

@@ -478,8 +478,12 @@ void SqliteTableModel::fetchData(unsigned int from, unsigned to)
}
sqlite3_finalize(stmt);
beginInsertRows(QModelIndex(), currentsize, m_data.size()-1);
endInsertRows();
// Check if there was any new data
if(m_data.size() > currentsize)
{
beginInsertRows(QModelIndex(), currentsize, m_data.size()-1);
endInsertRows();
}
}
void SqliteTableModel::buildQuery()