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

Oculars: begin code cleanup #1633

Merged
merged 6 commits into from
May 5, 2021
Merged

Oculars: begin code cleanup #1633

merged 6 commits into from
May 5, 2021

Conversation

treaves
Copy link
Contributor

@treaves treaves commented Apr 30, 2021

Description

This is the start of code cleanup. But as there is so much to do, it's going to take too long to do it at once. This needs to be merged into master before more work can cinque; I just lost a few days of work due to a bad merge from upstream.

Initial cleanup on Oculars model classes.
First pass.  Much more to do.
from array subscript to at().
# Conflicts:
#	plugins/Oculars/src/gui/OcularDialog.cpp
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thanks for adding your first pull request to Stellarium. If you have questions, please do not hesitate to contact us.

@alex-w
Copy link
Member

alex-w commented May 1, 2021

Please check CI/Linux and CI/AppVeyor reports.

@gzotti
Copy link
Member

gzotti commented May 1, 2021

Interesting new syntax, I have never seen the "auto XY() --> type" . Are there real benefits? Cannot say. Makes reading harder for me.

Do I understand I shall definitely no longer bother with #1521. Fine for me, as long as our intended functionality does not suffer:

  • separate view settings (store+reconfigure a few visibility settings on activation of Ocular or Sensor)
  • optional auto-estimate of telescopic visibility conditions
  • store current state of those and restore the cached main view settings on exit to main view.

@treaves
Copy link
Contributor Author

treaves commented May 1, 2021

Please check CI/Linux and CI/AppVeyor reports.

Yes, those build setups are broken. Not the code.

@treaves
Copy link
Contributor Author

treaves commented May 1, 2021

Interesting new syntax, I have never seen the "auto XY() --> type" . Are there real benefits? Cannot say. Makes reading harder for me.

Do I understand I shall definitely no longer bother with #1521. Fine for me, as long as our intended functionality does not suffer:

  • separate view settings (store+reconfigure a few visibility settings on activation of Ocular or Sensor)

  • optional auto-estimate of telescopic visibility conditions

  • store current state of those and restore the cached main view settings on exit to main view.

There are benefits to the trailing returns.

Yes, I intend to do that functionality and more.

@axd1967
Copy link
Contributor

axd1967 commented May 1, 2021

@alex-w
Copy link
Member

alex-w commented May 1, 2021

Please check CI/Linux and CI/AppVeyor reports.

Yes, those build setups are broken. Not the code.

Syntax errors in the code are not code problem. Nice!

Copy link
Member

@alex-w alex-w left a comment

Choose a reason for hiding this comment

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

Do you really need to use macro Q_DISABLE_COPY_MOVE(Class)?

@treaves
Copy link
Contributor Author

treaves commented May 2, 2021

Do you really need to use macro Q_DISABLE_COPY_MOVE(Class)?

I'll looks at the two separate macros tomorrow. But, yes, they need to be used an any subclass of QObject. And to your other comment, the two build failures are not do to issues in my code; you don't use a semicolon at the end of a macro. Is that why you suggest using the two macros?

@alex-w
Copy link
Member

alex-w commented May 2, 2021

I'll looks at the two separate macros tomorrow. But, yes, they need to be used an any subclass of QObject.

For what? Which reasons for use this macros?

And to your other comment, the two build failures are not do to issues in my code; you don't use a semicolon at the end of a macro. Is that why you suggest using the two macros?

Just forget about 2 macros. You use macros, which was introduced in Qt 5.13 and now 2/3 of CI instances and all instances for building binary packages are broken.

@treaves
Copy link
Contributor Author

treaves commented May 3, 2021

I'll looks at the two separate macros tomorrow. But, yes, they need to be used an any subclass of QObject.

For what? Which reasons for use this macros?

And to your other comment, the two build failures are not do to issues in my code; you don't use a semicolon at the end of a macro. Is that why you suggest using the two macros?

Just forget about 2 macros. You use macros, which was introduced in Qt 5.13 and now 2/3 of CI instances and all instances for building binary packages are broken.

Ah. I did not see they were introduced so recently. They are needed because of the rule of three/five/zero. I'll replace them for the time being.

Added guard blocks for minimum Qt version for the Q_DISABLE_COPY_MOVE macro.
@github-actions github-actions bot requested a review from alex-w May 3, 2021 13:45
@lgtm-com
Copy link

lgtm-com bot commented May 3, 2021

This pull request introduces 28 alerts and fixes 1 when merging 1bb364a into 5f3aaa6 - view on LGTM.com

new alerts:

  • 28 for Resource not released in destructor

fixed alerts:

  • 1 for FIXME comment

@gzotti
Copy link
Member

gzotti commented May 3, 2021

You can test for Qt versions and include/define what's possible. At some point we will have to step up to 5.15 and replace QtScript usage, before we can prepare further moving on to Qt6.

@treaves
Copy link
Contributor Author

treaves commented May 3, 2021

You can test for Qt versions and include/define what's possible. At some point we will have to step up to 5.15 and replace QtScript usage, before we can prepare further moving on to Qt6.

Ya, that's what I pushed earlier.

@treaves
Copy link
Contributor Author

treaves commented May 4, 2021

Do you really need to use macro Q_DISABLE_COPY_MOVE(Class)?

Did you see I put this into a guard?

Remove blank line.
@lgtm-com
Copy link

lgtm-com bot commented May 4, 2021

This pull request introduces 28 alerts and fixes 1 when merging 73043f6 into 5f3aaa6 - view on LGTM.com

new alerts:

  • 28 for Resource not released in destructor

fixed alerts:

  • 1 for FIXME comment

Copy link
Member

@alex-w alex-w left a comment

Choose a reason for hiding this comment

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

Well, it works.

@alex-w alex-w added this to the 0.21.1 milestone May 5, 2021
@alex-w alex-w merged commit cd262d8 into Stellarium:master May 5, 2021
@treaves treaves deleted the Oculars branch May 5, 2021 15:20
@alex-w alex-w removed this from the 0.21.1 milestone Jun 12, 2021
@alex-w
Copy link
Member

alex-w commented Jun 12, 2021

All changes extracted to https://github.com/Stellarium/stellarium/tree/oculars-ng branch

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

Successfully merging this pull request may close these issues.

4 participants