mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 11:00:44 -06:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user