#include "../headers/brcalendar.h" #include "headers/brprovider.h" BRCalendar::BRCalendar(BRProvider* provider, BRFederation federation, int year, int league) : BRWidget(provider, federation) { this->year = year; this->league = league; } int BRCalendar::getYear() { return this->year; } int BRCalendar::getLeague() { return this->league; } QList BRCalendar::getCompetitions() { return this->competitions; } QList BRCalendar::getCompetitionsQML() { QList tmpCompetitions; for(BRCompetition* competition : this->competitions) tmpCompetitions.append(competition); return tmpCompetitions; } BRWidget::BRWidgetStatusCode BRCalendar::load() { if(this->getProvider() == nullptr) return BRWidget::NoProviderError; // reload all comp data using our providers this->competitions.clear(); this->categories.clear(); this->cups.clear(); // TODO: handle changes dynamically return this->getProvider()->loadCalendarData(this); }