projects
/
buliscores
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- don't play sounds on initial update
[buliscores]
/
src
/
match.cpp
diff --git
a/src/match.cpp
b/src/match.cpp
index
9850d7f
..
64a5f90
100644
(file)
--- a/
src/match.cpp
+++ b/
src/match.cpp
@@
-4,6
+4,7
@@
Match::Match(QString hometeam, QString awayteam, QDateTime date, QObject *parent
QObject(parent)
{
m_date = date;
QObject(parent)
{
m_date = date;
+ m_lastevent = QDateTime::currentDateTime();
m_homeTeam = hometeam;
m_awayTeam = awayteam;
m_homeTeam = hometeam;
m_awayTeam = awayteam;
@@
-64,7
+65,7
@@
QIcon Match::getEmblemByName(QString team)
return i;
}
return i;
}
-void Match::setScore(int home, int away)
+void Match::setScore(int home, int away, bool notifyWatchers)
{
bool changed = false;
int oldhomescore = m_homeScore;
{
bool changed = false;
int oldhomescore = m_homeScore;
@@
-81,14
+82,20
@@
void Match::setScore(int home, int away)
}
if (changed) {
}
if (changed) {
- emit scoreChanged(oldhomescore, oldawayscore,
- home, away);
+ m_lastevent = QDateTime::currentDateTime();
+ if(notifyWatchers) {
+ emit scoreChanged(oldhomescore, oldawayscore,
+ home, away);
+ }
}
}
}
}
-void Match::setState(MatchState state) {
+void Match::setState(MatchState state, bool notifyWatchers) {
if (m_state != state) {
m_state = state;
if (m_state != state) {
m_state = state;
- emit stateChanged(state);
+ m_lastevent = QDateTime::currentDateTime();
+ if (notifyWatchers) {
+ emit stateChanged(state);
+ }
}
}
}
}