-
Notifications
You must be signed in to change notification settings - Fork 56
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
Assorted quality of life tweaks #760
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Quality Gate passedIssues Measures |
KitsuneRal
force-pushed
the
kitsune/more-tweaks-across
branch
from
May 20, 2024 08:17
fb7ac43
to
973ac32
Compare
KitsuneRal
force-pushed
the
kitsune/more-tweaks-across
branch
3 times, most recently
from
May 26, 2024 15:18
dc98620
to
ed5c1d6
Compare
Mainly headers/comments/formatting/removing old cruft but also replacing std::find_if with std::ranges::find_if in a couple of obvious places and basing EventItem::Code enum on uint16_t instead of leaving it to compiler mercy.
Notably: the error message about a missing specialisation is much clearer compared to deleted dumpTo() / fillFrom().
I was surprised not to find some kind of dereferencing filter in std::ranges, and since making custom views still doesn't quite work as of C++23-tinted C++20 that we have for now, I made an algorithm instead. Curiously, GNU libstdc++ has a bug/feature where std::find[_if]() dereferences the element in the range for your projection if (and only if!) you use that projection is a member function pointer - acting as findIndirect() in that particular situation.
Also: simplify the code around finalize() in quotest, as a result.
Small JSON-editing facilities for stuff you keep needing to do. Also: move a few JSON key name constants where they belong.
In the vast vast majority of cases it should be as simple as calling either asCBytes() or asCWritableBytes() - optionally, with the size passed as a template parameter. They will now work on std::arrays, FixedBuffers, QByteArrays, string literals - anything std::size() and std::data() can be called on.
It was a pre-0.9 cleanup TODO, now closed.
I always had a mental struggle with assertion functions that print a message: the assertion fails when the condition is false but the message is also printed when the condition fails. Moreover, for some reason runtime assert functions have no way of tackling stuff in Release builds: if you want to somehow bail out in a Release build, you have to separately check the condition and then put Q_ASSERT(false) or its equivalent. So here's a "negative assertion" facility - it does have footprint even in Release builds but also helps to somehow move on, rather than just let the Release build crash on an eventual null pointer dereferencing.
...instead of ConnectionEncryptionData, to make it easier to eventually extend support of to-device events that have nothing with encryption (although as of today there are pretty much no such events specced).
KitsuneRal
force-pushed
the
kitsune/more-tweaks-across
branch
from
May 30, 2024 23:24
ed5c1d6
to
33b3dec
Compare
It wraps a rather trivial chain call to QImage::scaled() which clients can just as well do themselves, with the parameters they deem appropriate for _their_ purpose.
Okay, this has been lying around for some time and doesn't seem to break anything on my machine with Quaternion at least. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.