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

GObject subclass cleanup #180

Merged
merged 6 commits into from
Aug 27, 2024
Merged

Conversation

martinling
Copy link
Member

@martinling martinling commented Aug 27, 2024

Tidies up the parts of our code that define GObject subclasses.

  • Because of the need for concrete rather than generic types at the GObject boundary, a lot of code was duplicated twice, once for the traffic view types and once for the device view types. This PR instead defines that boilerplate code in macros, that are expanded once for each.
  • Each subclass was split into two files (mod.rs for the public side, and imp.rs for the private side). I found this only made things more confusing in practice, so have instead embedded the private side in a mod imp { ... } block at the bottom of the public module, allowing each GObject subclass to be defined in a single file.
  • Overhaul the comments.
  • Rename ExpanderWrapper to the more descriptive name of ItemWidget.

@martinling martinling added the cleanup cleanup of code, process, or documentation label Aug 27, 2024
@miek miek merged commit 6d7cbce into greatscottgadgets:main Aug 27, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup cleanup of code, process, or documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants