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

Use forward-declarations in big editor classes #69062

Merged
merged 1 commit into from
Nov 29, 2022

Conversation

trollodel
Copy link
Contributor

Follow up of #60684

Reduce the number of includes in some editor classes that are included a lot.

Add forward declarations in touched headers.
Remove some unused includes.

@trollodel trollodel requested review from a team as code owners November 23, 2022 18:40
@KoBeWi KoBeWi added this to the 4.0 milestone Nov 23, 2022
@trollodel trollodel force-pushed the lightweight_editor_mass branch from d8459b7 to c5c48dd Compare November 27, 2022 16:56
@trollodel trollodel requested a review from a team as a code owner November 27, 2022 16:56
Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

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

Nice cleanup again.

I noticed you added some new includes in some .h files (editor node, canvas item editor, script text editor etc.). I assume you plan to handle them in follow-up PR(s)?

@trollodel
Copy link
Contributor Author

I noticed you added some new includes in some .h files (editor node, canvas item editor, script text editor etc.). I assume you plan to handle them in follow-up PR(s)?

Not really. They need non-trivial refactoring (and in some cases you can't e.g., with subclasses), which I don't plan to do. What I'll do in follow-up PRs is to further forward declare stuff.

@KoBeWi
Copy link
Member

KoBeWi commented Nov 27, 2022

But includes are only needed when you inherit the class or define a method inside header. I checked these files and it doesn't seem to be the case there.

@trollodel
Copy link
Contributor Author

I checked these files and it doesn't seem to be the case there.

EditorData doesn't agree with you 😀

But includes are only needed when you inherit the class or define a method inside header

Another thing that can't be included are enums defined in classes. This is why, e.g., EditorNode needs editor_plugin.h.
This is what I gather from a quick search. If there is some obscure C++ syntax for it, then I'm happy to use that and remove the includes.

editor/editor_node.h Outdated Show resolved Hide resolved
@trollodel trollodel force-pushed the lightweight_editor_mass branch from c5c48dd to f13664d Compare November 29, 2022 07:42
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

Needs a rebase to solve a merge conflict, otherwise should be good to merge.

@trollodel trollodel force-pushed the lightweight_editor_mass branch from f13664d to e03eaa8 Compare November 29, 2022 08:59
@trollodel trollodel force-pushed the lightweight_editor_mass branch from e03eaa8 to c90d0bd Compare November 29, 2022 09:00
@akien-mga akien-mga merged commit 3d2c3aa into godotengine:master Nov 29, 2022
@akien-mga
Copy link
Member

Thanks!

@trollodel trollodel deleted the lightweight_editor_mass branch November 29, 2022 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants