Commit 2d9fb83a authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Make sure the categories are sorted from the start

parent 69c2d24a
......@@ -35,6 +35,8 @@ QVector<Category*> CategoriesReader::loadCategoriesFile(AbstractResourcesBackend
auto cat = backend->category();
if (cat.isEmpty())
qWarning() << "Couldn't find a category for " << backend->name();
Category::sortCategories(cat);
return cat;
}
return loadCategoriesPath(path);
......@@ -68,5 +70,6 @@ QVector<Category*> CategoriesReader::loadCategoriesPath(const QString& path)
node = node.nextSibling();
}
Category::sortCategories(ret);
return ret;
}
......@@ -53,7 +53,6 @@ void CategoryModel::populateCategories()
if(ret.isEmpty()) {
ret = cats;
Category::sortCategories(ret);
} else {
Q_FOREACH (Category* c, cats)
Category::addSubcategory(ret, c);
......
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