Commit 762f55a7 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Source models are simpler now

parent c0a2eafc
......@@ -72,16 +72,6 @@ QHash<int, QByteArray> SourcesModel::roleNames() const
return roles;
}
static bool ensureModel(const QList<QByteArray> &roles)
{
static auto required = {"display", "checked"};
for (const auto &role: required) {
if (!roles.contains(role))
return false;
}
return true;
}
void SourcesModel::addSourcesBackend(AbstractSourcesBackend* sources)
{
auto backend = qobject_cast<AbstractResourcesBackend*>(sources->parent());
......@@ -90,7 +80,6 @@ void SourcesModel::addSourcesBackend(AbstractSourcesBackend* sources)
return;
b->m_sources = sources;
Q_ASSERT(ensureModel(sources->sources()->roleNames().values()));
auto m = sources->sources();
m->setProperty(DisplayName, backend->displayName());
addSourceModel(m);
......
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