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.ParamSpec.*'s blurb and nick should be nullable #218

Open
vixalien opened this issue Nov 9, 2024 · 3 comments · May be fixed by #224
Open

GObject.ParamSpec.*'s blurb and nick should be nullable #218

vixalien opened this issue Nov 9, 2024 · 3 comments · May be fixed by #224

Comments

@vixalien
Copy link

vixalien commented Nov 9, 2024

For example, this won't work

GObject.ParamSpec.string(
        "title",
        null,
        null,
        GObject.ParamFlags.READWRITE,
        "",
      )

because the blurb and nick are null.

@JumpLink
Copy link
Collaborator

JumpLink commented Nov 11, 2024

@vixalien I can't find anything about this in the documentation. It may work with null, but is that how it is specified? Perhaps it would be better to define the values or at least use an empty string instead?

I'm also considering reversing the change to the nullable enums; it may work, but it doesn't makes the code better or more readable and could potentially lead to side effects or break something in the future if it is not actually intended that null can be passed. Possibly these are just bugs in the JavaScript examples that you found thanks to TypeScript?

@vixalien
Copy link
Author

Yeah actually I think you should reverse the change to allow null enumerations.

For the GObject.ParamSpec.string, you can see that the similar method GObject.param_spec_string does allow those to be null

@JumpLink
Copy link
Collaborator

Okay thanks, then let's do it like this

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

Successfully merging a pull request may close this issue.

2 participants