Commit a0981f1b authored by Claudio Cambra's avatar Claudio Cambra
Browse files

Removed claendar->isLoaded check as this wouldn't update when adding or...

Removed claendar->isLoaded check as this wouldn't update when adding or deleting a resource, making views never update
parent df244dcb
Pipeline #96930 passed with stage
in 5 minutes and 24 seconds
......@@ -27,13 +27,7 @@ IncidenceOccurrenceModel::IncidenceOccurrenceModel(QObject *parent)
, m_coreCalendar(nullptr)
{
mRefreshTimer.setSingleShot(true);
QObject::connect(&mRefreshTimer, &QTimer::timeout, this, [&]() {
if (m_coreCalendar->isLoaded()) {
updateFromSource();
} else {
mRefreshTimer.start();
}
});
QObject::connect(&mRefreshTimer, &QTimer::timeout, this, &IncidenceOccurrenceModel::updateFromSource);
KSharedConfig::Ptr config = KSharedConfig::openConfig();
KConfigGroup rColorsConfig(config, "Resources Colors");
......@@ -106,6 +100,7 @@ void IncidenceOccurrenceModel::updateQuery()
QObject::connect(m_coreCalendar->model(), &QAbstractItemModel::rowsRemoved, this, &IncidenceOccurrenceModel::refreshView);
QObject::connect(m_coreCalendar->model(), &QAbstractItemModel::modelReset, this, &IncidenceOccurrenceModel::refreshView);
QObject::connect(m_coreCalendar, &Akonadi::ETMCalendar::collectionsRemoved, this, &IncidenceOccurrenceModel::refreshView);
refreshView();
}
......@@ -113,8 +108,8 @@ void IncidenceOccurrenceModel::updateQuery()
void IncidenceOccurrenceModel::refreshView()
{
if (!mRefreshTimer.isActive()) {
// Instant update, but then only refresh every 50ms max.
mRefreshTimer.start(50);
// Instant update, but then only refresh every 100ms max.
mRefreshTimer.start(100);
}
}
......
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