By profiling qTox using perf I discovered, that
NotificationIcon::updateGradient takes significant amount of CPU time
even though qTox is idle and no one is typing.
This commit fixes:
1) correctly determine visibility of NotificationIcon
2) only invalidate boundingRect in fixed intervals
3) apply the same fixes to Spinner since it has the same problem
* Replace lines/messages with helper class to synchronize state between
IChatLog and ChatLog more easily
* selection indexes have been replaced with ChatLine::Ptrs, this is to
ensure consistency while the view slides around
* This has another benefit of removing all the code that has to
manually slide the selection boxes around
* Replaced all insertion/removal functions with single "insertAtIdx".
This helps ensure that mappings between ChatLogIdx and position within
the view are captured correctly as items in the view slide around
* workerTimeout replaced with more generic name "renderFinished" that is
used in synchronous and asynchronous paths
* Removed unused function ChatForm::insertChatMessage
* Re-implemented "Go to current date" with new ChatLog APIs
* Removed unused GenericChatForm::addSystemDateMessage. This is handled
by ChatLog now
* Resolves#6223
* Resolves#5878
* Resolves#5940
* Simplifies reasoning about who owns what functionality between
GenericChatForm and ChatLog. GenericChatForm is now just a layout
class and ChatLog handles all interactions with retrieving and
displaying messages from the model
* Reasoning for work is described in more detail in #6223
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.
Reuse code from the file transfer widget to provide an image preview
on paste/grab. This prevents users from accidentally sending images they
did not mean to when their clipboard is not in the state they thought it
was.
Implementation exposes the genericchatlog vbox to the child classes and
chatform injects the imagepreview into it.
* Rendering of system messages consolidated into single place
* API added to ichatlog to insert a system message at current location
* System messages are now used as type + args which will fit nicely with
the work in #6221
When running with -DASAN on and a mod to send 10k messages in quick
succession I was seeing memory corruption within toxext. This was caused
by a race between toxext_iterate and toxext_send being called from
different threads.
Protect the use of functions coming from different threads with a mutex
bodwok (4):
refactor(ui): separation of responsibility for sorting the contact list
fix(build): include QVector type
refactor(ui): code improvement
refactor(ui): code improvement