Don't call enableEdition() every time a change is made

We only need to do this once.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-03-10 10:50:18 -07:00
parent 2c2adacb90
commit 4796ee0c39

View file

@ -768,7 +768,8 @@ void LocationInformationWidget::markChangedWidget(QWidget *w)
{ {
QPalette p; QPalette p;
qreal h, s, l, a; qreal h, s, l, a;
enableEdition(); if (!modified)
enableEdition();
qApp->palette().color(QPalette::Text).getHslF(&h, &s, &l, &a); qApp->palette().color(QPalette::Text).getHslF(&h, &s, &l, &a);
p.setBrush(QPalette::Base, (l <= 0.3) ? QColor(Qt::yellow).lighter() : (l <= 0.6) ? QColor(Qt::yellow).light() : /* else */ QColor(Qt::yellow).darker(300)); p.setBrush(QPalette::Base, (l <= 0.3) ? QColor(Qt::yellow).lighter() : (l <= 0.6) ? QColor(Qt::yellow).light() : /* else */ QColor(Qt::yellow).darker(300));
w->setPalette(p); w->setPalette(p);