QObject(parent)
{
m_date = date;
- m_lastevent = QDateTime::currentDateTime();
m_homeTeam = hometeam;
m_awayTeam = awayteam;
if (m_homeScore != home) {
m_homeScore = home;
+ if (oldhomescore != -1) {
+ m_lastHomeGoal = QDateTime::currentDateTime();
+ }
changed = true;
}
if (m_awayScore != away) {
m_awayScore = away;
+ if (oldawayscore != -1) {
+ m_lastAwayGoal = QDateTime::currentDateTime();
+ }
changed = true;
}
- if (changed) {
- m_lastevent = QDateTime::currentDateTime();
- if(notifyWatchers) {
- emit scoreChanged(oldhomescore, oldawayscore,
- home, away);
- }
+ if (changed && notifyWatchers) {
+ emit scoreChanged(oldhomescore, oldawayscore,
+ home, away);
}
}
void Match::setState(MatchState state, bool notifyWatchers) {
if (m_state != state) {
m_state = state;
- m_lastevent = QDateTime::currentDateTime();
if (notifyWatchers) {
emit stateChanged(state);
}