Commit 3b4cb8bd authored by Dimitris Kardarakos's avatar Dimitris Kardarakos

Relolad tasks when calendar changes

parent 34e7a3db
......@@ -32,7 +32,7 @@ Kirigami.ApplicationWindow {
*/
signal refreshNeeded;
onRefreshNeeded: todosView.refreshNeeded()
onRefreshNeeded: todosView.reload()
globalDrawer: Kirigami.GlobalDrawer {
id: drawer
......@@ -78,7 +78,10 @@ Kirigami.ApplicationWindow {
name: calindoriConfig.activeCalendar
onNameChanged: root.refreshNeeded()
onNameChanged: {
root.refreshNeeded();
root.pageStack.pop(null);
}
}
/**
......
......@@ -31,10 +31,12 @@ Kirigami.Page {
signal editTask(var modelData)
signal taskDeleted
signal refreshNeeded
onRefreshNeeded: cardsListview.model.reloadTasks()
function reload()
{
cardsListview.model.reloadTasks();
}
title: qsTr("Tasks")
Kirigami.CardsListView {
......
......@@ -23,7 +23,9 @@ TodosModel::TodosModel(QObject* parent)
m_todos(Todo::List()),
m_calendar(nullptr),
m_filterdt(QDate())
{}
{
connect(this, &TodosModel::memorycalendarChanged, this, &TodosModel::reloadTasks);
}
TodosModel::~TodosModel() = default;
......@@ -86,6 +88,8 @@ MemoryCalendar::Ptr TodosModel::memorycalendar() const
void TodosModel::setMemorycalendar(MemoryCalendar::Ptr calendarPtr)
{
m_calendar = calendarPtr;
emit memorycalendarChanged();
}
QDate TodosModel::filterdt() const
......@@ -104,7 +108,6 @@ void TodosModel::setFilterdt(QDate filterDate)
}
int TodosModel::rowCount(const QModelIndex& parent) const
{
if(parent.isValid())
......
Markdown is supported
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