Skip to content

Conversation

@afabri
Copy link
Member

@afabri afabri commented Nov 27, 2025

Summary of Changes

Check that open() worked to avoid warnings here.

Release Management

  • Affected package(s): Lab

  • License and copyright ownership: unchanged

@afabri afabri self-assigned this Nov 27, 2025
@afabri afabri added CGAL 3D demo Warnings For an issue about warnings, or a pull-request that fixes warnings Ready to be tested labels Nov 27, 2025
@afabri afabri added this to the 6.2-beta milestone Nov 27, 2025
Comment on lines +1798 to +1799
bool success = script_file.open(QIODevice::ReadOnly);
if((! success) || (!script_file.isReadable())) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why, wouldn't :

if (!script_file.open(QIODevice::ReadOnly))

be sufficient?

Copy link
Member Author

Choose a reason for hiding this comment

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

I have no idea if in Qt open means readable, and wanted to make a minimal code change. Maybe it is redundant, but at least the warning should be gone.

Copy link
Contributor

@albert-github albert-github Nov 27, 2025

Choose a reason for hiding this comment

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

I think it will be readable seen the used flag.
Indeed a small change is preferable but wouldn't

if (!script_file.open(QIODevice::ReadOnly) || !script_file.script_file.isReadable())

also be considered a small change (I would)

Copy link
Member Author

Choose a reason for hiding this comment

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

I do not understand. Is this a typo or word play ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see a typo, I did edit the response though as at first there were 2 identical conditions (that are shown in the email).

My last suggestion is just the fact that the extra variable and line is not needed is not needed.
The usage of the variable also indicates a bit, at least to me, that it might be used later on as well

Comment on lines +2750 to +2752
bool success = output.open(QIODevice::WriteOnly | QIODevice::Text);

if(!output.isOpen()){
if((! success) || (!output.isOpen())){
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't

if (!script_file.open(QIODevice::ReadOnly))

be sufficient?

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

Labels

CGAL 3D demo Ready to be tested Under Testing Warnings For an issue about warnings, or a pull-request that fixes warnings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants