mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Merge pull request #3424
Colomban Wendling (1): refactor(passwordedit): optimize event handler unregistration
This commit is contained in:
commit
4f493c5df7
|
@ -42,10 +42,11 @@ void PasswordEdit::registerHandler()
|
|||
void PasswordEdit::unregisterHandler()
|
||||
{
|
||||
#ifdef ENABLE_CAPSLOCK_INDICATOR
|
||||
if (eventHandler && eventHandler->actions.contains(action))
|
||||
int idx;
|
||||
|
||||
if (eventHandler && (idx = eventHandler->actions.indexOf(action)) >= 0)
|
||||
{
|
||||
//TODO: future: use removeOne() when Qt 5.3 (Debian 8) support ends.
|
||||
eventHandler->actions.remove(eventHandler->actions.indexOf(action));
|
||||
eventHandler->actions.remove(idx);
|
||||
if (eventHandler->actions.isEmpty())
|
||||
{
|
||||
delete eventHandler;
|
||||
|
|
Loading…
Reference in New Issue
Block a user