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

Another round of modernization and cleanup #836

Merged
merged 9 commits into from
Nov 26, 2024
Merged

Conversation

KitsuneRal
Copy link
Member

Best reviewed commit by commit. This is mainly about using std::ranges and dropping deprecated or unnecessary pieces; on top of that, util.cpp is now entirely in namespace Quotient because I got tired of remembering to prepend Quotient:: when it comes to free functions; and I tried to improve commitment validation in KeyVerificationSession a bit. I stopped short from comparing decoded hashes instead of base64-encoded ones but maybe decoding and comparing decoded hashes should be fiiine too?..

It's deprecated since 6.6; use our own wrappers for older Qt.
QTimer::singleShot() was a pre-Qt5 idiomatic way to queue a method
invocation; since Qt 5 we have a special static function for that.
This commit changes the non-generated code and GTAD templates; generated
code comes next.
...otherwise each free function in the namespace has to explicitly
mention Quotient:: and it's too easy to forget about it.
(Also, replace explicit QLatin1StringView name calling with _L1)
Mainly, use constrained (aka ranges) algorithms instead of legacy ones.
...which is only one instance, apparently.
Use an anonymous namespace instead of `static` and `std::array` instead
of a C array; inline matrixToUrlRegexInit() function at the only place
it is called from.
The commitment is now checked to actually be valid base64 as we receive
it. Also, it is stored as QByteArray now - thanks to QString and
QByteArray having the same layout (3 pointers + alignment) we can get
away with this without breaking ABI compat.
@KitsuneRal KitsuneRal added the enhancement A feature or change request for the library label Nov 26, 2024
@KitsuneRal KitsuneRal changed the title Another round of modernization and cleeanup Another round of modernization and cleanup Nov 26, 2024
Copy link

sonarcloud bot commented Nov 26, 2024

@KitsuneRal KitsuneRal merged commit 688915f into dev Nov 26, 2024
10 checks passed
@KitsuneRal KitsuneRal deleted the kitsune/cleanup-again branch November 26, 2024 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A feature or change request for the library
Projects
Status: 0.9 - Done
Development

Successfully merging this pull request may close these issues.

2 participants