Improve QGtk3FontDialogHelper::onAccepted()

Call currentFont() only once. It does a conversion from a Pango font
description string to a Qt font, so not entirely trivial operation.

Change-Id: Ic67b7c5b0874621c51a5cce4766acd4243d3dfde
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
This commit is contained in:
J-P Nurmi 2016-06-20 10:35:56 +02:00
parent cf53aa21bf
commit 3aaa5d6b32

View File

@ -588,9 +588,10 @@ QFont QGtk3FontDialogHelper::currentFont() const
void QGtk3FontDialogHelper::onAccepted() void QGtk3FontDialogHelper::onAccepted()
{ {
emit currentFontChanged(currentFont()); const QFont font = currentFont();
emit currentFontChanged(font);
emit accept(); emit accept();
emit fontSelected(currentFont()); emit fontSelected(font);
} }
void QGtk3FontDialogHelper::applyOptions() void QGtk3FontDialogHelper::applyOptions()