New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Jan 13, 2018

Conversation

Projects
None yet
3 participants
@mgrojo
Copy link
Contributor

mgrojo commented Jan 8, 2018

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:

  • May have this any side effect?
  • How would interact with a future implementation of #141. Probably it should be reverted back to the original version.
Fix crash when Tab is pressed at the last cell of a view's grid
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

This comment has been minimized.

Copy link
Member

justinclift commented Jan 8, 2018

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

@MKleusberg

This comment has been minimized.

Copy link
Member

MKleusberg commented Jan 13, 2018

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

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@MKleusberg MKleusberg deleted the crash_insert_row_in_view branch Jan 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment