Skip to content
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

Minor fix Qt TAB order warning #1261

Conversation

gonzalo-bulnes
Copy link
Contributor

@gonzalo-bulnes gonzalo-bulnes commented May 30, 2021

Description

Summary: Prevents a Qt warning from being printed to stderr when selecting each source from the list of sources for the first time. As far as I can tell, the TAB order was properly applied anyway, but it was an opportunity for me to start reading Qt code.

Reproduction steps

  1. Checkout the main branch
  2. Run the client: ./run.sh
  3. Log in (for example as journalist)
  4. Select one or more sources from the list of sources
  5. Observe that the following warning is printed to stderr the first time each source is selected:
    QWidget::setTabOrder: 'first' and 'second' must be in the same window
    

Explanation

The TAB order only makes sense when two widgets belong to the same parent. Because QWidget::setTabOrder only receives the widgets themselves as parameters, it relies implicitly on the widgets having been previously added to a common parent.
In this case, that happens when both widgets are added to the replybox.

Test Plan

  • Cross-check that the TAB order is applied as expected
  • Verify that the warnings are indeed resolved

Checklist

If these changes modify code paths involving cryptography, the opening of files in VMs or network (via the RPC service) traffic, Qubes testing in the staging environment is required. For fine tuning of the graphical user interface, testing in any environment in Qubes is required. Please check as applicable:

  • I have tested these changes in the appropriate Qubes environment
  • I do not have an appropriate Qubes OS workstation set up (the reviewer will need to test these changes)
  • These changes should not need testing in Qubes

If these changes add or remove files other than client code, the AppArmor profile may need to be updated. Please check as applicable:

  • I have updated the AppArmor profile
  • No update to the AppArmor profile is required for these changes
  • I don't know and would appreciate guidance

If these changes modify the database schema, you should include a database migration. Please check as applicable:

  • I have written a migration and upgraded a test database based on main and confirmed that the migration applies cleanly
  • I have written a migration but have not upgraded a test database based on main and would like the reviewer to do so
  • I need help writing a database migration
  • No database schema changes are needed

Setting the TAB order after the widgets have been added to their parent
prevents the following warning from being printed to stderr when
selecting a source for the first time:

    QWidget::setTabOrder: 'first' and 'second' must be in the same window
@gonzalo-bulnes gonzalo-bulnes requested a review from a team as a code owner May 30, 2021 01:53
@sssoleileraaa sssoleileraaa added this to Under Review in SecureDrop Team Board Jun 7, 2021
Copy link
Contributor

@sssoleileraaa sssoleileraaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Cross-check that the TAB order is applied as expected
  • Verify that the warnings are indeed resolved

I also tested in Qubes and checked if I could repro #693 -- I could not. It looks like this PR takes care of the remainder of the tab warnings.

@sssoleileraaa sssoleileraaa merged commit bc7e116 into freedomofpress:main Jun 8, 2021
SecureDrop Team Board automation moved this from Under Review to Done Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants