D7015: fix double search dialog trigger caused by excess manual slot connection
Harald Sitter
noreply at phabricator.kde.org
Mon Jul 31 09:15:55 UTC 2017
sitter created this revision.
Restricted Application added a subscriber: kde-utils-devel.
REVISION SUMMARY
QPushButtons have a defaultyness which causes the "default" to get a click
signal if return gets pressed. Combined with the manual connection from
QLineEdit this causes a double trigger of slotSearch resulting
in the search dialog popping up, after closing popping up again (second
connection).
Given the defaultyness of QPB the manual connection from the QLE to the
search slot is not necessary as hitting return will trigger the search
anyway due to auto-defaultyness.
To make the defaultyness more assertive in the code we'll set the search
button as manual default (gets triggered whenever no auto-default button
has focus). Additionally, the manual connection from QLE to the search slot
gets dropped as it is unnecessary.
This prevents the dialog from opening twice *and* has the side effect of
making the dialog properly keyboard accessible. Previously if you entered
a keyid and tabbed your way to the import button the import would run, BUT
so would a search (due to the connection). Using defaultyness we'll now
run search unless the user explicitly gave import focus (e.g. by tabbing to
it).
CHANGELOG: fix duplicated dialog when searching for keys
REPOSITORY
R358 KGpg
BRANCH
Applications/17.08
REVISION DETAIL
https://phabricator.kde.org/D7015
AFFECTED FILES
keyservers.cpp
To: sitter, dakon
Cc: kde-utils-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-utils-devel/attachments/20170731/4512fe6c/attachment.html>
More information about the Kde-utils-devel
mailing list