Commit 010b4caa authored by Claudio Cambra's avatar Claudio Cambra
Browse files

Further clean up of todosortfilterproxymodel



Signed-off-by: Claudio Cambra's avatarClaudio Cambra <claudio.cambra@kde.org>
parent 6dec58c4
Pipeline #248937 passed with stage
in 3 minutes and 25 seconds
......@@ -370,7 +370,7 @@ bool TodoSortFilterProxyModel::hasAcceptedChildren(int row, const QModelIndex &s
return false;
}
Akonadi::ETMCalendar::Ptr TodoSortFilterProxyModel::calendar()
Akonadi::ETMCalendar::Ptr TodoSortFilterProxyModel::calendar() const
{
return m_calendar;
}
......@@ -385,7 +385,7 @@ void TodoSortFilterProxyModel::setCalendar(Akonadi::ETMCalendar::Ptr &calendar)
endResetModel();
}
Akonadi::IncidenceChanger *TodoSortFilterProxyModel::incidenceChanger()
Akonadi::IncidenceChanger *TodoSortFilterProxyModel::incidenceChanger() const
{
return m_lastSetChanger;
}
......@@ -398,7 +398,7 @@ void TodoSortFilterProxyModel::setIncidenceChanger(Akonadi::IncidenceChanger *ch
Q_EMIT incidenceChangerChanged();
}
void TodoSortFilterProxyModel::setColorCache(QHash<QString, QColor> colorCache)
void TodoSortFilterProxyModel::setColorCache(const QHash<QString, QColor> colorCache)
{
m_colors = colorCache;
}
......
......@@ -91,11 +91,12 @@ public:
QHash<int, QByteArray> roleNames() const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
bool filterAcceptsRow(int row, const QModelIndex &sourceParent) const override;
bool filterAcceptsRowCheck(int row, const QModelIndex &sourceParent) const;
bool hasAcceptedChildren(int row, const QModelIndex &sourceParent) const;
Akonadi::ETMCalendar::Ptr calendar();
Akonadi::IncidenceChanger *incidenceChanger();
Akonadi::ETMCalendar::Ptr calendar() const;
Akonadi::IncidenceChanger *incidenceChanger() const;
int showCompleted() const;
Filter *filterObject() const;
int sortBy() const;
......@@ -128,15 +129,15 @@ public Q_SLOTS:
protected:
bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
QHash<QString, QColor> colorCache();
void setColorCache(QHash<QString, QColor> colorCache);
void loadColors();
private Q_SLOTS:
void setColorCache(const QHash<QString, QColor> colorCache);
void loadColors();
void updateDateLabels();
void emitDateDataChanged(const QModelIndex &idx);
private:
QHash<QString, QColor> colorCache() const;
QString todoDueDateDisplayString(const KCalendarCore::Todo::Ptr todo, const DueDateDisplayFormat format) const;
int compareStartDates(const QModelIndex &left, const QModelIndex &right) const;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment