Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 1882e410 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Improve startup time

Group categories creation instead of doing them one by one which ends
up being quite slow for the drawer.
parent ccc1eae7
......@@ -30,7 +30,11 @@
CategoryModel::CategoryModel(QObject* parent)
: QObject(parent)
{
connect(ResourcesModel::global(), &ResourcesModel::backendsChanged, this, &CategoryModel::populateCategories);
QTimer* t = new QTimer(this);
t->setInterval(0);
t->setSingleShot(true);
connect(t, &QTimer::timeout, this, &CategoryModel::populateCategories);
connect(ResourcesModel::global(), &ResourcesModel::backendsChanged, t, QOverload<>::of(&QTimer::start));
}
CategoryModel * CategoryModel::global()
......
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