Replace QModelIndex::child() to avoid a deprecation warning.
[debian/confclerk.git] / src / mvc / delegate.cpp
index 2d1f08524084873ea61ee03ad94879a50a826960..99da5c166d807ea49d8fae0d4b058a9806ff0586 100644 (file)
@@ -363,7 +363,7 @@ int Delegate::numberOfFavourities(const QModelIndex &index) const
 
     int nrofFavs = 0;
     for(int i=0; i<index.model()->rowCount(index); i++)
-        if(static_cast<Event*>(index.child(i,0).internalPointer())->favourite() != Favourite_no)
+        if(static_cast<Event*>(index.model()->index(i, 0, index).internalPointer())->favourite() != Favourite_no)
             nrofFavs++;
 
     return nrofFavs;
@@ -376,7 +376,7 @@ int Delegate::numberOfAlarms(const QModelIndex &index) const
 
     int nrofAlarms = 0;
     for(int i=0; i<index.model()->rowCount(index); i++)
-        if(static_cast<Event*>(index.child(i,0).internalPointer())->hasAlarm())
+        if(static_cast<Event*>(index.model()->index(i, 0, index).internalPointer())->hasAlarm())
             nrofAlarms++;
 
     return nrofAlarms;