Closed liferooter closed 2 years ago
Thanks for your efforts, @liferooter . I'll take a look at this soon when I'm done with finals. One thing you should keep in mind is that I wrote this code to be compatible with Vala 0.48 and Ubuntu 20.04 / eOS 6. If you're changing things, please make sure that Valdo is still compatible with those OSes. For example, null-safe member accesses are nice but are too recent in Vala for me to use.
If you're changing things, please make sure that Valdo is still compatible with those OSes.
Okay, I'll try to keep compability and test on these OSes
@liferooter You should try to get this stuff merged soon. I think I'd prefer if you sent me multiple PRs, that way I can evaluate your changes more thoroughly and merge them sooner before merge conflicts arise.
You should try to get this stuff merged soon.
Okay, I'll finish today
@Prince781 now PR has no conflicts and ready for review and merging
A couple of things:
valdo
without any arguments should show a list of all available templates. You must not remove this behavior.
ubuntu@ubuntu:~/dev/valdo$ valdo -l
(valdo:3132): Json-WARNING **: 15:46:29.593: Failed to deserialize "description" property of type "(null)" for an object of type "ValdoTemplate"
(valdo:3132): Json-WARNING **: 15:46:29.593: Failed to deserialize "description" property of type "(null)" for an object of type "ValdoTemplate"
(valdo:3132): Json-WARNING **: 15:46:29.593: Failed to deserialize "description" property of type "(null)" for an object of type "ValdoTemplate"
(valdo:3132): Json-WARNING **: 15:46:29.593: Failed to deserialize "description" property of type "(null)" for an object of type "ValdoTemplate"
lib - (null) gtk - (null) new - (null) swifty-gtk4 - (null) eos - (null) ubuntu@ubuntu:~/dev/valdo$
Running
valdo
without any arguments should show a list of all available templates. You must not remove this behavior.
I think that such behavior is non-typical and non-intuitive, doesn't it?
I think that such behavior is non-typical and non-intuitive, doesn't it?
It's perfectly intuitive—the user sees all available templates if he/she didn't request one. There's no rule that says you can't do this. And if you want to talk about other programs that do a similar thing, dotnet new
does this too.
I think the rest of the code is pretty well-organized. I wrote this quickly and so it's nice to see someone taking the time to make the code look nice. 😃
2. Deserializing the template JSON fails on Ubuntu 20.04:
ubuntu@ubuntu:~/dev/valdo$ valdo -l (valdo:3132): Json-WARNING **: 15:46:29.593: Failed to deserialize "description" property of type "(null)" for an object of type "ValdoTemplate" (valdo:3132): Json-WARNING **: 15:46:29.593: Failed to deserialize "description" property of type "(null)" for an object of type "ValdoTemplate" (valdo:3132): Json-WARNING **: 15:46:29.593: Failed to deserialize "description" property of type "(null)" for an object of type "ValdoTemplate" (valdo:3132): Json-WARNING **: 15:46:29.593: Failed to deserialize "description" property of type "(null)" for an object of type "ValdoTemplate" (valdo:3132): Json-WARNING **: 15:46:29.593: Failed to deserialize "description" property of type "(null)" for an object of type "ValdoTemplate" Available templates: -------------------- lib - (null) gtk - (null) new - (null) swifty-gtk4 - (null) eos - (null) ubuntu@ubuntu:~/dev/valdo$
Just reproduces this bug in Ubuntu 20.04 VM. Have no idea what's wrong and how to fix it without manuary reading every property of every class. But all works on Elementary OS 6.1 with Vala 0.48.20 and there will be new Ubuntu LTS soon with even newer Vala. So may I spit on compatibility with too old Ubuntu which requires to make the app don't use some really needed Vala features?
But all works on Elementary OS 6.1 with Vala 0.48.20 and there will be new Ubuntu LTS soon with even newer Vala. So may I spit on compatibility with too old Ubuntu which requires to make the app don't use some really needed Vala features?
Yes, but then you must change meson.build
to require json-glib >= 1.5.2
I had to keep a workaround for JSON-GLib 1.4.4 because eOS 7 won't come out for another 5-6 months and this package won't be updated for the current release.
@liferooter merged. Thanks a lot!
Some code and mechanism improvements