1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00
Commit Graph

11 Commits

Author SHA1 Message Date
Anthony Bilinski
0d366a5790
chore(build): Enable all warnings on qTox libraries as well
warnings interface was only being linked to qtox_static, so were not being
applied to e.g. util. Link it to each library as well as qtox_static so that
they all inherit all the warnings.
2022-03-24 04:19:41 -07:00
Anthony Bilinski
cabcf4111f
refactor(style): Match declaration and definition argument names
Conform with readability-named-parameter and
readability-inconsistent-declaration-parameter-name
2022-03-15 08:19:53 -07:00
Anthony Bilinski
1206da2b05
refactor(ToxPk): Don't define model's ToxPk, ToxId, GroupId from tox.h
Since they exist in saved settings and the chat database, they are their own
size. assert that it matches tox.h's size in Core constructor, though.
2022-03-13 05:28:41 -07:00
Anthony Bilinski
6f3fb30f24
feat(test): Add mock bootstrap list generator 2022-03-13 01:50:47 -08:00
Anthony Bilinski
48ad6cc17a
refactor: Comply with Wunused-parameter
Explicitly ignore unused parameters.

Also replace Q_UNUSED with std::ignore for consistency and to favour std
over Qt when equivalent.
2022-03-11 10:07:57 -08:00
Anthony Bilinski
fc2e445294
refactor: Comply with Wshadow
Avoid shadowing variables:
* Rename variables to something better if possible
* If not, postfix shadowing arguments with _. Favour leaving member
  variables without postfixes.
* Rename variables prefixed with _ to avoid library function collisions
* Avoid double underscore anywhere in names
* Make definition and declaration argument names match where seen
* Favour using class variable over argument variable, where equivalent
* Remove explicit this-> where equivalent
2022-03-11 08:35:38 -08:00
Anthony Bilinski
bc751c8e1c
refactor(test): Move mocks into their own library
Avoid re-compiling sources for each test that uses them.
2022-03-02 23:30:04 -08:00
Anthony Bilinski
40846f886c
refactor(test): Deduplicate MockCoreSettings
Also add Mock sources to all tests, to handle tests that require both project
resources and mock without complicating auto_test
2022-03-02 23:30:04 -08:00
Brandon Mosher
1438f8f766 refactor: Provide a Virtual Method Anchor for Classes in Headers
Define at least one virtual method in polymorphic class cpp files to
improve link efficiency. Do so by defining a defaulted destructor or
another overridden virtual method in the class cpp file.
Also add explicitly defaulted copy/move constructors and assignment
operators to follow the rule of five and to avoid compiler suppression
of these functions due to the addition of a user-provided destructor.
Where neccessary, create new cpp files and add them to CMakeLists and
Testing.cmake. Set the -Wweak-vtables by default when compiling with
clang to issue warnings for new classes that do not comply with this
pattern.

See http://llvm.org/docs/CodingStandards.html#provide-a-virtual-method-anchor-for-classes-in-headers.

Fixes #6036.
2021-10-26 16:47:40 +00:00
Mick Sayson
6e163ca5ed
feat(notification): Notifications now always replace the previous one
This is a feature/fix to improve notification behavior when we receive
over 3 messages.

SnoreNotify prevents over 3 notifications from being displayed before a
user clears the notification. This is presumably to avoid infinite
notification spam.

Unfortunately this results in the notifications just coming in _after_
the user clears them. This means if there are 100s of messages built up
the user has to clear their notifications N messages / 3 times.

This feature/fix folds all notifications into a single notification
representing the current qTox notification state. See
notificationgenerator_test.cpp for what the new messages look like.
2020-05-17 00:00:53 -07:00
Mick Sayson
a9f6543e43
feat(notification): Notification string generator for multiple messages 2020-05-17 00:00:48 -07:00