This change reduces memory usage during compilation from ~1.2GB to ~600MB.
Additionally it reduces the size of a dynamically linked qTox binary from
~10MB to ~6MB.
QVector<T>::removeOne() was added in Qt 5.4, and this method usage
broke build for Debian 8 whitch has Qt 5.3.2.
Add alternative implementation and comment for the future to use
removeOne() when this becomes possible.
Closes#3416
Colomban Wendling (10):
fix(capslockindicator): fix altering the line edit height
fix(capslock_x11): properly release the X display handle
refactor(capslockindicator): encapsulate event handling
fix(capslockindicator): also update indicator when the app gets focus
refactor(capslockindicator): expose as a QAction to simplify API
refactor(capslockindicator): use a single shared event handler
refactor(capslockindicator): avoid overhead on OSX
refactor: replace CapsLockIndicator with new PasswordEdit widget
fix(passwordfields): use PasswordEdit widget for all password fields
refactor(passwordedit): don't add the caps indicator at all if disabled
Add missing copyright stuff to `merge-pr.sh`.
Refactored & split `merge-pr.sh` script, since most of required
code for `test-pr.sh` already existed there.
Differences from `merge-pr.sh`:
* if there's no `upstream` remote, https version is used instead of
git
* merge commit *is not* GPG-signed (less hassle)
* merge branch is named e.g. `test1234` instead of `merge1234`
* instructions for pushing test branch onto upstream master are not
printed
Introduce a new PasswordEdit widget extending QLineEdit that takes care
of all the specifics of a QLineEntry when it is used to input a
password, including echo mode and caps lock indicator.
Also optimize the event handling to only listen to global events when
it is actually needed, e.g. when a password field is actually visible.
Optimize the implementation by using a single shared event handler,
managing the caps lock state check and propagating it appropriately to
all instances at once.
This allows to have an up-to-date indicator when the caps lock state
changed outside of the application and the user comes back to it, even
if it doesn't trigger a Show event (e.g. the window was visible all the
time).
* The initial status icon to set on GTK didn't exist (anymore?).
* GTK resources aren't compatible with Qt's, so the resource lookup
couldn't work anyway, even if it did exist.
* The caller calls SystemTryIcon::setIcon() right after instancing it
anyway, so there's no need for an initial icon.
This fixes a runtime critical warning from GTK as we tried to unref a
NULL icon, which is invalid.
Fixes#3154.
Also simplify the memory management by using the C++ allocator and by
using the bytes directly as passed to the free callback instead of
passing it again as user data.
Fix altering the Line Edit widget height when the indicator is on (e.g.
when caps lock is active).
To avoid messing with the style and all the complex issues that arise
from it, use an action to display the icon inside the line edit, as it
is a built-in feature that work just fine.
Fixes#3379.