Skip to content

Fix crash when Tab is pressed at the last cell of a view's grid - #1289

Merged
MKleusberg merged 1 commit into
masterfrom
crash_insert_row_in_view
Jan 13, 2018
Merged

MKleusberg merged 1 commit into
masterfrom
crash_insert_row_in_view

Conversation

@mgrojo

@mgrojo mgrojo commented Jan 8, 2018

Copy link
Copy Markdown
Member

The crash is avoided if the table model is not editable, since insertRows
checks that. A table model for a DB view should be not editable, so this
fix avoids the crash and possibly other possible misbehaviours.

I open this pull request:

The crash is avoided if the table model is not editable, since insertRows
checks that. A table model for a DB view should be not editable, so this
fix avoids the crash and possibly other possible misbehaviours.
@justinclift

Copy link
Copy Markdown
Member

Good catch. Definitely a @MKleusberg thing for reviewing though, even though it's super simple. 😄

@MKleusberg

Copy link
Copy Markdown
Member

Thanks, @mgrojo, good catch! 😃 This looks like the correct way to fix this with no side-effects.

For #141 we will need a different approach than just reverting back. Actually view editing is already partly implemented and relies on the "Pseudo PK" setting (named like that for lack of a better term) in the SqliteTableModel class. So if the isEditable() function is called for a view, we need to check if there is a pseudo-PK before returning true.

But I will just merge this PR now and add the view bits in a second 😄

@MKleusberg
MKleusberg merged commit 512b694 into master Jan 13, 2018
@MKleusberg
MKleusberg deleted the crash_insert_row_in_view branch January 13, 2018 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants