Commit b421f1e2 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Readability

parent 2b6140a9
......@@ -26,6 +26,7 @@
#include <QFile>
#include <QStandardPaths>
#include <QDebug>
#include <utils.h>
Category::Category(QSet<QString> pluginName, QObject* parent)
: QObject(parent)
......@@ -220,12 +221,7 @@ QUrl Category::decoration() const
QVariantList Category::subCategoriesVariant() const
{
QVariantList ret;
ret.reserve(m_subCategories.count());
for(Category* cat : m_subCategories) {
ret.append(QVariant::fromValue<QObject*>(cat));
}
return ret;
return kTransform<QVariantList>(m_subCategories, [](Category* cat){ return QVariant::fromValue<QObject*>(cat); });
}
bool Category::matchesCategoryName(const QString& name) const
......
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