mirror of
git://git.savannah.nongnu.org/eliot.git
synced 2024-11-17 07:48:27 +01:00
PlayModel: do not emit the coordChanged() signal when no change occurred
This commit is contained in:
parent
c31b789fc5
commit
1e551207fb
3 changed files with 6 additions and 4 deletions
|
@ -461,8 +461,7 @@ void ArbitrationWidget::updateCoordText(const Coord &iNewCoord)
|
|||
void ArbitrationWidget::updatePlayModel(const QString &iText)
|
||||
{
|
||||
Coord coord(wfq(iText));
|
||||
if (!(m_playModel.getCoord() == coord))
|
||||
m_playModel.setCoord(coord);
|
||||
m_playModel.setCoord(coord);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -26,6 +26,10 @@ INIT_LOGGER(qt, PlayModel);
|
|||
|
||||
void PlayModel::setCoord(const Coord &iCoord)
|
||||
{
|
||||
// Avoid useless work
|
||||
if (iCoord == m_currCoord)
|
||||
return;
|
||||
|
||||
m_prevCoord = m_currCoord;
|
||||
m_currCoord = iCoord;
|
||||
emit coordChanged(iCoord, m_prevCoord);
|
||||
|
|
|
@ -214,8 +214,7 @@ void PlayWordMediator::playWord()
|
|||
void PlayWordMediator::onCoordChanged(const QString &iText)
|
||||
{
|
||||
Coord coord(wfq(iText));
|
||||
if (!(m_playModel.getCoord() == coord))
|
||||
m_playModel.setCoord(coord);
|
||||
m_playModel.setCoord(coord);
|
||||
updatePointsAndState();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue