- first experiments with QJson serialization
[buliscores] / src / src / matchdaymodel.cpp
index 0fdedf3..9053229 100644 (file)
@@ -23,9 +23,7 @@ MatchDayModel::MatchDayModel(QObject *parent, MatchDayBackend *backend) :
 
 int MatchDayModel::rowCount(const QModelIndex&) const
 {
-    int count = m_backend->matchList().count();
-
-    return count;
+    return m_backend->matchCount();
 }
 
 int MatchDayModel::columnCount(const QModelIndex&) const
@@ -40,7 +38,7 @@ QVariant MatchDayModel::data(const QModelIndex& index, int role) const
     QSize        s;
     QIcon        i;
 
-    if ((match = m_backend->matchList().at(index.row())) == NULL) {
+    if ((match = m_backend->getMatch(index.row())) == NULL) {
         return QVariant(QVariant::Invalid);
     }
 
@@ -208,10 +206,10 @@ void MatchDayModel::onUpdateFinished(int)
     //add rows
     beginInsertRows(QModelIndex(),
                     0,
-                    m_backend->matchList().count() - 1);
+                    m_backend->matchCount() - 1);
     endInsertRows();
 
-    m_lastRowCount = m_backend->matchList().count() - 1;
+    m_lastRowCount = m_backend->matchCount() - 1;
 
     // invalidate complete data
     qDebug() << "MatchDayModel::emit dataChanged: " << rowCount(QModelIndex());