3 Match::Match(QString hometeam, QString awayteam, QDateTime date, QObject *parent) :
7 m_lastevent = QDateTime::currentDateTime();
10 m_awayTeam = awayteam;
14 m_homeEmblem = getEmblemByName(hometeam);
15 m_awayEmblem = getEmblemByName(awayteam);
19 // TODO write team class that allows more attributes
20 // and aliases for team names
21 QIcon Match::getEmblemByName(QString team)
25 if (team == "Hannover 96") {
26 i = QIcon(":/Icons/Hannover.png");
27 } else if (team == "FC St. Pauli") {
28 i = QIcon(":/Icons/St.Pauli.png");
29 } else if (team == "Hamburger SV") {
30 i = QIcon(":/Icons/Hamburg.png");
31 } else if (team == "1. FC Kaiserslautern") {
32 i = QIcon(":/Icons/Kaiserslautern.png");
33 } else if (team == "1. FSV Mainz 05") {
34 i = QIcon(":/Icons/Mainz.png");
35 } else if (team == "1899 Hoffenheim") {
36 i = QIcon(":/Icons/Hoffenheim.png");
37 } else if (team == "Borussia M'gladbach") {
38 i = QIcon(":/Icons/Mönchengladbach.png");
39 } else if (team == "VfL Wolfsburg") {
40 i = QIcon(":/Icons/Wolfsburg.png");
41 } else if (team == "SC Freiburg") {
42 i = QIcon(":/Icons/Freiburg.png");
43 } else if (team == "1. FC Köln") {
44 i = QIcon(":/Icons/Köln.png");
45 } else if (team == "1. FC Nürnberg") {
46 i = QIcon(":/Icons/Nürnberg.png");
47 } else if (team == "FC Schalke 04") {
48 i = QIcon(":/Icons/Schalke.png");
49 } else if (team == "VfB Stuttgart") {
50 i = QIcon(":/Icons/Stuttgart.png");
51 } else if (team == "Eintracht Frankfurt") {
52 i = QIcon(":/Icons/Frankfurt.png");
53 } else if (team == "Bayer Leverkusen") {
54 i = QIcon(":/Icons/Leverkusen.png");
55 } else if (team == "Werder Bremen") {
56 i = QIcon(":/Icons/Bremen.png");
57 } else if (team == "Borussia Dortmund") {
58 i = QIcon(":/Icons/Dortmund.png");
59 } else if (team == "Bayern München") {
60 i = QIcon(":/Icons/Bayern.png");
68 void Match::setScore(int home, int away, bool notifyWatchers)
71 int oldhomescore = m_homeScore;
72 int oldawayscore = m_awayScore;
74 if (m_homeScore != home) {
79 if (m_awayScore != away) {
85 m_lastevent = QDateTime::currentDateTime();
87 emit scoreChanged(oldhomescore, oldawayscore,
93 void Match::setState(MatchState state, bool notifyWatchers) {
94 if (m_state != state) {
96 m_lastevent = QDateTime::currentDateTime();
98 emit stateChanged(state);